survey-creator-react 3.0.1 → 3.0.2
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SurveyJS Creator v3.0.
|
|
2
|
+
* SurveyJS Creator v3.0.2
|
|
3
3
|
* (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* Github: https://github.com/surveyjs/survey-creator
|
|
5
5
|
* License: https://surveyjs.io/Licenses#SurveyCreator
|
|
6
6
|
*/
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("survey-react-ui"),require("survey-creator-core"),require("react-dom"),require("survey-core")):"function"==typeof define&&define.amd?define(["exports","react","survey-react-ui","survey-creator-core","react-dom","survey-core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SurveyCreator={},e.React,e.SurveyReact,e.SurveyCreatorCore,e.ReactDOM,e.Survey)}(this,function(e,t,r,n,s,o){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var i=a(t),l=a(s);class c extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}constructor(e){super(e),this.rootRef=i.createRef()}renderElement(){const e=this.model.renderedActions.map(e=>i.createElement(m,{item:e,key:e.renderedId}));return i.createElement("div",{ref:this.rootRef,className:"svc-tabbed-menu",role:"tablist",style:this.model.getRootStyle()},e)}componentDidUpdate(e,t){super.componentDidUpdate(e,t);const r=this.rootRef.current;r&&this.model.initResponsivityManager(r)}componentDidMount(){super.componentDidMount();const e=this.rootRef.current;e&&this.model.initResponsivityManager(e)}componentWillUnmount(){this.model.resetResponsivityManager(),super.componentWillUnmount()}}class m extends r.SurveyElementBase{constructor(e){super(e),this.ref=i.createRef(),this.state={changed:0}}get item(){return this.props.item}getStateElement(){return this.item}renderElement(){let e="svc-tabbed-menu-item-container";this.item.css&&(e+=" "+this.item.css),e+=this.item.isVisible?"":" svc-tabbed-menu-item-container--hidden";const t=r.ReactElementFactory.Instance.createElement(this.item.component||"svc-tabbed-menu-item",{item:this.item});return i.createElement("span",{key:this.item.id,className:e,ref:this.ref},i.createElement("div",{className:"svc-tabbed-menu-item-container__content"},t))}componentDidMount(){super.componentDidMount(),this.item.updateModeCallback=(e,t)=>{const r=()=>{this.item.mode==e?this.setState({changed:this.state.changed+1}):this.item.mode=e};queueMicrotask(()=>{l.flushSync?l.flushSync(()=>{r()}):r(),queueMicrotask(()=>{t(e,this.ref.current)})})},this.item.afterRender()}componentWillUnmount(){super.componentWillUnmount(),this.item.updateModeCallback=void 0}}class d extends r.SurveyElementBase{get item(){return this.props.item}getStateElement(){return this.item}render(){const e=this.item;return r.attachKey2click(i.createElement("div",{role:"tab",id:"tab-"+e.id,"aria-selected":e.active,"aria-controls":"scrollableDiv-"+e.id,className:e.getRootCss(),onClick:()=>e.doAction()},e.hasTitle?i.createElement("span",{className:e.getTitleCss()},e.title):null,e.hasIcon?i.createElement(r.SvgIcon,{iconName:e.iconName,className:e.getIconCss(),size:"auto",title:e.tooltip||e.title}):null))}}r.ReactElementFactory.Instance.registerElement("svc-tabbed-menu-item",e=>i.createElement(d,e));class u extends r.SurveyElementBase{constructor(e){super(e),this.rootNode=i.createRef()}get creator(){return this.props.creator}getStateElement(){return this.creator}get style(){return this.props.style}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.creator!==e.creator&&(e.creator&&e.creator.unsubscribeRootElement(),this.creator&&this.rootNode.current&&this.creator.setRootElement(this.rootNode.current))}componentDidMount(){super.componentDidMount(),this.creator.setRootElement(this.rootNode.current)}componentWillUnmount(){super.componentWillUnmount(),this.creator.unsubscribeRootElement()}renderElement(){const e=this.props.creator;if(e.isCreatorDisposed)return null;const t="svc-full-container svc-creator__area svc-flex-column"+(this.props.creator.haveCommercialLicense?"":" svc-creator__area--with-banner"),s="svc-creator__content-wrapper svc-flex-row"+(this.props.creator.isMobileView?" svc-creator__content-wrapper--footer-toolbar":""),o="svc-flex-row svc-full-container svc-creator__side-bar--"+this.creator.sidebarLocation,a={};n.assign(a,this.style,this.props.creator.themeVariables);let l=null;if(!this.props.creator.haveCommercialLicense){const e={__html:this.props.creator.licenseText};l=i.createElement("div",{className:"svc-creator__banner"},i.createElement("span",{className:"svc-creator__non-commercial-text",dangerouslySetInnerHTML:e}))}return i.createElement("div",{className:this.creator.getRootCss(),ref:this.rootNode,style:a},i.createElement(r.SvgBundleComponent,null),i.createElement(r.PopupModal,null),i.createElement("div",{className:t},this.renderCollabBar(),i.createElement("div",{className:o},i.createElement("div",{className:"svc-flex-column svc-flex-row__element svc-flex-row__element--growing"},i.createElement("div",{className:"svc-top-bar"},e.showTabs?i.createElement("div",{className:"svc-tabbed-menu-wrapper"},i.createElement(c,{model:e.tabbedMenu})):null,e.showToolbar?i.createElement("div",{className:"svc-toolbar-wrapper"},i.createElement(r.SurveyActionBar,{model:e.toolbar})):null),i.createElement("div",{className:s},i.createElement("div",{className:"svc-creator__content-holder svc-flex-column"},this.renderActiveTab())),i.createElement("div",{className:"svc-footer-bar"},e.isMobileView?i.createElement("div",{className:"svc-toolbar-wrapper"},i.createElement(r.SurveyActionBar,{model:e.footerToolbar})):null)),this.renderSidebar()),l,i.createElement(r.NotifierComponent,{notifier:e.notifier})))}renderCollabBar(){const e=this.creator.collabBar;return e?r.ReactElementFactory.Instance.createElement("svc-component-container",{model:e.container}):null}renderActiveTab(){const e=this.props.creator;return this.renderCreatorTab(e.activeTabMenuItem)}renderCreatorTab(e){if(!e)return null;const t=this.props.creator,n=e.renderTab?e.renderTab():r.ReactElementFactory.Instance.createElement(e.componentContent,{creator:t,survey:t.survey,data:e.data.model,model:e.data.model}),s="svc-creator-tab"+("right"==t.toolboxLocation?" svc-creator__toolbox--right":"");return i.createElement("div",{role:"tabpanel",key:e.id,id:"scrollableDiv-"+e.id,"aria-labelledby":"tab-"+e.id,className:s},n)}renderSidebar(){return this.creator.isSidebarVisible?r.ReactElementFactory.Instance.createElement("svc-side-bar",{model:this.creator.sidebar}):null}}class h extends n.SurveyCreatorModel{constructor(e={},t){super(e,t)}render(e){console.error("The render method is deprecated. Use SurveyCreatorComponent instead.")}createQuestionElement(e){return r.ReactQuestionFactory.Instance.createQuestion(e.isDefaultRendering()?e.getTemplate():e.getComponentName(),{question:e,isDisplayMode:e.isReadOnly,creator:this})}renderError(e,t,n){return i.createElement("div",{key:e},i.createElement("span",{className:n.error.icon,"aria-hidden":"true"}),i.createElement("span",{className:n.error.item},i.createElement(r.SurveyLocStringViewer,{model:t.locText})))}questionTitleLocation(){return this.survey.questionTitleLocation}questionErrorLocation(){return this.survey.questionErrorLocation}}r.ReactElementFactory.Instance.registerElement("survey-widget",e=>i.createElement(r.Survey,e));class p extends r.SurveyElementBase{constructor(e){super(e),this.createModel(e)}shouldComponentUpdate(e,t){const r=super.shouldComponentUpdate(e,t);return r&&this.needUpdateModel(e)&&this.createModel(e),r}createModel(e){}needUpdateModel(e){const t=this.getUpdatedModelProps();if(!Array.isArray(t))return!0;for(var r=0;r<t.length;r++){const n=t[r];if("object"==typeof n){const t=this.props[n.name],r=e[n.name];if(n.deepEqual){if(this.props[n.name]===e[n.name])return!1;const s=Object.keys(t||{});return s.length!==Object.keys(r||{}).length||s.some(e=>t[e]!=r[e])}return t!==r}if(this.props[n]!==e[n])return!0}return!1}getUpdatedModelProps(){}}class v extends p{constructor(e){super(e)}createModel(e){this.model&&this.model.dispose(),this.model=new n.RowViewModel(e.componentData.creator,e.row,null)}getUpdatedModelProps(){return["row",{name:"componentData",deepEqual:!0}]}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.subscribeElementChanges()}componentWillUnmount(){this.model.unsubscribeElementChanges(),super.componentWillUnmount()}render(){return i.createElement("div",{key:"svc-row-"+this.props.row.id,className:this.model.cssClasses},i.createElement("div",{className:"svc-row__drop-indicator svc-row__drop-indicator--top"}),i.createElement("div",{className:"svc-row__drop-indicator svc-row__drop-indicator--bottom"}),this.props.element)}}r.ReactElementFactory.Instance.registerElement("svc-row",e=>i.createElement(v,e));class E{constructor(e){this.event=e}stopPropagation(){this.event.stopPropagation()}preventDefault(){this.event.preventDefault()}get cancelBubble(){return!1}set cancelBubble(e){}get target(){return this.event.target}get currentTarget(){return this.event.currentTarget}get clientX(){return this.event.clientX}get clientY(){return this.event.clientY}get offsetX(){return this.event.nativeEvent.offsetX}get offsetY(){return this.event.nativeEvent.offsetY}}const g=i.memo(function(e){return e.element});g.displayName="QuestionElementContent";class y extends p{constructor(e){super(e),this.rootRef=i.createRef()}createModel(e){this.model?this.model.attachToUI(e.question,this.rootRef.current):this.modelValue=this.createQuestionViewModel(e)}createQuestionViewModel(e){return new n.QuestionAdornerViewModel(e.componentData,e.question,null)}getUpdatedModelProps(){return["question","componentData"]}get model(){return this.modelValue}getStateElement(){return this.model}renderElement(){const e=this.model.element.isInteractiveDesignElement,t=this.renderQuestionTitle(),r=this.renderContent(e);return i.createElement("div",{ref:this.rootRef,"data-sv-drop-target-survey-element":this.model.element.name||null,className:this.model.rootCss(),onDoubleClick:t=>{e&&this.model.dblclick(t.nativeEvent),t.stopPropagation()},onMouseLeave:t=>e&&this.model.hover(t.nativeEvent,t.currentTarget),onMouseOver:t=>e&&this.model.hover(t.nativeEvent,t.currentTarget)},t,r)}disableTabStop(){return!0}renderContent(e){var t=this.model.needToRenderContent?this.renderElementContent():null;return r.attachKey2click(i.createElement("div",{className:this.model.css(),onClick:e=>this.model.select(this.model,new E(e))},i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--left"}),i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--right"}),i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--top"}),i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--bottom"}),e?this.renderHeader():null,t,this.model.needToRenderContent?this.renderFooter():null),void 0,{disableTabStop:this.disableTabStop()})}renderHeader(){return r.ReactElementFactory.Instance.createElement("svc-question-header",{model:this.model})}renderFooter(){return this.model.element.isInteractiveDesignElement?r.ReactElementFactory.Instance.createElement("svc-question-footer",{className:"svc-question__content-actions",model:this.model}):null}renderCarryForwardBanner(){return this.model.isBannerShowing?r.ReactElementFactory.Instance.createElement("svc-question-banner",this.model.createBannerParams()):null}renderQuestionTitle(){if(!this.model.showHiddenTitle)return null;const e=this.model.element;return i.createElement("div",{ref:e=>e&&(this.model.renderedCollapsed?e.removeAttribute("inert"):e.setAttribute("inert","")),className:this.model.cssCollapsedHiddenHeader},e.hasTitle?i.createElement(r.TitleElement,{element:e,renderActions:!1}):i.createElement("div",{className:this.model.cssCollapsedHiddenTitle},i.createElement("span",{className:"svc-fake-title"},e.name)))}renderElementContent(){return i.createElement(i.Fragment,null,i.createElement(g,{element:this.props.element}),this.renderElementPlaceholder(),this.renderCarryForwardBanner())}componentDidMount(){super.componentDidMount(),this.model.attachToUI(this.props.question,this.rootRef.current)}renderElementPlaceholder(){return this.model.isEmptyElement?i.createElement("div",{className:"svc-panel__placeholder_frame-wrapper"},i.createElement("div",{className:"svc-panel__placeholder_frame"},i.createElement("div",{className:"svc-panel__placeholder"},this.model.placeholderText))):null}componentWillUnmount(){super.componentWillUnmount(),this.model.detachFromUI()}}r.ReactElementFactory.Instance.registerElement("svc-question",e=>i.createElement(y,e));class b extends i.Component{render(){return this.props.model.allowDragging?i.createElement("div",{className:"svc-question__drag-area",onPointerDown:e=>this.props.model.onPointerDown(e)},i.createElement(r.SvgIcon,{className:"svc-question__drag-element",size:"auto",iconName:"icon-drag-area-indicator_24x16"}),i.createElement("div",{className:"svc-question__top-actions"},i.createElement(r.SurveyActionBar,{model:this.props.model.topActionContainer,handleClick:!1}))):null}}r.ReactElementFactory.Instance.registerElement("svc-question-header",e=>i.createElement(b,e));class _ extends i.Component{render(){return i.createElement("div",{className:this.props.className,onFocus:e=>this.props.model.select(this.props.model,new E(e))},i.createElement(r.SurveyActionBar,{model:this.props.model.actionContainer,handleClick:!1}))}}r.ReactElementFactory.Instance.registerElement("svc-question-footer",e=>i.createElement(_,e));class C extends r.SurveyElementBase{renderElement(){const e=(new o.CssClassBuilder).append(this.props.classes).append("svc-action-button").append("svc-action-button--selected",!!this.props.selected).append("svc-action-button--disabled",!!this.props.disabled).toString();return this.props.iconName?this.renderIcon(e):this.renderButtonText(e)}renderButtonText(e){return this.props.disabled?i.createElement("span",{className:e},this.props.text):i.createElement(i.Fragment,null,r.attachKey2click(i.createElement("span",{role:"button",className:e,onClick:e=>{this.props.allowBubble||e.stopPropagation(),this.props.click()},title:this.props.title},this.props.text)))}renderIcon(e){return e+=" svc-action-button--icon",this.props.disabled?i.createElement("span",{className:e},i.createElement(r.SvgIcon,{size:"auto",iconName:this.props.iconName})):i.createElement(i.Fragment,null,r.attachKey2click(i.createElement("span",{className:e,onClick:e=>{this.props.allowBubble||e.stopPropagation(),this.props.click()},title:this.props.title},i.createElement(r.SvgIcon,{size:"auto",iconName:this.props.iconName}))))}}r.ReactElementFactory.Instance.registerElement("svc-action-button",e=>i.createElement(C,e));class N extends i.Component{render(){return i.createElement("div",{className:"svc-carry-forward-panel-wrapper"},i.createElement("div",{className:"svc-carry-forward-panel"},i.createElement("span",null,this.props.text," "),i.createElement("span",{className:"svc-carry-forward-panel__link"},i.createElement(C,{click:()=>this.props.onClick(),text:this.props.actionText}))))}}r.ReactElementFactory.Instance.registerElement("svc-question-banner",e=>i.createElement(N,e));class S extends y{constructor(e){super(e)}createQuestionViewModel(e){return new n.QuestionDropdownAdornerViewModel(e.componentData,e.question,null)}get dropdownModel(){return this.model}get question(){return this.dropdownModel.question}renderElementPlaceholder(){const e=this.question.textStyle;return i.createElement("div",{className:"svc-question__dropdown-choices--wrapper"},i.createElement("div",null,i.createElement("div",{className:"svc-question__dropdown-choices"},(this.dropdownModel.getRenderedItems()||[]).map((t,n)=>i.createElement("div",{className:this.dropdownModel.getChoiceCss(),key:`editable_choice_${n}`},r.ReactSurveyElementsWrapper.wrapItemValue(this.question.survey,r.ReactElementFactory.Instance.createElement(this.dropdownModel.itemComponent,{key:t.value,question:this.question,cssClasses:this.question.cssClasses,isDisplayMode:!0,item:t,textStyle:e,index:n,isChecked:this.question.value===t.value}),this.question,t)))),this.dropdownModel.needToCollapse?r.ReactElementFactory.Instance.createElement("sv-action-bar-item",{item:this.dropdownModel.collapseAction}):null))}}r.ReactElementFactory.Instance.registerElement("svc-dropdown-question",e=>i.createElement(S,e));class x extends y{createQuestionViewModel(e){return new n.QuestionImageAdornerViewModel(e.componentData,e.question,null)}get imageModel(){return this.model}renderHeader(){return i.createElement(i.Fragment,null,i.createElement("input",{type:"file","aria-hidden":"true",tabIndex:-1,accept:this.imageModel.acceptedTypes,className:"svc-choose-file-input",style:{position:"absolute",opacity:0,width:"1px",height:"1px",overflow:"hidden"}}),super.renderHeader())}renderLoadingPlaceholder(){return i.createElement("div",{className:"svc-image-question__loading-placeholder"},i.createElement("div",{className:"svc-image-question__loading"},i.createElement(r.LoadingIndicatorComponent,null)))}renderChooseButton(){return i.createElement(r.SurveyActionBar,{model:this.imageModel.imageActionsContainer})}renderElementPlaceholder(){return this.imageModel.isUploading?this.renderLoadingPlaceholder():this.renderChooseButton()}getStateElements(){return[this.model,this.imageModel.filePresentationModel]}renderElementContent(){if(this.imageModel.isEmptyElement){const e=r.ReactQuestionFactory.Instance.createQuestion("file",{creator:this.imageModel.question.survey,isDisplayMode:!1,question:this.imageModel.filePresentationModel});return i.createElement(i.Fragment,null,e)}return i.createElement(i.Fragment,null,this.props.element,this.renderElementPlaceholder())}}r.ReactElementFactory.Instance.registerElement("svc-image-question",e=>i.createElement(x,e));class f extends p{createModel(e){this.modelValue=this.createQuestionViewModel(e)}createQuestionViewModel(e){return new n.QuestionRatingAdornerViewModel(e.componentData,e.question,null)}getUpdatedModelProps(){return["question","componentData"]}get ratingModel(){return this.model}get model(){return this.modelValue}getStateElement(){return this.model}renderElement(){const e=this.ratingModel;return i.createElement(i.Fragment,null,i.createElement("div",{className:"svc-rating-question-content"},i.createElement(r.SurveyActionBar,{model:e.rateActionsContainer}),this.props.element))}}r.ReactElementFactory.Instance.registerElement("svc-rating-question",e=>i.createElement(f,e)),r.ReactElementFactory.Instance.registerElement("svc-rating-question-content",e=>i.createElement(f,e));class I extends y{createQuestionViewModel(e){return new n.QuestionAdornerViewModel(e.componentData,e.question,null)}get widgetModel(){return this.model}renderElementContent(){return i.createElement("div",{className:"svc-widget__content"},this.props.element)}}r.ReactElementFactory.Instance.registerElement("svc-widget-question",e=>i.createElement(I,e));class w extends p{createModel(e){this.model=new n.QuestionAdornerViewModel(e.componentData,e.question,null)}getStateElement(){return this.model}getUpdatedModelProps(){return["question","componentData"]}render(){return i.createElement(i.Fragment,null,i.createElement("div",{"data-sv-drop-target-survey-element":this.model.element.name,className:"svc-question__adorner"},i.createElement("div",{className:" svc-question__content--in-popup svc-question__content"},this.props.element)))}}r.ReactElementFactory.Instance.registerElement("svc-cell-question",e=>i.createElement(w,e));class R extends p{createModel(e){this.model=new n.QuestionAdornerViewModel(e.componentData,e.question,null)}getUpdatedModelProps(){return["question","componentData"]}getStateElement(){return this.model}render(){const e=this.props.question,t=this.props.question.textStyle;return i.createElement(i.Fragment,null,i.createElement("div",{"data-sv-drop-target-survey-element":this.model.element.name,className:"svc-question__adorner"},i.createElement("div",{className:" svc-question__content--in-popup svc-question__content"},this.props.element,i.createElement("div",{className:"svc-question__dropdown-choices"},e.visibleChoices.map((n,s)=>i.createElement("div",{className:"svc-question__dropdown-choice",key:`editable_choice_${s}`},r.ReactSurveyElementsWrapper.wrapItemValue(e.survey,r.ReactElementFactory.Instance.createElement("survey-radiogroup-item",{question:e,cssClasses:e.cssClasses,isDisplayMode:!0,item:n,textStyle:t,index:s,isChecked:e.value===n.value}),e,n)))))))}}r.ReactElementFactory.Instance.registerElement("svc-cell-dropdown-question",e=>i.createElement(R,e));class M extends p{createModel(e){this.model&&this.model.dispose(),this.model=new n.TranslationDropdownViewModel(e.question,e.componentData?e.componentData.translation:void 0)}getUpdatedModelProps(){return["question","componentData"]}getStateElement(){return this.model}componentWillUnmount(){super.componentWillUnmount(),this.model.dispose()}renderElement(){const e=this.props.question,t=this.props.question.textStyle;return i.createElement(i.Fragment,null,this.props.element,i.createElement("div",{className:"st-dropdown-choices--wrapper"},i.createElement("div",{className:"svc-question__dropdown-choices"},this.model.getRenderedItems().map((n,s)=>i.createElement("div",{className:this.model.getChoiceCss(),key:`translation_choice_${s}`},r.ReactElementFactory.Instance.createElement(this.model.itemComponent,{question:e,cssClasses:e.cssClasses,isDisplayMode:!0,item:n,textStyle:t,index:s,isChecked:!1})))),this.model.needToCollapse?r.ReactElementFactory.Instance.createElement("sv-action-bar-item",{item:this.model.collapseAction}):null))}}r.ReactElementFactory.Instance.registerElement(n.translationDropdownComponentName,e=>i.createElement(M,e));const q=i.memo(({page:e,survey:t,creator:n})=>i.createElement(r.SurveyPage,{page:e,survey:t,creator:n}));q.displayName="PageElementContent";class D extends p{constructor(e){super(e),this.rootRef=i.createRef()}createModel(e){var t;this.model&&this.model.dispose(),this.model=this.createPageAdorner(e.creator,e.page),this.model.isGhost=this.props.isGhost,(null===(t=this.rootRef)||void 0===t?void 0:t.current)&&this.model.attachToUI(e.page,this.rootRef.current)}createPageAdorner(e,t){return new n.PageAdorner(e,t)}shouldComponentUpdate(e,t){const r=super.shouldComponentUpdate(e,t);return this.model&&(this.model.isGhost=this.props.isGhost),r}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.model.attachToUI(this.props.page,this.rootRef.current)}getUpdatedModelProps(){return["creator","page"]}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.attachToUI(this.props.page,this.rootRef.current),this.model.isGhost=this.props.isGhost}componentWillUnmount(){super.componentWillUnmount(),this.model.detachFromUI()}canRender(){return super.canRender()}renderElement(){return this.props.page?r.attachKey2click(i.createElement("div",{ref:this.rootRef,id:this.props.page.id,"data-sv-drop-target-survey-page":this.model.dropTargetName,className:"svc-page__content "+this.model.css,onClick:e=>this.model.select(this.model,new E(e)),onDoubleClick:e=>this.model.dblclick(e.nativeEvent),onMouseLeave:e=>this.model.hover(e.nativeEvent,e.currentTarget),onMouseOver:e=>this.model.hover(e.nativeEvent,e.currentTarget)},i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--top"}),i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--bottom"}),this.renderContent(),this.renderPlaceholder(),this.renderHeader(),this.renderFooter())):null}renderPlaceholder(){return this.model.showPlaceholder?i.createElement("div",{className:"svc-page__placeholder_frame"},i.createElement("div",{className:"svc-panel__placeholder_frame"},i.createElement("div",{className:"svc-panel__placeholder"},this.model.placeholderText))):null}renderContent(){return this.model.needRenderContent?i.createElement(q,{page:this.props.page,survey:this.props.survey,creator:this.props.creator}):i.createElement("div",{className:"svc-page__loading-content"},i.createElement(r.LoadingIndicatorComponent,null))}renderHeader(){const e=i.createElement("div",{className:"svc-page__content-actions"},i.createElement(r.SurveyActionBar,{model:this.model.actionContainer}),this.model.topActionContainer.hasActions?i.createElement(r.SurveyActionBar,{model:this.model.topActionContainer}):null);return this.model.isGhost||!this.model.allowDragging?e:i.createElement("div",{className:"svc-question__drag-area",onPointerDown:e=>this.model.onPointerDown(e)},i.createElement(r.SvgIcon,{className:"svc-question__drag-element",size:"auto",iconName:"icon-drag-area-indicator_24x16"}),e)}renderFooter(){return i.createElement(r.SurveyActionBar,{model:this.model.footerActionsBar})}}r.ReactElementFactory.Instance.registerElement("svc-page",e=>i.createElement(D,e));class T extends r.SurveyElementBase{get model(){return this.item.data}get item(){return this.props.item}getStateElement(){return this.item}renderTypeSelector(){return i.createElement("div",{className:this.item.cssClasses.itemTypeSelector},r.ReactElementFactory.Instance.createElement("sv-action-bar-item-dropdown",{item:this.model.questionTypeSelectorModel}))}renderElement(){return i.createElement(i.Fragment,null,r.attachKey2click(i.createElement("div",{className:this.item.getActionBarItemCss(),onClick:e=>{e.stopPropagation(),this.model.addNewQuestion(this.model,new E(e))},onMouseOver:e=>this.model.hoverStopper&&this.model.hoverStopper(e.nativeEvent,e.currentTarget)},i.createElement("span",{className:this.item.getActionBarItemTitleCss()},this.model.addNewQuestionText),this.renderTypeSelector())))}}r.ReactElementFactory.Instance.registerElement("svc-add-new-question-btn",e=>i.createElement(T,e));class F extends y{renderElementPlaceholder(){return this.model.isEmptyElement?i.createElement("div",{className:"svc-panel__placeholder_frame-wrapper"},i.createElement("div",{className:"svc-panel__placeholder_frame"},i.createElement("div",{className:"svc-panel__placeholder"},this.model.placeholderText),this.model.showAddQuestionButton?i.createElement(r.SurveyActionBar,{model:this.model.addQuestionActionsContainer}):null)):null}disableTabStop(){return!0}createQuestionViewModel(e){return new n.PanelAdornerViewModel(e.componentData,e.question,null)}renderFooter(){return i.createElement(i.Fragment,null,!this.model.isEmptyElement&&this.model.element.isPanel&&this.model.showAddQuestionButton?i.createElement(r.SurveyActionBar,{model:this.model.addQuestionActionsContainer,handleClick:!1}):null,super.renderFooter())}}r.ReactElementFactory.Instance.registerElement("svc-panel",e=>i.createElement(F,e));class B extends p{constructor(e){super(e),this.rootRef=i.createRef()}createModel(e){let t=null;this.model&&(t=this.model.root),this.model=new n.LogoImageViewModel(e.data,t)}getUpdatedModelProps(){return["data"]}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.root=this.rootRef.current}renderButtons(){return i.createElement(r.SurveyActionBar,{model:this.model.actionsContainer})}renderImage(){return i.createElement("div",{className:this.model.containerCss},this.renderButtons(),i.createElement(r.LogoImage,{data:this.props.data.survey}))}renderPlaceHolder(){return this.model.allowEdit&&!this.model.isUploading?r.attachKey2click(i.createElement("div",{className:"svc-logo-image-placeholder",onClick:()=>this.model.chooseFile(this.model)},i.createElement("svg",null,i.createElement("use",{xlinkHref:"#icon-image-48x48"})))):null}renderInput(){return i.createElement("input",{"aria-hidden":"true",type:"file",tabIndex:-1,accept:this.model.acceptedTypes,className:"svc-choose-file-input"})}renderLoadingIndicator(){return i.createElement("div",{className:"svc-logo-image__loading"},i.createElement(r.LoadingIndicatorComponent,null))}render(){let e=null;return e=this.model.survey.locLogo.renderedHtml&&!this.model.isUploading?this.renderImage():this.model.isUploading?this.renderLoadingIndicator():this.renderPlaceHolder(),i.createElement("div",{ref:this.rootRef,className:"svc-logo-image"},this.renderInput(),e)}}r.ReactElementFactory.Instance.registerElement("svc-logo-image",e=>i.createElement(B,e));class k extends r.SurveyQuestionElementBase{get question(){return this.questionBase}renderClear(){const e=this.questionBase.showClear;return!this.questionBase.isReadOnly&&e?i.createElement(C,{classes:this.question.linkClearButtonCssClasses,click:()=>this.question.doClearClick(),text:n.editorLocalization.getString("pe.clear")}):null}renderElement(){return i.createElement(i.Fragment,null,i.createElement(C,{classes:this.question.linkSetButtonCssClasses,click:()=>this.question.doLinkClick(),selected:this.question.isSelected,disabled:!this.question.isClickable,text:this.question.linkValueText,title:this.question.tooltip,iconName:this.question.iconName}),this.renderClear())}}r.ReactQuestionFactory.Instance.registerQuestion("linkvalue",e=>i.createElement(k,e));class P extends r.SurveyQuestionElementBase{constructor(){super(...arguments),this.rootRef=i.createRef()}get embeddedSurvey(){const e=this.props.element||this.props.question;if(!e)return null;const t=e.embeddedSurvey;return t&&t.currentPage?t:null}get creator(){return this.props.creator}componentDidMount(){super.componentDidMount(),this.embeddedSurvey&&(this.embeddedSurvey.rootElement=this.rootRef.current)}render(){const e=this.embeddedSurvey;return e?i.createElement("div",{style:{display:"contents"},ref:this.rootRef},i.createElement(r.SurveyPage,{survey:e,page:e.currentPage,css:e.css,creator:this.creator})):null}}r.ReactQuestionFactory.Instance.registerQuestion("embeddedsurvey",e=>i.createElement(P,e));class U extends i.Component{get survey(){return this.props.survey}createQuestionElement(e){return r.ReactQuestionFactory.Instance.createQuestion(!e.isDefaultRendering||e.isDefaultRendering()?e.getTemplate():e.getComponentName(),{question:e,isDisplayMode:e.isInputReadOnly,creator:this})}questionTitleLocation(){return this.survey.questionTitleLocation}questionErrorLocation(){return this.survey.questionErrorLocation}renderError(e,t,r){return null}render(){const e=this.survey.getAllQuestions()[0];return i.createElement("div",{style:this.props.style},i.createElement(r.SurveyQuestion,{creator:this,element:e}))}}r.ReactElementFactory.Instance.registerElement("svc-question-editor-content",e=>i.createElement(U,e));class A extends p{constructor(e){super(e),this.onBlur=e=>{this.model.onFocusOut(e.nativeEvent)},this.rootRef=i.createRef()}createModel(e){this.model=new n.ItemValueWrapperViewModel(e.componentData.creator,e.question,e.item)}getUpdatedModelProps(){return["question","item"]}getStateElement(){return this.model}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.props.item.setRootElement(this.rootRef.current),e.item!==this.props.item&&e.item&&e.item.setRootElement(void 0)}componentDidMount(){super.componentDidMount(),this.props.item.setRootElement(this.rootRef.current)}componentWillUnmount(){super.componentWillUnmount(),this.props.item.setRootElement(void 0)}renderButton(e){return r.ReactElementFactory.Instance.createElement("sv-action-bar-item",{item:e})}render(){this.model.item=this.props.item;const e=this.model.allowAdd?this.renderButton(this.model.addAction):i.createElement(i.Fragment,null," ",this.model.isDraggable?i.createElement("span",{className:"svc-item-value-controls__drag"},i.createElement(r.SvgIcon,{className:"svc-item-value-controls__drag-icon",size:"auto",iconName:"icon-drag-24x24",title:this.model.dragTooltip})):null,this.model.allowRemove?this.renderButton(this.model.removeAction):null),t=this.props.element.key+(this.model.allowAdd?"_new":"");return i.createElement(i.Fragment,null,i.createElement("div",{ref:this.rootRef,className:"svc-item-value-wrapper"+(this.model.allowAdd?" svc-item-value--new":"")+(this.model.isDragging?" svc-item-value--dragging":"")+(this.model.isDragDropGhost?" svc-item-value--ghost":"")+(this.model.isDragDropMoveDown?" svc-item-value--movedown":"")+(this.model.isDragDropMoveUp?" svc-item-value--moveup":""),key:t,"data-sv-drop-target-item-value":this.model.isDraggable?this.model.item.value:void 0,onPointerDown:e=>this.model.onPointerDown(e)},i.createElement("div",{className:"svc-item-value__ghost"}),i.createElement("div",{className:"svc-item-value-controls",onBlur:this.onBlur},e),i.createElement("div",{className:"svc-item-value__item",onClick:e=>this.model.select(this.model,e.nativeEvent)},this.props.element),this.renderPanelAction()),this.renderPanel())}renderPanelAction(){if(!this.model.canShowPanel())return null;const e=this.renderButton(this.model.expandPanelAction);return i.createElement("div",{className:"svc-item-value-controls svc-choice-elements-button-container"},e)}renderPanel(){if(!this.model.renderedShowPanel)return null;const e=this.model.creator,t=e.survey;return i.createElement(L,{element:this.model.item.panel,survey:t,creator:e,css:t.getCss()})}}const L=i.memo(({element:e,survey:t,creator:n,css:s})=>i.createElement(r.SurveyPanel,{element:e,survey:t,creator:n,cssClasses:s}));L.displayName="ChoiceItemPanel",r.ReactElementFactory.Instance.registerElement("svc-item-value",e=>i.createElement(A,e));class V extends p{constructor(e){super(e),this.preventDragHandler=e=>{e.preventDefault()},this.rootRef=i.createRef()}createModel(e){this.model=new n.ImageItemValueWrapperViewModel(e.componentData.creator,e.question,e.item,null,null)}getUpdatedModelProps(){return["question","item"]}getStateElement(){return this.model}get question(){return this.props.question}componentDidMount(){super.componentDidMount(),this.model.itemsRoot=this.rootRef.current}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.model.itemsRoot=this.rootRef.current}renderLoadingIndicator(){return i.createElement("div",{className:"svc-image-item-value__loading"},i.createElement(r.LoadingIndicatorComponent,null))}renderNewItemControls(){const e=i.createElement(r.SurveyActionBar,{model:this.model.actionsContainer}),t=this.model.showPlaceholder?i.createElement("span",{className:"svc-image-item-value__placeholder"},this.model.placeholderText):null;return i.createElement(i.Fragment,null,t,e)}render(){this.model.item=this.props.item;const e=!this.props.question.isItemInList(this.props.item);this.model.isNew=e;const t=this.model.getIsNewItemSingle()?null:{width:this.question.renderedImageWidth,height:this.question.renderedImageHeight};let n=null;return n=e||this.model.isUploading?i.createElement(i.Fragment,null,i.createElement("div",{className:"svc-image-item-value__item"},i.createElement("div",{className:"sd-imagepicker__item sd-imagepicker__item--inline"},i.createElement("label",{className:"sd-imagepicker__label"},i.createElement("div",{style:t,className:"sd-imagepicker__image"},this.model.isUploading?this.renderLoadingIndicator():null)))),this.model.allowAdd&&!this.model.isUploading?i.createElement("div",{className:"svc-image-item-value-controls"},this.renderNewItemControls()):null):i.createElement(i.Fragment,null,i.createElement("div",{className:"svc-image-item-value__item"},this.props.element),this.model.canRenderControls?i.createElement(r.SurveyActionBar,{model:this.model.topActionsContainer}):null),i.createElement("div",{ref:this.rootRef,className:this.model.getRootCss(),key:this.props.element.key,"data-sv-drop-target-item-value":this.model.isDraggable?this.model.item.value:void 0,onPointerDown:e=>this.model.onPointerDown(e),onDragStart:this.preventDragHandler,onDrop:this.model.onDrop,onDragEnter:this.model.onDragEnter,onDragOver:this.model.onDragOver,onDragLeave:this.model.onDragLeave},i.createElement("div",{className:"svc-image-item-value-wrapper__ghost",style:t}),i.createElement("div",{className:"svc-image-item-value-wrapper__content"},i.createElement("input",{type:"file","aria-hidden":"true",tabIndex:-1,accept:this.model.acceptedTypes,className:"svc-choose-file-input",style:{position:"absolute",opacity:0,width:"1px",height:"1px",overflow:"hidden"}}),n))}}class Q extends r.SurveyElementBase{renderElement(){return i.createElement("span",{className:this.props.item.getActionBarItemCss(),onPointerDown:e=>this.props.item.data.model.onPointerDown(e)},i.createElement(r.SvgIcon,{size:"auto",iconName:this.props.item.iconName,className:this.props.item.cssClasses.itemIcon}))}}r.ReactElementFactory.Instance.registerElement("svc-image-item-drag-action",e=>i.createElement(Q,e)),r.ReactElementFactory.Instance.registerElement("svc-image-item-value",e=>i.createElement(V,e));class H extends p{createModel(e){var t;const r=e.componentData;let s=!1;this.model&&(s=this.model.isSelected),this.model=new n.MatrixCellWrapperViewModel(r.creator,r.element,r.question,r.row,r.column||(null===(t=r.element.cell)||void 0===t?void 0:t.column)),this.model.isSelected=s}getUpdatedModelProps(){return["componentData"]}componentDidUpdate(e,t){var r,n;super.componentDidUpdate(e,t);const s=this.props.componentData;this.model.templateData=s.element,this.model.row=s.row,this.model.column=s.column||(null===(n=null===(r=s.element)||void 0===r?void 0:r.cell)||void 0===n?void 0:n.column),this.model.question=s.question}getStateElement(){return this.model}render(){let e=null;return this.model.isSupportCellEditor&&(e=i.createElement("div",{className:"svc-matrix-cell__question-controls"},r.ReactElementFactory.Instance.createElement("sv-action-bar-item",{item:this.model.editAction}))),i.createElement("div",{className:"svc-matrix-cell",tabIndex:-1,key:this.props.element.key,onClick:e=>!this.props.question&&this.model.selectContext(this.model,e),onMouseOut:e=>this.model.hover(e.nativeEvent,e.currentTarget),onMouseOver:e=>this.model.hover(e.nativeEvent,e.currentTarget)},i.createElement("div",{className:"svc-matrix-cell--selected"+(this.model.isSelected?" svc-visible":"")}),this.props.element,e)}}r.ReactElementFactory.Instance.registerElement("svc-matrix-cell",e=>i.createElement(H,e));class W extends p{createModel(e){this.props.survey&&(this.model=new n.SurveyResultsModel(e.survey))}getUpdatedModelProps(){return["survey"]}getStateElement(){return this.model}render(){return this.model?i.createElement("div",{className:"svd-test-results"},i.createElement("div",{className:"svd-test-results__content"},i.createElement("div",{className:"svd-test-results__header"},i.createElement("div",{className:"svd-test-results__header-text"},this.model.surveyResultsText),i.createElement("div",{className:"svd-test-results__header-types"},i.createElement(C,{click:()=>this.model.selectTableClick(),text:this.model.surveyResultsTableText,selected:this.model.isTableSelected,disabled:!1}),i.createElement(C,{click:()=>this.model.selectJsonClick(),text:this.model.surveyResultsJsonText,selected:this.model.isJsonSelected,disabled:!1}))),this.renderResultAsText(),this.renderResultAsTable())):null}renderResultAsText(){return"text"!==this.model.resultViewType?null:i.createElement("div",{className:"svd-test-results__text svd-light-bg-color"},i.createElement("div",null,this.model.resultText))}renderResultAsTable(){return"table"!==this.model.resultViewType?null:i.createElement("div",{className:"svd-test-results__table svd-light-bg-color"},i.createElement("table",null,i.createElement("thead",null,i.createElement("tr",{className:"svd-light-background-color"},i.createElement("th",{key:1,className:"svd-dark-border-color"},this.model.resultsTitle),i.createElement("th",{key:2,className:"svd-dark-border-color"},this.model.resultsDisplayValue))),i.createElement("tbody",null,W.renderRows(this.model.resultData))))}static renderRows(e){const t=[];for(var r=0;r<e.length;r++)t.push(i.createElement(O,{key:r+1,row:e[r]}));return t}}class O extends p{get row(){return this.props.row}getStateElement(){return this.row}render(){return i.createElement(i.Fragment,null,r.attachKey2click(i.createElement("tr",{onClick:()=>this.row.toggle()},i.createElement("td",{key:1,style:{paddingLeft:this.row.textMargin},className:"svd-dark-border-color"},this.row.isNode?i.createElement("span",{style:{left:this.row.markerMargin},className:"svd-test-results__marker "+(this.row.collapsed?"":"svd-test-results__marker--expanded")},i.createElement(r.SvgIcon,{iconName:"icon-expand_16x16",size:16})):null,this.row.question?i.createElement(r.SurveyLocStringViewer,{model:this.row.question.locTitle}):i.createElement("span",null,this.row.title)),i.createElement("td",{key:2,className:this.row.isNode?"svd-test-results__node-value":"svd-dark-border-color"},this.row.getString(this.row.displayValue)))),this.row.isNode&&!this.row.collapsed?W.renderRows(this.row.data):null)}}class j extends p{constructor(e){super(e),this.rootRef=i.createRef()}createModel(e){this.model=new n.ToolboxToolViewModel(e.item,e.creator,e.parentModel)}getUpdatedModelProps(){return["creator","item"]}get item(){return this.props.item}get creator(){return this.props.creator}get isCompact(){return this.props.isCompact}getStateElement(){return this.item}render(){const e=this.item,t=r.ReactElementFactory.Instance.createElement(this.model.itemComponent,{item:e,creator:this.creator,parentModel:this.creator.toolbox,model:this.model,isCompact:this.isCompact});return i.createElement("div",{className:e.css,key:e.id,ref:this.rootRef},e.needSeparator&&!this.creator.toolbox.showCategoryTitles?i.createElement("div",{className:"svc-toolbox__category-separator"}):null,i.createElement("div",{className:"svc-toolbox__tool-content",onPointerDown:e=>{e.persist(),this.model.onPointerDown(e)}},t))}componentWillUnmount(){super.componentWillUnmount(),this.item.updateModeCallback=void 0}componentDidMount(){super.componentDidMount(),this.item.updateModeCallback=(e,t)=>{queueMicrotask(()=>{l.flushSync?l.flushSync(()=>{this.item.mode=e}):this.item.mode=e,queueMicrotask(()=>{t(e,this.rootRef.current)})})},this.item.afterRender()}}class K extends p{constructor(e){super(e)}getUpdatedModelProps(){return["creator","item"]}get item(){return this.props.item}get creator(){return this.props.creator}get model(){return this.props.model}getStateElement(){return this.model}render(){const e=this.props.isCompact?i.createElement("span",{className:"svc-toolbox__item-banner",onClick:e=>{e.persist(),this.model.click(e)}},i.createElement(r.SvgIcon,{size:"auto",iconName:this.item.iconName,className:"svc-toolbox__item-icon",title:this.item.getTooltip()}),i.createElement("span",null,this.item.title)):null,t=r.attachKey2click(i.createElement("div",{className:this.item.renderedCss,tabIndex:0,role:"button","aria-label":this.item.getTooltip(),onClick:e=>{e.persist(),this.model.click(e)}},i.createElement("span",{className:"svc-toolbox__item-container"},this.item.iconName?i.createElement(r.SvgIcon,{size:"auto",iconName:this.item.iconName,className:"svc-toolbox__item-icon"}):null),this.props.isCompact?null:i.createElement("span",{className:"svc-toolbox__item-title"},this.item.title)),void 0,{disableTabStop:!this.model.toolboxItem.enabled});return i.createElement(i.Fragment,null,t,e)}}r.ReactElementFactory.Instance.registerElement("svc-toolbox-item",e=>t.createElement(K,e));class z extends p{constructor(e){super(e)}getUpdatedModelProps(){return["creator","item"]}get item(){return this.props.item}get model(){return this.props.model}get creator(){return this.props.creator}get isCompact(){return this.props.isCompact}get parentModel(){return this.props.parentModel}getStateElement(){return this.item}render(){return i.createElement(i.Fragment,null,i.createElement(K,{item:this.item,creator:this.creator,model:this.model,parentModel:this.parentModel,isCompact:this.isCompact}),i.createElement("div",{className:"svc-toolbox__item-submenu-button",onMouseOver:e=>this.model.onMouseOver(this.item,e),onMouseLeave:e=>this.model.onMouseLeave(this.item,e)},i.createElement(r.SvgIcon,{size:"auto",iconName:this.item.subitemsButtonIcon}),i.createElement(r.Popup,{model:this.item.popupModel})))}}r.ReactElementFactory.Instance.registerElement("svc-toolbox-item-group",e=>i.createElement(z,e));class G extends r.SurveyElementBase{get category(){return this.props.category}get toolbox(){return this.props.toolbox}get class(){return"svc-toolbox__category"+(this.category.collapsed?" svc-toolbox__category--collapsed":"")+(this.category.empty?" svc-toolbox__category--empty":"")}getStateElement(){return this.category}render(){const e=this.renderCategoryHeader(),t=this.renderCategoryContent();return i.createElement("div",{className:this.class,key:this.category.name},i.createElement("div",{className:"svc-toolbox__category-header-wrapper"},e),t)}renderCategoryHeader(){let e="svc-toolbox__category-header";this.toolbox.canCollapseCategories&&(e+=" svc-toolbox__category-header--collapsed");const t=this.renderLocString(this.category.locTitle);return r.attachKey2click(i.createElement("div",{className:e,onClick:e=>this.category.toggleState()},i.createElement("span",{className:"svc-toolbox__category-title"},t),this.renderButton()))}renderButton(){if(!this.toolbox.canCollapseCategories)return null;const e=this.category.iconName;return i.createElement("div",{className:"svc-toolbox__category-header__controls"},i.createElement(r.SvgIcon,{className:this.category.iconClassName,iconName:e,size:"auto"}))}renderCategoryContent(){return this.renderItems(this.category.items)}renderItems(e,t=!1){return e.map((e,r)=>i.createElement(j,{item:e,creator:this.toolbox.creator,parentModel:this.toolbox,isCompact:t,key:"item"+r}))}}r.ReactElementFactory.Instance.registerElement("svc-toolbox-category",e=>i.createElement(G,e));class J extends r.SurveyElementBase{constructor(e){super(e)}get model(){return this.props.model}get creator(){return this.props.creator}getStateElement(){return this.model}render(){if(!this.model||!this.model.renderElements)return null;const e=this.renderItems();return i.createElement("div",{className:this.model.cssClasses.root},e)}renderItems(){return this.model.renderedActions.map((e,t)=>i.createElement(j,{item:e,creator:this.creator,parentModel:this.model,isCompact:!1,key:"item"+t}))}}r.ReactElementFactory.Instance.registerElement("svc-toolbox-list",e=>i.createElement(J,e));class X extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}constructor(e){super(e),this.state={filterString:this.model.filterString||""}}renderElement(){if(!this.model.isVisible)return null;return i.createElement("div",{className:"svc-search"},i.createElement("div",{className:"svc-search__search-icon"},i.createElement(r.SvgIcon,{iconName:"icon-search",size:"auto"})),i.createElement("input",{type:"text",className:"svc-search__input","aria-label":this.model.filterStringPlaceholder,placeholder:this.model.filterStringPlaceholder,value:this.state.filterString,onChange:e=>{const t=e.target,r=(null==t?void 0:t.getRootNode())||o.settings.environment.root;(r instanceof Document||r instanceof ShadowRoot)&&t===r.activeElement&&(this.model.filterString=t.value)},tabIndex:this.model.getTabIndex()}),i.createElement("div",{className:"svc-search__toolbar"},i.createElement("div",{className:"svc-search__toolbar-counter"},this.model.matchCounterText),i.createElement(r.SurveyActionBar,{model:this.model.searchActionBar})))}}r.ReactElementFactory.Instance.registerElement("svc-search",e=>i.createElement(X,e));class Y extends r.SurveyElementBase{constructor(e){super(e),this.rootRef=i.createRef()}componentDidUpdate(e,t){super.componentDidUpdate(e,t);const r=this.rootRef.current;r&&this.toolbox.afterRender(r)}componentDidMount(){super.componentDidMount();const e=this.rootRef.current;e&&this.toolbox.afterRender(e)}componentWillUnmount(){this.toolbox.beforeDestroy(),super.componentWillUnmount()}get creator(){return this.props.model}get toolbox(){return this.creator.toolbox}getStateElement(){return this.toolbox}renderItems(e,t=!1){return e.map((e,r)=>i.createElement(j,{item:e,creator:this.creator,parentModel:this.toolbox,isCompact:t,key:e.renderedId}))}renderCategories(){return this.toolbox.categories.map((e,t)=>r.ReactElementFactory.Instance.createElement("svc-toolbox-category",{category:e,toolbox:this.toolbox,key:"category"+t}))}renderSearch(){const e=this.toolbox.isCompactRendered?i.createElement(i.Fragment,null,i.createElement(j,{item:this.toolbox.searchItem,creator:this.creator,parentModel:this.toolbox,isCompact:this.toolbox.isCompactRendered,key:"searchitem"})):null;return i.createElement("div",{className:"svc-toolbox__search-container"},e,i.createElement(X,{model:this.toolbox.searchManager}),i.createElement("div",{className:"svc-toolbox__category-separator svc-toolbox__category-separator--search"}))}render(){const e=this.toolbox.showSearch?this.renderSearch():null,t=this.toolbox.showPlaceholder?i.createElement("div",{className:"svc-toolbox__placeholder"},this.toolbox.toolboxNoResultsFound):null;return i.createElement("div",{ref:this.rootRef,className:this.toolbox.classNames,style:this.toolbox.getRootStyle()},i.createElement("div",{onBlur:e=>this.toolbox.focusOut(e),className:"svc-toolbox__panel"},e,t,i.createElement(r.Scroll,null,this.toolbox.showInSingleCategory?i.createElement("div",{className:"svc-toolbox__category"},this.renderItems(this.toolbox.renderedActions,this.toolbox.isCompactRendered)):this.renderCategories())))}}r.ReactElementFactory.Instance.registerElement("svc-toolbox",e=>i.createElement(Y,e));class Z extends r.SurveyElementBase{constructor(){super(...arguments),this.onPropChangedHandler=(e,t)=>{if(this.isRendering)return;const r=["showProgressBar","progressBarType","currentPageValue"];if(!(r.indexOf(t.name)<0)){for(var n={},s=0;s<r.length;s++){var o=r[s];n[o]=this.survey[o]}this.setState(n)}}}componentDidMount(){super.componentDidMount(),this.setHandler()}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.setHandler()}setHandler(){this.survey&&!this.survey.onPropertyChanged.hasFunc(this.onPropChangedHandler)&&this.survey.onPropertyChanged.add(this.onPropChangedHandler)}componentWillUnmount(){super.componentWillUnmount(),this.survey&&this.survey.onPropertyChanged.remove(this.onPropChangedHandler)}get survey(){return this.props.survey}get location(){return this.props.location}get isTop(){return"top"==this.location}canRender(){return this.isTop?this.survey.isShowProgressBarOnTop:this.survey.isShowProgressBarOnBottom}renderElement(){return r.ReactElementFactory.Instance.createElement(this.survey.getProgressTypeComponent(),{survey:this.survey,css:this.survey.css,isTop:this.isTop})}}class $ extends r.SurveyElementBase{constructor(e){super(e)}getStateElement(){return this.props.model}renderElement(){if(!this.props.model.visible)return null;const e=r.ReactElementFactory.Instance.createElement(this.props.model.component||"sv-action-bar-item",{item:this.props.model});return i.createElement("div",{className:"svc-sidebar-tabs__item"},e)}}class ee extends r.SurveyElementBase{constructor(e){super(e)}getStateElement(){return this.props.model}canRender(){return!!this.props.model&&super.canRender()}renderElement(){return i.createElement("div",{className:this.props.model.sideBarClassName},i.createElement("div",{className:"svc-sidebar-tabs__top-container"},i.createElement("div",{className:"svc-sidebar-tabs__collapse-button"},i.createElement($,{model:this.props.model.expandCollapseAction})),i.createElement("div",{className:"svc-sidebar-tabs__separator"},i.createElement("div",null)),i.createElement(r.Scroll,null,i.createElement("div",{className:"svc-sidebar-tabs__items"},i.createElement(te,{model:this.props.model.topToolbar})))),i.createElement("div",{className:"svc-sidebar-tabs__bottom-container"},i.createElement("div",{className:"svc-sidebar-tabs__items"},i.createElement(r.SurveyActionBar,{model:this.props.model.bottomToolbar}))))}}r.ReactElementFactory.Instance.registerElement("svc-tab-control",e=>i.createElement(ee,e));class te extends r.SurveyElementBase{constructor(e){super(e)}getStateElement(){return this.props.model}renderElement(){return i.createElement(i.Fragment,null,this.props.model.actions.map((e,t)=>i.createElement($,{model:e,key:"item"+t})))}}class re extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}renderElement(){const e=this.model.title?i.createElement("div",{className:"svc-side-bar__container-title"},this.model.title):null;return i.createElement("div",{className:"svc-side-bar__container-header"},i.createElement("div",{className:"svc-side-bar__container-actions"},i.createElement(r.SurveyActionBar,{model:this.model.toolbar})),e)}}r.ReactElementFactory.Instance.registerElement("svc-side-bar-default-header",e=>i.createElement(re,e));class ne extends r.SurveyElementBase{get objectSelectionAction(){return this.props.model}getStateElement(){return this.objectSelectionAction}renderElement(){const e=r.attachKey2click(i.createElement("div",{className:this.objectSelectionAction.getActionBarItemCss()+" svc-sidebar__header-object-selector",onClick:()=>this.objectSelectionAction.action()},i.createElement("div",{className:"svc-sidebar__header-caption"},i.createElement("span",{className:"svc-sidebar__header-title"},this.objectSelectionAction.title),i.createElement("span",{className:"svc-sidebar__header-subtitle"},this.objectSelectionAction.tooltip))),this.props.model);return i.createElement("div",{className:"svc-sidebar__header svc-sidebar__header--tabbed"},i.createElement("div",{className:"svc-sidebar__header-container svc-sidebar__header-container--with-subtitle"},i.createElement("div",{className:"svc-sidebar__header-content"},e,i.createElement(r.Popup,{model:this.objectSelectionAction.popupModel}))))}}r.ReactElementFactory.Instance.registerElement("svc-side-bar-property-grid-header",e=>i.createElement(ne,e));class se extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}renderElement(){return i.createElement("div",{className:"svc-side-bar__container-header svc-sidebar__header-container"},this.model.subTitle?i.createElement("div",{className:"svc-sidebar__header-caption"},i.createElement("span",{className:"svc-sidebar__header-title"},this.model.title),i.createElement("span",{className:"svc-sidebar__header-subtitle"},this.model.subTitle)):i.createElement("div",{className:"svc-side-bar__container-title"},this.model.title))}}r.ReactElementFactory.Instance.registerElement("svc-side-bar-header",e=>i.createElement(se,e));class oe extends r.SurveyElementBase{get model(){return this.props.model}constructor(e){super(e),this.containerRef=i.createRef()}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.initResizeManager(this.containerRef.current)}componentWillUnmount(){super.componentWillUnmount(),this.model.resetResizeManager()}canRender(){return!!this.model&&super.canRender()}renderElement(){const e={display:this.model.renderRoot?"":"none"},t={display:this.model.renderContainer?"":"none"},n=this.model.pages.map(e=>i.createElement(ae,{page:e,key:e.id})),s=r.ReactElementFactory.Instance.createElement(this.model.header.component,{model:this.model.header.componentModel});let o=null;return this.model.sideAreaComponentName&&(o=r.ReactElementFactory.Instance.createElement(this.model.sideAreaComponentName,{model:this.model.sideAreaComponentData})),i.createElement("div",{className:this.model.rootCss,style:e},i.createElement("div",{className:"svc-side-bar__shadow",onClick:()=>this.model.collapseSidebar(),style:t}),i.createElement("div",{className:"svc-flex-row svc-side-bar__wrapper"},i.createElement("div",{className:"svc-side-bar__container-wrapper",style:t},i.createElement("div",{ref:this.containerRef,className:"svc-side-bar__container"},s,i.createElement("div",{className:"svc-side-bar__container-content"},n))),o))}}class ae extends r.SurveyElementBase{get page(){return this.props.page}getStateElement(){return this.page}renderElement(){if(!this.page.visible)return null;return r.ReactElementFactory.Instance.createElement(this.page.componentName,{model:this.page.componentData})}}r.ReactQuestionFactory.Instance.registerQuestion("svc-side-bar-page",e=>i.createElement(ae,e)),r.ReactElementFactory.Instance.registerElement("svc-side-bar",e=>i.createElement(oe,e));class ie extends i.Component{render(){const e=this.props.model;return e?i.createElement("div",{className:"spg-launch"},i.createElement("button",{className:"spg-launch__card",onClick:e.onClick},i.createElement("div",{className:"spg-launch__container"},i.createElement("div",{className:"spg-launch__text"},e.title),i.createElement("div",{className:"spg-launch__text2"},e.description)),i.createElement("div",{className:"spg-launch__icon"},i.createElement("div",{className:"spg-launch__chevron-right-16-x-16"},i.createElement("div",{className:"spg-launch__icon2"},i.createElement(r.SvgIcon,{size:"auto",iconName:"chevrondown-24x24"})))))):null}}r.ReactElementFactory.Instance.registerElement("svc-side-bar-launch-card",e=>i.createElement(ie,e));class le extends i.Component{render(){return i.createElement("div",{className:"sd-translation-line-skeleton"})}}r.ReactElementFactory.Instance.registerElement("sd-translation-line-skeleton",e=>i.createElement(le,e));class ce extends r.SurveyElementBase{get item(){return this.props.item}getStateElement(){return this.item}renderElement(){const e=this.item;return i.createElement("div",{className:e.data.containerCss},i.createElement("span",{className:e.data.additionalTitleCss},e.data.additionalTitle),r.ReactElementFactory.Instance.createElement("sv-action-bar-item-dropdown",{item:this.item}))}}r.ReactElementFactory.Instance.registerElement("svc-translate-from-action",e=>i.createElement(ce,e));class me extends p{constructor(e){var t;super(e),this.onChangedHandler=(e,t)=>{this.setState({changed:this.state&&this.state.changed?this.state.changed+1:1})},this.onBlur=e=>(this.svStringEditorRef.current&&(this.svStringEditorRef.current.spellcheck=!1),this.locString.__isEditing=!1,this.justFocused=!1,this.baseModel.onBlur(e.nativeEvent),this.baseModel.errorText),this.onCompositionStart=e=>{this.baseModel.onCompositionStart(e.nativeEvent)},this.onCompositionEnd=e=>{this.baseModel.onCompositionEnd(e.nativeEvent)},this.onBeforeInput=e=>{this.baseModel.onBeforeInput(e)},this.onInput=e=>{this.baseModel.onInput(e.nativeEvent)},this.onPaste=e=>{this.baseModel.onPaste(e.nativeEvent)},this.justFocused=!1,this.onFocus=e=>{this.baseModel.onFocus(e.nativeEvent),this.justFocused=!0},this.onKeyDown=e=>this.baseModel.onKeyDown(e.nativeEvent),this.onKeyUp=e=>this.baseModel.onKeyUp(e.nativeEvent),this.onMouseUp=e=>this.baseModel.onMouseUp(e.nativeEvent),this.done=e=>{this.baseModel.done(e),this.locString.__isEditing=!1},this.edit=e=>{this.svStringEditorRef.current.focus(),this.locString.__isEditing=!0,this.baseModel.onClick(e)},this.htmlValue={__html:null===(t=this.locString)||void 0===t?void 0:t.renderedHtml},this.state={changed:0},this.svStringEditorRef=i.createRef()}createModel(e){this.baseModel&&this.baseModel.dispose(),this.baseModel=new n.StringEditorViewModelBase(this.locString,this.creator)}getUpdatedModelProps(){return["creator","locString"]}get locString(){return this.props.model.locStr}get creator(){return this.props.model.creator}get style(){return this.props.style}getStateElement(){return this.baseModel}get errorText(){return this.baseModel.errorText}componentDidMount(){super.componentDidMount(),this.locString&&(this.baseModel.setLocString(this.locString),this.baseModel.getEditorElement=()=>this.svStringEditorRef.current,this.baseModel.blurEditor=()=>{this.svStringEditorRef.current.blur(),this.svStringEditorRef.current.spellcheck=!1},this.baseModel.afterRender(),this.locString.onStringChanged.add(this.onChangedHandler),this.locString.__isEditing&&this.svStringEditorRef.current.focus())}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.baseModel.setLocString(this.locString),this.baseModel.afterRender(),this.locString.onStringChanged.add(this.onChangedHandler)}componentWillUnmount(){super.componentWillUnmount(),this.baseModel.detachFromUI(),this.locString&&this.locString.onStringChanged.remove(this.onChangedHandler)}get placeholder(){return this.baseModel.placeholder}get contentEditable(){return this.baseModel.contentEditable}get className(){return this.baseModel.className(this.locString.renderedHtml)}render(){if(!this.locString)return null;let e=null;this.locString.hasHtml?(this.htmlValue.__html!==this.locString.renderedHtml&&(this.htmlValue={__html:this.locString.renderedHtml}),e=i.createElement("span",{role:"textbox",ref:this.svStringEditorRef,className:"sv-string-editor sv-string-editor--html",contentEditable:this.contentEditable,spellCheck:!1,"aria-placeholder":this.placeholder,"aria-label":this.placeholder||"content editable",suppressContentEditableWarning:!0,tabIndex:this.baseModel.tabIndex,dangerouslySetInnerHTML:this.htmlValue,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onClick:this.edit})):e=i.createElement("span",{role:"textbox",ref:this.svStringEditorRef,className:"sv-string-editor",contentEditable:this.contentEditable,tabIndex:this.baseModel.tabIndex,spellCheck:!1,"aria-placeholder":this.placeholder,"aria-label":this.placeholder||"content editable",suppressContentEditableWarning:!0,key:this.locString.renderedHtml,onBlur:this.onBlur,onBeforeInput:this.onBeforeInput,onInput:this.onInput,onPaste:this.onPaste,onCompositionStart:this.onCompositionStart,onCompositionEnd:this.onCompositionEnd,onFocus:this.onFocus,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,onMouseUp:this.onMouseUp,onClick:this.edit},this.locString.renderedHtml);const t=this.baseModel.showCharacterCounter?i.createElement(r.CharacterCounterComponent,{counter:this.baseModel.characterCounter,remainingCharacterCounter:this.baseModel.getCharacterCounterClass}):null;return i.createElement("span",{className:this.className},i.createElement("span",{className:"svc-string-editor__content"},i.createElement("div",{className:"svc-string-editor__border svc-string-editor__border--hover",onClick:this.edit}),i.createElement("div",{className:"svc-string-editor__border svc-string-editor__border--focus",onClick:this.edit}),i.createElement("span",{className:"svc-string-editor__input"},e,i.createElement("div",{className:"svc-string-editor__controls",onClick:this.edit}),t)),this.errorText?i.createElement("span",{className:"svc-string-editor__error"},this.errorText):"")}}r.ReactElementFactory.Instance.registerElement(n.editableStringRendererName,e=>i.createElement(me,e));class de extends i.Component{render(){return i.createElement("div",null,i.createElement(r.SvgIcon,{"aria-hidden":"true",iconName:"icon-alert_24x24",size:"auto",className:this.props.cssClasses.error.icon}),i.createElement("span",{className:this.props.cssClasses.error.item||void 0},i.createElement(r.SurveyLocStringViewer,{model:this.props.error.locText})))}}r.ReactElementFactory.Instance.registerElement("svc-question-error",e=>i.createElement(de,e));class ue extends r.SurveyQuestionDropdown{constructor(e){super(e)}renderInput(){const e=this.question;n.initLogicOperator(e);const t=e.locReadOnlyText?this.renderLocString(e.locReadOnlyText):"",r=this.question.dropdownListModel;return i.createElement("div",{id:this.question.inputId,className:e.getControlClass(),tabIndex:this.question.isInputReadOnly?void 0:0,disabled:this.question.isInputReadOnly,required:this.question.isRequired,onChange:this.updateValueOnEvent,onInput:this.updateValueOnEvent,onKeyUp:this.keyhandler,role:r.ariaQuestionRole,"aria-required":r.ariaQuestionRequired,"aria-invalid":r.ariaQuestionInvalid,"aria-errormessage":r.ariaQuestionErrorMessage,"aria-expanded":r.ariaQuestionExpanded,"aria-label":r.ariaQuestionLabel,"aria-labelledby":r.ariaQuestionLabelledby,"aria-controls":r.ariaQuestionControls},i.createElement("div",{className:this.question.cssClasses.controlValue},t))}renderEditorButtons(){return null}}r.ReactQuestionFactory.Instance.registerQuestion("sv-logic-operator",e=>i.createElement(ue,e)),o.RendererFactory.Instance.registerRenderer("dropdown","logicoperator","sv-logic-operator");class he extends p{constructor(e){super(e),this.containerRef=i.createRef()}createModel(e){this.model&&this.model.dispose(),this.model=new n.PageNavigatorViewModel(e.pagesController,e.pageEditMode)}getUpdatedModelProps(){return["pagesController","pageEditMode"]}getStateElement(){return this.model}componentDidMount(){super.componentDidMount();const e=this.containerRef.current;this.model.attachToUI(e)}componentWillUnmount(){super.componentWillUnmount(),this.model.stopItemsContainerHeightObserver(),this.model.setScrollableContainer(void 0)}renderElement(){return i.createElement("div",{className:"svc-page-navigator",ref:this.containerRef,style:{display:this.model.visible?"flex":"none"}},i.createElement("div",null,r.ReactElementFactory.Instance.createElement("sv-action-bar-item-dropdown",{item:this.model.selectorAction})),i.createElement("div",null,this.model.visibleItems.map(e=>i.createElement(pe,{key:e.id,item:e}))))}}class pe extends p{getStateElement(){return this.props.item}renderElement(){const e=this.props.item;let t="svc-page-navigator-item-content";return o.unwrap(e.active)&&(t+=" svc-page-navigator-item--selected"),o.unwrap(e.disabled)&&(t+=" svc-page-navigator-item--disabled"),i.createElement("div",{className:"svc-page-navigator-item"},r.attachKey2click(i.createElement("div",{role:"button",className:t,onClick:t=>{e.action(e),t.stopPropagation()}},i.createElement("div",{className:"svc-page-navigator-item__dot",title:e.title},i.createElement("div",{className:"svc-page-navigator-item__dot-content"})),i.createElement("div",{className:"svc-page-navigator-item__banner"},i.createElement("span",{className:"svc-page-navigator-item__text"},e.title),i.createElement("span",{className:"svc-page-navigator-item__dot"},i.createElement("span",{className:"svc-page-navigator-item__dot-content"}))))))}}class ve extends i.Component{constructor(e){super(e)}render(){return i.createElement("div",{className:"svc-surface-placeholder"},i.createElement("div",{className:"svc-surface-placeholder__image svc-surface-placeholder__image--"+this.props.name}),i.createElement("div",{className:"svc-surface-placeholder__text"},i.createElement("div",{className:"svc-surface-placeholder__title"},this.props.placeholderTitleText),i.createElement("div",{className:"svc-surface-placeholder__description"},this.props.placeholderDescriptionText)))}}r.ReactElementFactory.Instance.registerElement("svc-surface-placeholder",e=>i.createElement(ve,e));class Ee extends r.SurveyElementBase{constructor(){super(...arguments),this.denyUpdate=()=>{this.denyComponentUpdate()},this.allowUpdate=()=>{this.allowComponentUpdate()},this.addDragDropEvents=()=>{this.creator.onDragStart.add(this.denyUpdate),this.creator.onDragClear.add(this.allowUpdate)},this.clearDragDropEvents=()=>{this.creator.onDragStart.remove(this.denyUpdate),this.creator.onDragClear.remove(this.allowUpdate)}}get model(){return this.props.data}get creator(){return this.model.creator}componentDidMount(){super.componentDidMount(),this.addDragDropEvents()}componentWillUnmount(){super.componentWillUnmount(),this.clearDragDropEvents(),super.componentWillUnmount()}getStateElements(){return[this.model,this.model.survey,this.model.pagesController]}getRenderedPages(){const e=[];if("bypage"!==this.creator.pageEditMode){this.model.pages.forEach(t=>{e.push(this.createRenderedPage(t,"svc-page",t==this.model.newPage))})}else{const t=this.model.pagesController.page2Display;t&&e.push(this.createRenderedPage(t,"svc-page",this.model.newPage===t))}return e}createRenderedPage(e,t,r){return i.createElement(ge,{key:null==e?void 0:e.id,page:e,isGhost:r,creator:this.creator,className:t})}renderElement(){const e="svc-tab-designer "+this.model.getRootCss();return i.createElement(i.Fragment,null,i.createElement("div",{className:"svc-flex-column"},this.model.isToolboxVisible?r.ReactElementFactory.Instance.createElement("svc-toolbox",{model:this.creator}):null),i.createElement("div",{className:e,onClick:()=>this.model.clickDesigner()},i.createElement(r.Scroll,null,i.createElement("div",{className:"svc-tab-designer_content"},this.model.showPlaceholder?this.renderPlaceHolder():this.renderTabContent()))))}renderHeader(e){if(!e)return null;const t=this.creator.survey;return i.createElement(i.Fragment,null,i.createElement("div",{className:"svc-designer-header"},i.createElement(r.SurveyHeader,{survey:t})))}renderPlaceHolder(){const e=this.renderHeader(this.creator.showSurveyHeader&&this.creator.showHeaderInEmptySurvey);return i.createElement(i.Fragment,null,e,i.createElement("div",{className:"svc-designer__placeholder-container","data-sv-drop-target-survey-element":"newGhostPage"},this.renderPlaceHolderContent(),this.createRenderedPage(this.model.newPage,"svc-designer-placeholder-page",!0)))}renderPlaceHolderContent(){return i.createElement(ve,{name:"designer",placeholderTitleText:this.model.placeholderTitleText,placeholderDescriptionText:this.model.placeholderDescriptionText})}renderTabContent(){const e=this.creator.survey,t=this.renderHeader(this.creator.showSurveyHeader),r={...this.model.surfaceCssVariables};r.maxWidth=e.renderedWidth;const n=this.renderTabTools();return i.createElement(i.Fragment,null,i.createElement("div",{className:this.model.designerCss,style:r},t,this.getRenderedPages()),n)}renderTabTools(){if(!this.model.showSurfaceTools)return null;const e=this.creator.showPageNavigator?i.createElement("div",{className:"svc-tab-designer__page-navigator"},i.createElement(he,{pagesController:this.model.pagesController,pageEditMode:this.model.creator.pageEditMode})):null,t=this.model.showSurfaceToolbar?i.createElement(r.SurveyActionBar,{model:this.model.surfaceToolbar,handleClick:!1}):null;return i.createElement("div",{className:"svc-tab-designer__tools"},e,t)}}r.ReactElementFactory.Instance.registerElement("svc-tab-designer",e=>i.createElement(Ee,e));class ge extends i.Component{constructor(e){super(e),this.id="PageWrapperCallback_"+ ++ge.ID,this.state={changed:0}}render(){var e,t;const n=this.props.page?r.ReactElementFactory.Instance.createElement("svc-page",{survey:this.props.creator.survey,page:this.props.page,creator:this.props.creator,isGhost:this.props.isGhost}):null;return i.createElement("div",{className:this.props.className,"data-sv-drop-target-page":null===(e=this.props.page)||void 0===e?void 0:e.name,"data-sv-drop-target-survey-element":this.props.isGhost?"newGhostPage":null===(t=this.props.page)||void 0===t?void 0:t.name},n)}setupCallback(e){e&&e.registerFunctionOnPropertyValueChanged("name",()=>{this.setState({changed:this.state&&this.state.changed?this.state.changed+1:1})},this.id)}clearCallback(e){e&&e.unRegisterFunctionOnPropertyValueChanged("name")}componentDidUpdate(e,t){e.page!==this.props.page&&(this.clearCallback(e.page),this.setupCallback(this.props.page))}componentDidMount(){this.setupCallback(this.props.page)}componentWillUnmount(){this.clearCallback(this.props.page)}}ge.ID=0;class ye extends r.SurveyElementBase{getStateElement(){return this.model}get model(){return this.props.data}renderElement(){return i.createElement("div",{className:"svc-json-editor-tab__errros_list",style:{display:this.model.hasErrors?"block":"none"}},i.createElement(r.List,{model:this.model.errorList}))}}class be extends r.SurveyElementBase{constructor(e){super(e)}getStateElement(){return this.model}get model(){return this.props.data}renderElement(){const e=e=>{this.model.textElement=e},t=i.createElement(ye,{data:this.model});return i.createElement("div",{className:"svc-creator-tab__content"},i.createElement("div",{className:"svc-json-editor-tab__content"},i.createElement("textarea",{ref:t=>e(t),className:"svc-json-editor-tab__content-area",value:this.model.text,onChange:e=>this.model.text=e.target.value,onKeyDown:e=>this.model.checkKey(e,e),disabled:this.model.readOnly,"aria-label":this.model.ariaLabel}),t))}}r.ReactElementFactory.Instance.registerElement("svc-tab-json-editor-textarea",e=>i.createElement(be,e));class _e extends r.SurveyElementBase{constructor(e){super(e),this.aceEditorrRef=i.createRef()}getStateElement(){return this.model}get model(){return this.props.data}componentDidMount(){this.model.init(ace.edit(this.aceEditorrRef.current))}renderElement(){const e=i.createElement(ye,{data:this.model});return i.createElement("div",{className:"svc-creator-tab__content"},i.createElement("div",{className:"svc-json-editor-tab__content"},i.createElement("div",{className:"svc-json-editor-tab__ace-editor",ref:this.aceEditorrRef}),e))}}r.ReactElementFactory.Instance.registerElement("svc-tab-json-editor-ace",e=>i.createElement(_e,e));class Ce extends r.SurveyElementBase{get model(){return this.props.data}getStateElement(){return this.model}renderElement(){this.model;var e=this.renderViewContent();return i.createElement("div",{className:"svc-creator-tab__content svc-logic-tab"},e)}renderViewContent(){const e="svc-plugin-tab__content svc-logic-tab svc-logic-tab__content "+(this.model.hasItems?"":"svc-logic-tab--empty"),n=this.model.readOnly?void 0:i.createElement(r.SurveyActionBar,{model:this.model.contentActionsContainer});return i.createElement(t.Fragment,null,i.createElement("div",{className:e},this.model.hasItems?i.createElement(i.Fragment,null,i.createElement(r.Survey,{model:this.model.itemsSurvey}),n):i.createElement("div",{className:"svc-logic-tab__content-empty"},i.createElement(ve,{name:"logic",placeholderTitleText:this.model.placeholderTitleText,placeholderDescriptionText:this.model.placeholderDescriptionText}),n)))}}r.ReactElementFactory.Instance.registerElement("svc-tab-logic",e=>i.createElement(Ce,e));class Ne extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.queueSurveyLayoutRefresh()}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.model.queueSurveyLayoutRefresh()}componentWillUnmount(){this.model.cancelSurveyLayoutRefresh(),super.componentWillUnmount()}renderElement(){const e=this.model.getRootCss(),t=(n=this.model.popupOverlayHeight)?{"--sv-popup-overlay-height":n}:{};var n;return this.model.survey?this.model.hasFrame?i.createElement("div",{className:e,onKeyDown:e=>this.model.tryToZoom(e,e),onMouseEnter:"desktop"===this.model.device?null:this.model.activateZoom,onMouseLeave:"desktop"===this.model.device?null:this.model.deactivateZoom},i.createElement("div",{className:"svd-simulator-wrapper",id:"svd-simulator-wrapper",style:{width:this.model.simulatorFrame.frameWidth+"px",height:this.model.simulatorFrame.frameHeight+"px"}},i.createElement("div",{className:"svd-simulator",style:{width:this.model.simulatorFrame.deviceWidth+"px",height:this.model.simulatorFrame.deviceHeight+"px",transform:"scale("+this.model.simulatorFrame.scale+") translate(-50%, -50%)"}},i.createElement("div",{className:"svd-simulator-content",style:t},i.createElement(r.Survey,{model:this.model.survey}))))):i.createElement("div",{className:e},i.createElement("div",{className:"svd-simulator-content",style:t},i.createElement(r.Survey,{model:this.model.survey}))):i.createElement("div",{className:e})}}class Se extends r.SurveyElementBase{constructor(e){super(e)}get model(){return this.props.data}getStateElement(){return this.model}renderPlaceholder(){return i.createElement(ve,{name:"preview",placeholderTitleText:this.model.placeholderTitleText,placeholderDescriptionText:this.model.placeholderDescriptionText})}renderSimulator(){return i.createElement("div",{className:"svc-plugin-tab__content"},i.createElement(Ne,{model:this.model.simulator}),this.model.showResults?i.createElement(W,{survey:this.model.simulator.survey}):null)}renderElement(){const e="svc-creator-tab__content svc-test-tab__content "+this.model.tabContentAdditionalCss;return i.createElement("div",{className:e},this.model.simulator.survey.isEmpty?this.renderPlaceholder():this.renderSimulator(),this.getBottomToolbar())}getBottomToolbar(){return this.model.isPageToolbarVisible?i.createElement("div",{className:"svc-test-tab__content-actions"},i.createElement(r.SurveyActionBar,{model:this.model.pages})):null}}r.ReactElementFactory.Instance.registerElement("svc-tab-preview",e=>i.createElement(Se,e));class xe extends i.Component{render(){return i.createElement("div",{className:"svc-property-grid-placeholder"},i.createElement("div",{className:"svc-property-grid-placeholder__header"},i.createElement("span",{className:"svc-property-grid-placeholder__title"},n.editorLocalization.getString("ed.propertyGridPlaceholderTitle")),i.createElement("span",{className:"svc-property-grid-placeholder__description"},n.editorLocalization.getString("ed.propertyGridPlaceholderDescription"))),i.createElement("div",{className:"svc-property-grid-placeholder__content"},i.createElement("div",{className:"svc-property-grid-placeholder__gap"}),i.createElement("div",{className:"svc-property-grid-placeholder__image"})))}}r.ReactElementFactory.Instance.registerElement("svc-property-grid-placeholder",e=>i.createElement(xe,e));class fe extends r.SurveyElementBase{get model(){return this.props.data}getStateElement(){return this.model}renderPlaceholder(){return i.createElement(ve,{name:"theme",placeholderTitleText:this.model.placeholderTitleText,placeholderDescriptionText:this.model.placeholderDescriptionText})}renderSimulator(){return i.createElement("div",{className:"svc-plugin-tab__content"},i.createElement(Ne,{model:this.model.simulator}),this.model.showResults?i.createElement(W,{survey:this.model.simulator.survey}):null)}renderElement(){const e="svc-creator-tab__content svc-test-tab__content "+this.model.tabContentAdditionalCss;return i.createElement("div",{className:e},this.model.simulator.survey.isEmpty?this.renderPlaceholder():this.renderSimulator(),this.getBottomToolbar())}getBottomToolbar(){return this.model.isPageToolbarVisible?i.createElement("div",{className:"svc-test-tab__content-actions"},i.createElement(r.SurveyActionBar,{model:this.model.pages})):null}}r.ReactElementFactory.Instance.registerElement("svc-tab-theme",e=>i.createElement(fe,e));class Ie extends r.SurveyElementBase{get model(){return this.props.data||this.props.model}getStateElement(){return this.model}renderElement(){return this.model?i.createElement("div",{className:"svc-creator-tab__content svc-translation-tab"+(this.model.isEmpty?" svc-translation-tab--empty":"")},this.renderElementContent()):null}renderElementContent(){return this.model.isEmpty?i.createElement(ve,{name:"translation",placeholderTitleText:this.model.placeholderTitleText,placeholderDescriptionText:this.model.placeholderDescriptionText}):this.model.isSideBySideForms?this.renderSideBySideContent(this.model):this.renderStringsContent(this.model)}renderStringsContent(e){var t,n;return i.createElement("div",{className:"st-content"},i.createElement("div",{className:"svc-flex-column st-strings-wrapper"},i.createElement("div",{className:"svc-flex-row st-strings-header"},i.createElement(r.Survey,{key:null===(t=e.stringsHeaderSurvey)||void 0===t?void 0:t.elementIdPrefix,model:e.stringsHeaderSurvey})),i.createElement("div",{className:"svc-flex-row svc-plugin-tab__content st-strings"},i.createElement(r.Survey,{key:null===(n=e.stringsSurvey)||void 0===n?void 0:n.elementIdPrefix,model:e.stringsSurvey}))))}renderSideBySideContent(e){var t;const n=e.targetSurvey;return i.createElement("div",{className:"st-side-by-side"+(n?"":" st-side-by-side--no-target")},i.createElement("div",{key:null===(t=e.sourceSurvey)||void 0===t?void 0:t.elementIdPrefix,className:"st-side-by-side__source",ref:t=>{e.setSourceScrollElement(t)}},i.createElement(r.Survey,{model:e.sourceSurvey})),n?i.createElement("div",{key:n.elementIdPrefix,className:"st-side-by-side__target",ref:t=>{e.setTargetScrollElement(t)}},i.createElement(r.Survey,{model:n})):null)}}r.ReactElementFactory.Instance.registerElement("svc-tab-translation",e=>i.createElement(Ie,e));class we extends r.SurveyElementBase{get item(){return this.props.item}getStateElement(){return this.item}renderElement(){const e=this.item;if(!e)return null;const t=n.getTranslationLocaleProgress(e);return i.createElement("div",{className:"svc-translation-locale-item"},i.createElement("span",{className:"svc-translation-locale-item__name"},this.renderLocString(e.locTitle,void 0,"locString")),t?i.createElement("span",{className:"svc-translation-locale-item__progress"},t):null)}}r.ReactElementFactory.Instance.registerElement(n.translationLocaleItemComponentName,e=>i.createElement(we,e));class Re extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}renderElement(){return this.model.isVisible?i.createElement(r.List,{model:this.model.list}):null}}r.ReactElementFactory.Instance.registerElement("svc-object-selector",e=>i.createElement(Re,e));class Me extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}canRender(){return!!this.model&&super.canRender()}renderElement(){return i.createElement("div",{className:this.model.rootCss},i.createElement(X,{model:this.model.searchManager}),i.createElement(r.Survey,{model:this.model.survey}))}}r.ReactElementFactory.Instance.registerElement("svc-property-grid",e=>i.createElement(Me,e));class qe extends i.Component{constructor(e){super(e)}render(){const e=this.props.model.elements.map((e,t)=>r.ReactElementFactory.Instance.createElement(e.componentName,{...e.componentData,key:t})),t=this.props.model.scrollable?i.createElement(r.Scroll,null," ",e," "):e;return this.props.model.wrapped?i.createElement("div",{className:this.props.model.cssClass}," ",t," "):i.createElement(i.Fragment,null,t)}}r.ReactElementFactory.Instance.registerElement("svc-component-container",e=>i.createElement(qe,e));class De extends i.Component{render(){const e=this.props.item;return e?i.createElement("div",{className:"svc-icon-item"},i.createElement(r.SvgIcon,{className:"svc-icon-item__icon",size:"auto",iconName:e.value}),i.createElement("span",{className:"svc-icon-item__text"},e.title)):null}}r.ReactElementFactory.Instance.registerElement("svc-presets-icon-item",e=>i.createElement(De,e));class Te extends r.SurveyElementBase{get item(){return this.props.item}getStateElement(){return this.item}renderElement(){const e=this.item.tooltip||this.item.title,t=this.item.hasTitle?i.createElement("span",{className:"svc-switcher__title"},this.item.title):null;return r.attachKey2click(i.createElement("button",{className:this.item.getActionBarItemCss(),type:"button",disabled:this.item.disabled,onClick:e=>this.item.action(this.item,this.item.getIsTrusted(e)),title:e,"aria-checked":this.item.ariaChecked,"aria-expanded":this.item.ariaExpanded,role:this.item.ariaRole},i.createElement("div",{className:this.item.getSwitcherIconCss()},i.createElement("div",{className:"svc-switcher__icon-thumb"})),t),this.item,{processEsc:!1})}}r.ReactElementFactory.Instance.registerElement("svc-switcher",e=>i.createElement(Te,e));class Fe extends r.SurveyElementBase{get item(){return this.props.item}getStateElement(){return this.item}canRender(){return!!this.item&&this.item.visible&&super.canRender()}renderMarker(){const e=this.item;return e.hasMarkerText?i.createElement("span",{className:e.markerCss},e.markerText):e.hasMarkerIcon?i.createElement("span",{className:"svc-collab-row__icon"},i.createElement(r.SvgIcon,{iconName:e.markerIconName,size:e.markerIconSize})):null}renderElement(){const e=this.item;return i.createElement("div",{className:e.rowCss,role:e.rowRole||void 0,"aria-expanded":e.ariaExpanded},this.renderMarker(),i.createElement("span",{className:"svc-collab-row__title"},e.title),e.hasSubtitle?i.createElement("span",{className:"svc-collab-row__subtitle"},e.subtitle):null)}}r.ReactElementFactory.Instance.registerElement("svc-collab-row",e=>i.createElement(Fe,e));class Be extends r.SurveyElementBase{constructor(e){super(e),this.root=i.createRef()}get model(){return this.props.model}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.setComponentElement(this.root.current)}componentWillUnmount(){super.componentWillUnmount(),this.model.resetComponentElement()}renderElement(){const e=this.model,t=r.ReactElementFactory.Instance.createElement(e.contentComponentName,e.contentComponentData);return i.createElement("div",{ref:this.root,className:e.rootCss,style:e.style,role:"dialog","aria-modal":!1,"aria-labelledby":e.titleId,tabIndex:-1,onPointerDownCapture:()=>e.bringToFront()},i.createElement("div",{className:e.headerCss,onPointerDown:t=>e.onPointerDown(t.nativeEvent)},i.createElement("span",{id:e.titleId,className:"svc-floating-panel__title"},e.titleText),i.createElement("span",{className:"svc-floating-panel__drag","aria-hidden":"true"},i.createElement(r.SvgIcon,{iconName:"icon-draghorizontal-24x16",size:"auto"})),i.createElement(r.SurveyActionBar,{model:e.headerToolbar})),i.createElement("div",{className:e.bodyCss},t))}}r.ReactElementFactory.Instance.registerElement("svc-floating-panel",e=>i.createElement(Be,e));let ke=class extends r.SurveyElementBase{render(){const e=this.props.item;return i.createElement(i.Fragment,null,i.createElement(r.SvgIcon,{iconName:e.iconName,size:e.iconSize,className:"svc-json-error__icon"}),i.createElement("div",{className:"svc-json-error__container"},i.createElement("div",{className:"svc-json-error__title"},i.createElement("span",{key:2},this.renderLocString(e.locTitle,void 0,"locString"))),this.renderFixButton()))}renderFixButton(){if(!this.props.item.data.showFixButton)return null;const e=this.props.item;return r.attachKey2click(i.createElement("button",{type:"button",onClick:t=>{t.stopPropagation(),e.data.fixError()},title:e.data.fixButtonTitle,className:"svc-json-error__fix-button"},i.createElement(r.SvgIcon,{iconName:e.data.fixButtonIcon,size:"auto"})))}};r.ReactElementFactory.Instance.registerElement("json-error-item",e=>i.createElement(ke,e));class Pe extends r.SurveyElementBase{constructor(e){super(e)}getStateElement(){return this.model}get model(){return this.props.data}renderElement(){return i.createElement(qe,{model:this.model.containerModel})}}r.ReactElementFactory.Instance.registerElement("svc-tab-container",e=>i.createElement(Pe,e));class Ue extends r.SurveyQuestionText{constructor(e){super(e)}get question(){return this.questionBase}renderInput(){return i.createElement(i.Fragment,null,i.createElement("input",{role:"spinbutton",id:this.question.inputId,disabled:this.isDisplayMode,className:this.question.cssClasses.control,ref:e=>this.setControl(e),placeholder:this.question.renderedPlaceholder,autoComplete:"off",onBlur:e=>this.question.onBlur(e.nativeEvent),onFocus:e=>this.question.onFocus(e.nativeEvent),onChange:this.question.onChange,onBeforeInput:e=>this.question.onBeforeInput(e.nativeEvent),onKeyUp:e=>this.question.onKeyUp(e.nativeEvent),onKeyDown:e=>this.question.onInputKeyDown(e.nativeEvent),"aria-required":this.question.a11y_input_ariaRequired,"aria-label":this.question.a11y_input_ariaLabel,"aria-labelledby":this.question.a11y_input_ariaLabelledBy,"aria-describedby":this.question.a11y_input_ariaDescribedBy,"aria-invalid":this.question.a11y_input_ariaInvalid,"aria-errormessage":this.question.a11y_input_ariaErrormessage}))}renderElement(){return i.createElement("div",{className:this.question.cssClasses.root,onKeyDown:e=>this.question.onKeyDown(e.nativeEvent)},this.renderInput(),this.renderButtons())}getValueCore(){return this.question.renderedValue}renderButtons(){return i.createElement(r.SurveyActionBar,{model:this.question.inputActionsContainer})}}class Ae extends r.SurveyElementBase{get item(){return this.props.item}get itemAction(){return this.props.item}getStateElement(){return this.itemAction}get question(){return this.item.data.question}renderElement(){return i.createElement("button",{tabIndex:-1,"aria-hidden":"true",className:this.itemAction.getActionBarItemCss(),disabled:this.itemAction.disabled,onClick:()=>this.item.action(),onMouseDown:this.item.data.onMouseDown,onMouseUp:this.question.onButtonMouseUp,onMouseLeave:this.question.onButtonMouseLeave,onBlur:e=>this.question.onBlur(e.nativeEvent),onFocus:e=>this.question.onFocus(e.nativeEvent)},i.createElement(r.SvgIcon,{className:this.itemAction.cssClasses.itemIcon,iconName:this.item.iconName,size:"auto"}))}}r.ReactElementFactory.Instance.registerElement("sv-spinedit-button",e=>i.createElement(Ae,e)),r.ReactQuestionFactory.Instance.registerQuestion("spinedit",e=>i.createElement(Ue,e));class Le extends i.Component{get rootClassName(){var e;return null!==(e=this.props.className)&&void 0!==e?e:"sd-color-swatch"}get rootStyle(){return{backgroundColor:this.props.color}}renderIcon(){var e,t;return this.props.showIcon?i.createElement(r.SvgIcon,{iconName:null!==(e=this.props.swatchIcon)&&void 0!==e?e:"icon-dropper-16x16",size:"auto",className:null!==(t=this.props.iconClassName)&&void 0!==t?t:"sd-color-swatch__icon"}):null}renderColorInput(){const{onColorInputChange:e,colorInputValue:t,colorInputClassName:r,inputDisabled:n,arias:s}=this.props;return e?i.createElement("input",{type:"color",disabled:n,value:t,className:r,onChange:e,tabIndex:-1,...s}):null}render(){const e=i.createElement("div",{className:"sd-color-swatch__content",style:this.rootStyle},this.renderIcon(),this.renderColorInput());return this.props.onColorInputChange?i.createElement("label",{className:this.rootClassName},e):i.createElement("div",{className:this.rootClassName},e)}}class Ve extends r.SurveyElementBase{render(){const e=this.props.item;return i.createElement("div",{className:"sd-color-swatch-item"},i.createElement("div",{className:"sd-color-swatch-item__label"},i.createElement("span",{key:2,className:"sd-color-swatch-item__caption"},this.renderLocString(e.locTitle,void 0,"locString"))),i.createElement(Le,{color:e.value}))}}r.ReactElementFactory.Instance.registerElement("color-item",e=>i.createElement(Ve,e));class Qe extends r.SurveyQuestionText{constructor(e){super(e)}get question(){return this.questionBase}renderInput(){return i.createElement(i.Fragment,null,i.createElement("input",{id:this.question.inputId,disabled:this.isDisplayMode,className:this.question.cssClasses.control,ref:e=>this.setControl(e),placeholder:this.question.renderedPlaceholder,autoComplete:"off",onKeyUp:e=>this.question.onKeyUp(e.nativeEvent),onBlur:e=>this.question.onBlur(e.nativeEvent),onChange:this.question.onChange,onBeforeInput:e=>this.question.onBeforeInput(e.nativeEvent),"aria-required":this.question.a11y_input_ariaRequired,"aria-labelledby":this.question.a11y_input_ariaLabelledBy,"aria-label":this.question.a11y_input_ariaLabel,"aria-invalid":this.question.a11y_input_ariaInvalid,"aria-describedby":this.question.a11y_input_ariaDescribedBy}))}renderElement(){return i.createElement("div",{className:this.question.cssClasses.rootWrapper},i.createElement("div",{className:this.question.cssClasses.root,onKeyDown:e=>this.question.onKeyDown(e.nativeEvent)},this.renderColorSwatch(),this.renderInput(),this.renderButtons()))}getValueCore(){return this.question.renderedValue}renderColorSwatch(){const e=this.question;return i.createElement("div",{className:e.cssClasses.colorSwatch},i.createElement(Le,{className:e.getSwatchCss(),swatchIcon:e.cssClasses.swatchIcon,iconClassName:e.cssClasses.iconClassName,color:e.renderedValue,showIcon:!0,colorInputValue:e.renderedColorValue,colorInputClassName:e.cssClasses.colorInput,inputDisabled:this.isDisplayMode,onColorInputChange:t=>e.onColorInputChange(t.nativeEvent),arias:{"aria-required":e.a11y_input_ariaRequired,"aria-labelledby":e.a11y_input_ariaLabelledBy,"aria-label":e.a11y_input_ariaLabel,"aria-invalid":e.a11y_input_ariaInvalid,"aria-describedby":e.a11y_input_ariaDescribedBy}}))}renderButtons(){return this.question.hasVisibleInputActions?i.createElement(r.SurveyActionBar,{model:this.question.inputActionsContainer}):null}}r.ReactQuestionFactory.Instance.registerQuestion("color",e=>i.createElement(Qe,e));class He extends r.SurveyQuestionText{constructor(e){super(e)}get questionFile(){return this.questionBase}getValueCore(){return this.question.renderedValue}renderInput(){return i.createElement(i.Fragment,null,i.createElement("input",{disabled:this.question.isTextInputReadOnly,className:this.questionFile.cssClasses.control,placeholder:this.questionFile.renderedPlaceholder,ref:e=>this.setControl(e),autoComplete:"off",type:"text",onBlur:e=>this.questionFile.onInputBlur(e.nativeEvent),onChange:e=>this.questionFile.onInputChange(e.nativeEvent)}))}renderButtons(){return this.question.hasVisibleInputActions?i.createElement(r.SurveyActionBar,{model:this.questionFile.inputActionsContainer}):null}renderElement(){return i.createElement("div",{className:this.questionFile.cssClasses.root,ref:e=>this.setContent(e),onDragEnter:this.questionFile.onDragEnter,onDragOver:this.questionFile.onDragOver,onDrop:this.questionFile.onDrop,onDragLeave:this.questionFile.onDragLeave,onKeyDown:e=>this.question.onKeyDown(e.nativeEvent)},this.renderInput(),this.renderButtons())}}class We extends r.SurveyElementBase{get item(){return this.props.item}get question(){return this.props.item.data.question}getStateElement(){return this.item}renderElement(){return i.createElement("div",null,r.attachKey2click(i.createElement("label",{onClick:e=>this.question.chooseFiles(e.nativeEvent),className:this.item.getActionBarItemCss(),htmlFor:this.question.inputId,"aria-label":this.question.chooseButtonCaption},i.createElement(r.SvgIcon,{iconName:this.item.iconName,size:"auto",title:this.item.title,className:this.item.cssClasses.itemIcon}),i.createElement("span",{className:"sv-visuallyhidden"},this.question.chooseButtonCaption))),i.createElement("input",{type:"file",disabled:this.item.disabled,className:this.question.cssClasses.fileInput,id:this.question.inputId,"aria-required":this.question.ariaRequired,"aria-label":this.question.ariaLabel,"aria-invalid":this.question.ariaInvalid,"aria-describedby":this.question.ariaDescribedBy,multiple:!1,title:this.question.inputTitle,accept:this.question.acceptedTypes,tabIndex:-1,onChange:e=>this.question.onFileInputChange(e.nativeEvent)}))}}r.ReactQuestionFactory.Instance.registerQuestion("fileedit",e=>i.createElement(He,e)),r.ReactElementFactory.Instance.registerElement("sv-fileedit-button",e=>i.createElement(We,e)),e.Version=void 0,e.Version="3.0.1",o.checkLibraryVersion("3.0.1","survey-creator-react"),Object.defineProperty(e,"PropertyGridEditorCollection",{enumerable:!0,get:function(){return n.PropertyGridEditorCollection}}),Object.defineProperty(e,"SurveyLogic",{enumerable:!0,get:function(){return n.SurveyLogic}}),Object.defineProperty(e,"SurveyLogicUI",{enumerable:!0,get:function(){return n.SurveyLogicUI}}),Object.defineProperty(e,"SurveyQuestionEditorDefinition",{enumerable:!0,get:function(){return n.SurveyQuestionEditorDefinition}}),Object.defineProperty(e,"ToolboxToolViewModel",{enumerable:!0,get:function(){return n.ToolboxToolViewModel}}),Object.defineProperty(e,"editorLocalization",{enumerable:!0,get:function(){return n.editorLocalization}}),Object.defineProperty(e,"localization",{enumerable:!0,get:function(){return n.localization}}),Object.defineProperty(e,"settings",{enumerable:!0,get:function(){return n.settings}}),Object.defineProperty(e,"svgBundle",{enumerable:!0,get:function(){return n.svgBundle}}),e.ActionButton=C,e.AdaptiveToolbox=Y,e.AddQuestionButtonComponent=T,e.CellQuestionAdornerComponent=w,e.CellQuestionDropdownAdornerComponent=R,e.CollabRowComponent=Fe,e.ComponentContainer=qe,e.CreatorSurveyPageComponent=D,e.FloatingPanelComponent=Be,e.IconItem=De,e.ImageItemValueAdornerComponent=V,e.ItemValueAdornerComponent=A,e.LogoImageComponent=B,e.MatrixCellAdornerComponent=H,e.PanelAdornerComponent=F,e.PropertyGridComponent=Me,e.PropertyGridPlaceholderComponent=xe,e.QuestionAdornerComponent=y,e.QuestionBanner=N,e.QuestionDropdownAdornerComponent=S,e.QuestionEditorContentComponent=U,e.QuestionErrorComponent=de,e.QuestionImageAdornerComponent=x,e.QuestionRatingAdornerComponent=f,e.QuestionWidgetAdornerComponent=I,e.QuestionWrapperFooter=_,e.QuestionWrapperHeader=b,e.ReactDragEvent=class extends E{constructor(e){super(e),this.event=e}get dataTransfer(){return this.event.dataTransfer}},e.ReactMouseEvent=E,e.RowWrapper=v,e.SearchComponent=X,e.SideBarDefaultHeader=re,e.SideBarLaunchCard=ie,e.SidebarComponent=oe,e.SurveyCreator=h,e.SurveyCreatorComponent=u,e.SurveyCreatorToolboxCategory=G,e.SurveyCreatorToolboxItem=K,e.SurveyCreatorToolboxItemGroup=z,e.SurveyCreatorToolboxTool=j,e.SurveyElementEmbeddedSurvey=P,e.SurveyLocStringEditor=me,e.SurveyLogicOpertor=ue,e.SurveyNavigation=Z,e.SurveyQuestionColor=Qe,e.SurveyQuestionFileEditor=He,e.SurveyQuestionFileEditorButton=We,e.SurveyQuestionLinkValue=k,e.SurveyQuestionSpinEditor=Ue,e.SurveyResults=W,e.SurveyResultsByRow=O,e.SurveySimulator=Ne,e.SurveySpinEditorButton=Ae,e.SwitcherComponent=Te,e.TabButtonComponent=$,e.TabContainerComponent=Pe,e.TabDesignerComponent=Ee,e.TabJsonEditorAceComponent=_e,e.TabJsonEditorErrorsComponent=ye,e.TabJsonEditorTextareaComponent=be,e.TabLogicComponent=Ce,e.TabPreviewSurveyComponent=Se,e.TabThemeSurveyComponent=fe,e.TabTranslationComponent=Ie,e.TabbedMenuComponent=c,e.TabbedMenuItemComponent=d,e.ToolboxList=J,e.TranslateFromAction=ce,e.TranslationDropdownQuestionComponent=M,e.TranslationLineSkeleton=le,e.TranslationLocaleItemComponent=we});
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("survey-react-ui"),require("survey-creator-core"),require("react-dom"),require("survey-core")):"function"==typeof define&&define.amd?define(["exports","react","survey-react-ui","survey-creator-core","react-dom","survey-core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SurveyCreator={},e.React,e.SurveyReact,e.SurveyCreatorCore,e.ReactDOM,e.Survey)}(this,function(e,t,r,n,s,o){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var i=a(t),l=a(s);class c extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}constructor(e){super(e),this.rootRef=i.createRef()}renderElement(){const e=this.model.renderedActions.map(e=>i.createElement(m,{item:e,key:e.renderedId}));return i.createElement("div",{ref:this.rootRef,className:"svc-tabbed-menu",role:"tablist",style:this.model.getRootStyle()},e)}componentDidUpdate(e,t){super.componentDidUpdate(e,t);const r=this.rootRef.current;r&&this.model.initResponsivityManager(r)}componentDidMount(){super.componentDidMount();const e=this.rootRef.current;e&&this.model.initResponsivityManager(e)}componentWillUnmount(){this.model.resetResponsivityManager(),super.componentWillUnmount()}}class m extends r.SurveyElementBase{constructor(e){super(e),this.ref=i.createRef(),this.state={changed:0}}get item(){return this.props.item}getStateElement(){return this.item}renderElement(){let e="svc-tabbed-menu-item-container";this.item.css&&(e+=" "+this.item.css),e+=this.item.isVisible?"":" svc-tabbed-menu-item-container--hidden";const t=r.ReactElementFactory.Instance.createElement(this.item.component||"svc-tabbed-menu-item",{item:this.item});return i.createElement("span",{key:this.item.id,className:e,ref:this.ref},i.createElement("div",{className:"svc-tabbed-menu-item-container__content"},t))}componentDidMount(){super.componentDidMount(),this.item.updateModeCallback=(e,t)=>{const r=()=>{this.item.mode==e?this.setState({changed:this.state.changed+1}):this.item.mode=e};queueMicrotask(()=>{l.flushSync?l.flushSync(()=>{r()}):r(),queueMicrotask(()=>{t(e,this.ref.current)})})},this.item.afterRender()}componentWillUnmount(){super.componentWillUnmount(),this.item.updateModeCallback=void 0}}class d extends r.SurveyElementBase{get item(){return this.props.item}getStateElement(){return this.item}render(){const e=this.item;return r.attachKey2click(i.createElement("div",{role:"tab",id:"tab-"+e.id,"aria-selected":e.active,"aria-controls":"scrollableDiv-"+e.id,className:e.getRootCss(),onClick:()=>e.doAction()},e.hasTitle?i.createElement("span",{className:e.getTitleCss()},e.title):null,e.hasIcon?i.createElement(r.SvgIcon,{iconName:e.iconName,className:e.getIconCss(),size:"auto",title:e.tooltip||e.title}):null))}}r.ReactElementFactory.Instance.registerElement("svc-tabbed-menu-item",e=>i.createElement(d,e));class u extends r.SurveyElementBase{constructor(e){super(e),this.rootNode=i.createRef()}get creator(){return this.props.creator}getStateElement(){return this.creator}get style(){return this.props.style}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.creator!==e.creator&&(e.creator&&e.creator.unsubscribeRootElement(),this.creator&&this.rootNode.current&&this.creator.setRootElement(this.rootNode.current))}componentDidMount(){super.componentDidMount(),this.creator.setRootElement(this.rootNode.current)}componentWillUnmount(){super.componentWillUnmount(),this.creator.unsubscribeRootElement()}renderElement(){const e=this.props.creator;if(e.isCreatorDisposed)return null;const t="svc-full-container svc-creator__area svc-flex-column"+(this.props.creator.haveCommercialLicense?"":" svc-creator__area--with-banner"),s="svc-creator__content-wrapper svc-flex-row"+(this.props.creator.isMobileView?" svc-creator__content-wrapper--footer-toolbar":""),o="svc-flex-row svc-full-container svc-creator__side-bar--"+this.creator.sidebarLocation,a={};n.assign(a,this.style,this.props.creator.themeVariables);let l=null;if(!this.props.creator.haveCommercialLicense){const e={__html:this.props.creator.licenseText};l=i.createElement("div",{className:"svc-creator__banner"},i.createElement("span",{className:"svc-creator__non-commercial-text",dangerouslySetInnerHTML:e}))}return i.createElement("div",{className:this.creator.getRootCss(),ref:this.rootNode,style:a},i.createElement(r.SvgBundleComponent,null),i.createElement(r.PopupModal,null),i.createElement("div",{className:t},this.renderCollabBar(),i.createElement("div",{className:o},i.createElement("div",{className:"svc-flex-column svc-flex-row__element svc-flex-row__element--growing"},i.createElement("div",{className:"svc-top-bar"},e.showTabs?i.createElement("div",{className:"svc-tabbed-menu-wrapper"},i.createElement(c,{model:e.tabbedMenu})):null,e.showToolbar?i.createElement("div",{className:"svc-toolbar-wrapper"},i.createElement(r.SurveyActionBar,{model:e.toolbar})):null),i.createElement("div",{className:s},i.createElement("div",{className:"svc-creator__content-holder svc-flex-column"},this.renderActiveTab())),i.createElement("div",{className:"svc-footer-bar"},e.isMobileView?i.createElement("div",{className:"svc-toolbar-wrapper"},i.createElement(r.SurveyActionBar,{model:e.footerToolbar})):null)),this.renderSidebar()),l,i.createElement(r.NotifierComponent,{notifier:e.notifier})))}renderCollabBar(){const e=this.creator.collabBar;return e?r.ReactElementFactory.Instance.createElement("svc-component-container",{model:e.container}):null}renderActiveTab(){const e=this.props.creator;return this.renderCreatorTab(e.activeTabMenuItem)}renderCreatorTab(e){if(!e)return null;const t=this.props.creator,n=e.renderTab?e.renderTab():r.ReactElementFactory.Instance.createElement(e.componentContent,{creator:t,survey:t.survey,data:e.data.model,model:e.data.model}),s="svc-creator-tab"+("right"==t.toolboxLocation?" svc-creator__toolbox--right":"");return i.createElement("div",{role:"tabpanel",key:e.id,id:"scrollableDiv-"+e.id,"aria-labelledby":"tab-"+e.id,className:s},n)}renderSidebar(){return this.creator.isSidebarVisible?r.ReactElementFactory.Instance.createElement("svc-side-bar",{model:this.creator.sidebar}):null}}class h extends n.SurveyCreatorModel{constructor(e={},t){super(e,t)}render(e){console.error("The render method is deprecated. Use SurveyCreatorComponent instead.")}createQuestionElement(e){return r.ReactQuestionFactory.Instance.createQuestion(e.isDefaultRendering()?e.getTemplate():e.getComponentName(),{question:e,isDisplayMode:e.isReadOnly,creator:this})}renderError(e,t,n){return i.createElement("div",{key:e},i.createElement("span",{className:n.error.icon,"aria-hidden":"true"}),i.createElement("span",{className:n.error.item},i.createElement(r.SurveyLocStringViewer,{model:t.locText})))}questionTitleLocation(){return this.survey.questionTitleLocation}questionErrorLocation(){return this.survey.questionErrorLocation}}r.ReactElementFactory.Instance.registerElement("survey-widget",e=>i.createElement(r.Survey,e));class p extends r.SurveyElementBase{constructor(e){super(e),this.createModel(e)}shouldComponentUpdate(e,t){const r=super.shouldComponentUpdate(e,t);return r&&this.needUpdateModel(e)&&this.createModel(e),r}createModel(e){}needUpdateModel(e){const t=this.getUpdatedModelProps();if(!Array.isArray(t))return!0;for(var r=0;r<t.length;r++){const n=t[r];if("object"==typeof n){const t=this.props[n.name],r=e[n.name];if(n.deepEqual){if(this.props[n.name]===e[n.name])return!1;const s=Object.keys(t||{});return s.length!==Object.keys(r||{}).length||s.some(e=>t[e]!=r[e])}return t!==r}if(this.props[n]!==e[n])return!0}return!1}getUpdatedModelProps(){}}class v extends p{constructor(e){super(e)}createModel(e){this.model&&this.model.dispose(),this.model=new n.RowViewModel(e.componentData.creator,e.row,null)}getUpdatedModelProps(){return["row",{name:"componentData",deepEqual:!0}]}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.subscribeElementChanges()}componentWillUnmount(){this.model.unsubscribeElementChanges(),super.componentWillUnmount()}render(){return i.createElement("div",{key:"svc-row-"+this.props.row.id,className:this.model.cssClasses},i.createElement("div",{className:"svc-row__drop-indicator svc-row__drop-indicator--top"}),i.createElement("div",{className:"svc-row__drop-indicator svc-row__drop-indicator--bottom"}),this.props.element)}}r.ReactElementFactory.Instance.registerElement("svc-row",e=>i.createElement(v,e));class E{constructor(e){this.event=e}stopPropagation(){this.event.stopPropagation()}preventDefault(){this.event.preventDefault()}get cancelBubble(){return!1}set cancelBubble(e){}get target(){return this.event.target}get currentTarget(){return this.event.currentTarget}get clientX(){return this.event.clientX}get clientY(){return this.event.clientY}get offsetX(){return this.event.nativeEvent.offsetX}get offsetY(){return this.event.nativeEvent.offsetY}}const g=i.memo(function(e){return e.element});g.displayName="QuestionElementContent";class y extends p{constructor(e){super(e),this.rootRef=i.createRef()}createModel(e){this.model?this.model.attachToUI(e.question,this.rootRef.current):this.modelValue=this.createQuestionViewModel(e)}createQuestionViewModel(e){return new n.QuestionAdornerViewModel(e.componentData,e.question,null)}getUpdatedModelProps(){return["question","componentData"]}get model(){return this.modelValue}getStateElement(){return this.model}renderElement(){const e=this.model.element.isInteractiveDesignElement,t=this.renderQuestionTitle(),r=this.renderContent(e);return i.createElement("div",{ref:this.rootRef,"data-sv-drop-target-survey-element":this.model.element.name||null,className:this.model.rootCss(),onDoubleClick:t=>{e&&this.model.dblclick(t.nativeEvent),t.stopPropagation()},onMouseLeave:t=>e&&this.model.hover(t.nativeEvent,t.currentTarget),onMouseOver:t=>e&&this.model.hover(t.nativeEvent,t.currentTarget)},t,r)}disableTabStop(){return!0}renderContent(e){var t=this.model.needToRenderContent?this.renderElementContent():null;return r.attachKey2click(i.createElement("div",{className:this.model.css(),onClick:e=>this.model.select(this.model,new E(e))},i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--left"}),i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--right"}),i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--top"}),i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--bottom"}),e?this.renderHeader():null,t,this.model.needToRenderContent?this.renderFooter():null),void 0,{disableTabStop:this.disableTabStop()})}renderHeader(){return r.ReactElementFactory.Instance.createElement("svc-question-header",{model:this.model})}renderFooter(){return this.model.element.isInteractiveDesignElement?r.ReactElementFactory.Instance.createElement("svc-question-footer",{className:"svc-question__content-actions",model:this.model}):null}renderCarryForwardBanner(){return this.model.isBannerShowing?r.ReactElementFactory.Instance.createElement("svc-question-banner",this.model.createBannerParams()):null}renderQuestionTitle(){if(!this.model.showHiddenTitle)return null;const e=this.model.element;return i.createElement("div",{ref:e=>e&&(this.model.renderedCollapsed?e.removeAttribute("inert"):e.setAttribute("inert","")),className:this.model.cssCollapsedHiddenHeader},e.hasTitle?i.createElement(r.TitleElement,{element:e,renderActions:!1}):i.createElement("div",{className:this.model.cssCollapsedHiddenTitle},i.createElement("span",{className:"svc-fake-title"},e.name)))}renderElementContent(){return i.createElement(i.Fragment,null,i.createElement(g,{element:this.props.element}),this.renderElementPlaceholder(),this.renderCarryForwardBanner())}componentDidMount(){super.componentDidMount(),this.model.attachToUI(this.props.question,this.rootRef.current)}renderElementPlaceholder(){return this.model.isEmptyElement?i.createElement("div",{className:"svc-panel__placeholder_frame-wrapper"},i.createElement("div",{className:"svc-panel__placeholder_frame"},i.createElement("div",{className:"svc-panel__placeholder"},this.model.placeholderText))):null}componentWillUnmount(){super.componentWillUnmount(),this.model.detachFromUI()}}r.ReactElementFactory.Instance.registerElement("svc-question",e=>i.createElement(y,e));class b extends i.Component{render(){return this.props.model.allowDragging?i.createElement("div",{className:"svc-question__drag-area",onPointerDown:e=>this.props.model.onPointerDown(e)},i.createElement(r.SvgIcon,{className:"svc-question__drag-element",size:"auto",iconName:"icon-drag-area-indicator_24x16"}),i.createElement("div",{className:"svc-question__top-actions"},i.createElement(r.SurveyActionBar,{model:this.props.model.topActionContainer,handleClick:!1}))):null}}r.ReactElementFactory.Instance.registerElement("svc-question-header",e=>i.createElement(b,e));class _ extends i.Component{render(){return i.createElement("div",{className:this.props.className,onFocus:e=>this.props.model.select(this.props.model,new E(e))},i.createElement(r.SurveyActionBar,{model:this.props.model.actionContainer,handleClick:!1}))}}r.ReactElementFactory.Instance.registerElement("svc-question-footer",e=>i.createElement(_,e));class C extends r.SurveyElementBase{renderElement(){const e=(new o.CssClassBuilder).append(this.props.classes).append("svc-action-button").append("svc-action-button--selected",!!this.props.selected).append("svc-action-button--disabled",!!this.props.disabled).toString();return this.props.iconName?this.renderIcon(e):this.renderButtonText(e)}renderButtonText(e){return this.props.disabled?i.createElement("span",{className:e},this.props.text):i.createElement(i.Fragment,null,r.attachKey2click(i.createElement("span",{role:"button",className:e,onClick:e=>{this.props.allowBubble||e.stopPropagation(),this.props.click()},title:this.props.title},this.props.text)))}renderIcon(e){return e+=" svc-action-button--icon",this.props.disabled?i.createElement("span",{className:e},i.createElement(r.SvgIcon,{size:"auto",iconName:this.props.iconName})):i.createElement(i.Fragment,null,r.attachKey2click(i.createElement("span",{className:e,onClick:e=>{this.props.allowBubble||e.stopPropagation(),this.props.click()},title:this.props.title},i.createElement(r.SvgIcon,{size:"auto",iconName:this.props.iconName}))))}}r.ReactElementFactory.Instance.registerElement("svc-action-button",e=>i.createElement(C,e));class N extends i.Component{render(){return i.createElement("div",{className:"svc-carry-forward-panel-wrapper"},i.createElement("div",{className:"svc-carry-forward-panel"},i.createElement("span",null,this.props.text," "),i.createElement("span",{className:"svc-carry-forward-panel__link"},i.createElement(C,{click:()=>this.props.onClick(),text:this.props.actionText}))))}}r.ReactElementFactory.Instance.registerElement("svc-question-banner",e=>i.createElement(N,e));class S extends y{constructor(e){super(e)}createQuestionViewModel(e){return new n.QuestionDropdownAdornerViewModel(e.componentData,e.question,null)}get dropdownModel(){return this.model}get question(){return this.dropdownModel.question}renderElementPlaceholder(){const e=this.question.textStyle;return i.createElement("div",{className:"svc-question__dropdown-choices--wrapper"},i.createElement("div",null,i.createElement("div",{className:"svc-question__dropdown-choices"},(this.dropdownModel.getRenderedItems()||[]).map((t,n)=>i.createElement("div",{className:this.dropdownModel.getChoiceCss(),key:`editable_choice_${n}`},r.ReactSurveyElementsWrapper.wrapItemValue(this.question.survey,r.ReactElementFactory.Instance.createElement(this.dropdownModel.itemComponent,{key:t.value,question:this.question,cssClasses:this.question.cssClasses,isDisplayMode:!0,item:t,textStyle:e,index:n,isChecked:this.question.value===t.value}),this.question,t)))),this.dropdownModel.needToCollapse?r.ReactElementFactory.Instance.createElement("sv-action-bar-item",{item:this.dropdownModel.collapseAction}):null))}}r.ReactElementFactory.Instance.registerElement("svc-dropdown-question",e=>i.createElement(S,e));class x extends y{createQuestionViewModel(e){return new n.QuestionImageAdornerViewModel(e.componentData,e.question,null)}get imageModel(){return this.model}renderHeader(){return i.createElement(i.Fragment,null,i.createElement("input",{type:"file","aria-hidden":"true",tabIndex:-1,accept:this.imageModel.acceptedTypes,className:"svc-choose-file-input",style:{position:"absolute",opacity:0,width:"1px",height:"1px",overflow:"hidden"}}),super.renderHeader())}renderLoadingPlaceholder(){return i.createElement("div",{className:"svc-image-question__loading-placeholder"},i.createElement("div",{className:"svc-image-question__loading"},i.createElement(r.LoadingIndicatorComponent,null)))}renderChooseButton(){return i.createElement(r.SurveyActionBar,{model:this.imageModel.imageActionsContainer})}renderElementPlaceholder(){return this.imageModel.isUploading?this.renderLoadingPlaceholder():this.renderChooseButton()}getStateElements(){return[this.model,this.imageModel.filePresentationModel]}renderElementContent(){if(this.imageModel.isEmptyElement){const e=r.ReactQuestionFactory.Instance.createQuestion("file",{creator:this.imageModel.question.survey,isDisplayMode:!1,question:this.imageModel.filePresentationModel});return i.createElement(i.Fragment,null,e)}return i.createElement(i.Fragment,null,this.props.element,this.renderElementPlaceholder())}}r.ReactElementFactory.Instance.registerElement("svc-image-question",e=>i.createElement(x,e));class f extends p{createModel(e){this.modelValue=this.createQuestionViewModel(e)}createQuestionViewModel(e){return new n.QuestionRatingAdornerViewModel(e.componentData,e.question,null)}getUpdatedModelProps(){return["question","componentData"]}get ratingModel(){return this.model}get model(){return this.modelValue}getStateElement(){return this.model}renderElement(){const e=this.ratingModel;return i.createElement(i.Fragment,null,i.createElement("div",{className:"svc-rating-question-content"},i.createElement(r.SurveyActionBar,{model:e.rateActionsContainer}),this.props.element))}}r.ReactElementFactory.Instance.registerElement("svc-rating-question",e=>i.createElement(f,e)),r.ReactElementFactory.Instance.registerElement("svc-rating-question-content",e=>i.createElement(f,e));class I extends y{createQuestionViewModel(e){return new n.QuestionAdornerViewModel(e.componentData,e.question,null)}get widgetModel(){return this.model}renderElementContent(){return i.createElement("div",{className:"svc-widget__content"},this.props.element)}}r.ReactElementFactory.Instance.registerElement("svc-widget-question",e=>i.createElement(I,e));class w extends p{createModel(e){this.model=new n.QuestionAdornerViewModel(e.componentData,e.question,null)}getStateElement(){return this.model}getUpdatedModelProps(){return["question","componentData"]}render(){return i.createElement(i.Fragment,null,i.createElement("div",{"data-sv-drop-target-survey-element":this.model.element.name,className:"svc-question__adorner"},i.createElement("div",{className:" svc-question__content--in-popup svc-question__content"},this.props.element)))}}r.ReactElementFactory.Instance.registerElement("svc-cell-question",e=>i.createElement(w,e));class R extends p{createModel(e){this.model=new n.QuestionAdornerViewModel(e.componentData,e.question,null)}getUpdatedModelProps(){return["question","componentData"]}getStateElement(){return this.model}render(){const e=this.props.question,t=this.props.question.textStyle;return i.createElement(i.Fragment,null,i.createElement("div",{"data-sv-drop-target-survey-element":this.model.element.name,className:"svc-question__adorner"},i.createElement("div",{className:" svc-question__content--in-popup svc-question__content"},this.props.element,i.createElement("div",{className:"svc-question__dropdown-choices"},e.visibleChoices.map((n,s)=>i.createElement("div",{className:"svc-question__dropdown-choice",key:`editable_choice_${s}`},r.ReactSurveyElementsWrapper.wrapItemValue(e.survey,r.ReactElementFactory.Instance.createElement("survey-radiogroup-item",{question:e,cssClasses:e.cssClasses,isDisplayMode:!0,item:n,textStyle:t,index:s,isChecked:e.value===n.value}),e,n)))))))}}r.ReactElementFactory.Instance.registerElement("svc-cell-dropdown-question",e=>i.createElement(R,e));class M extends p{createModel(e){this.model&&this.model.dispose(),this.model=new n.TranslationDropdownViewModel(e.question,e.componentData?e.componentData.translation:void 0)}getUpdatedModelProps(){return["question","componentData"]}getStateElement(){return this.model}componentWillUnmount(){super.componentWillUnmount(),this.model.dispose()}renderElement(){const e=this.props.question,t=this.props.question.textStyle;return i.createElement(i.Fragment,null,this.props.element,i.createElement("div",{className:"st-dropdown-choices--wrapper"},i.createElement("div",{className:"svc-question__dropdown-choices"},this.model.getRenderedItems().map((n,s)=>i.createElement("div",{className:this.model.getChoiceCss(),key:`translation_choice_${s}`},r.ReactElementFactory.Instance.createElement(this.model.itemComponent,{question:e,cssClasses:e.cssClasses,isDisplayMode:!0,item:n,textStyle:t,index:s,isChecked:!1})))),this.model.needToCollapse?r.ReactElementFactory.Instance.createElement("sv-action-bar-item",{item:this.model.collapseAction}):null))}}r.ReactElementFactory.Instance.registerElement(n.translationDropdownComponentName,e=>i.createElement(M,e));const q=i.memo(({page:e,survey:t,creator:n})=>i.createElement(r.SurveyPage,{page:e,survey:t,creator:n}));q.displayName="PageElementContent";class D extends p{constructor(e){super(e),this.rootRef=i.createRef()}createModel(e){var t;this.model&&this.model.dispose(),this.model=this.createPageAdorner(e.creator,e.page),this.model.isGhost=this.props.isGhost,(null===(t=this.rootRef)||void 0===t?void 0:t.current)&&this.model.attachToUI(e.page,this.rootRef.current)}createPageAdorner(e,t){return new n.PageAdorner(e,t)}shouldComponentUpdate(e,t){const r=super.shouldComponentUpdate(e,t);return this.model&&(this.model.isGhost=this.props.isGhost),r}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.model.attachToUI(this.props.page,this.rootRef.current)}getUpdatedModelProps(){return["creator","page"]}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.attachToUI(this.props.page,this.rootRef.current),this.model.isGhost=this.props.isGhost}componentWillUnmount(){super.componentWillUnmount(),this.model.detachFromUI()}canRender(){return super.canRender()}renderElement(){return this.props.page?r.attachKey2click(i.createElement("div",{ref:this.rootRef,id:this.props.page.id,"data-sv-drop-target-survey-page":this.model.dropTargetName,className:"svc-page__content "+this.model.css,onClick:e=>this.model.select(this.model,new E(e)),onDoubleClick:e=>this.model.dblclick(e.nativeEvent),onMouseLeave:e=>this.model.hover(e.nativeEvent,e.currentTarget),onMouseOver:e=>this.model.hover(e.nativeEvent,e.currentTarget)},i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--top"}),i.createElement("div",{className:"svc-question__drop-indicator svc-question__drop-indicator--bottom"}),this.renderContent(),this.renderPlaceholder(),this.renderHeader(),this.renderFooter())):null}renderPlaceholder(){return this.model.showPlaceholder?i.createElement("div",{className:"svc-page__placeholder_frame"},i.createElement("div",{className:"svc-panel__placeholder_frame"},i.createElement("div",{className:"svc-panel__placeholder"},this.model.placeholderText))):null}renderContent(){return this.model.needRenderContent?i.createElement(q,{page:this.props.page,survey:this.props.survey,creator:this.props.creator}):i.createElement("div",{className:"svc-page__loading-content"},i.createElement(r.LoadingIndicatorComponent,null))}renderHeader(){const e=i.createElement("div",{className:"svc-page__content-actions"},i.createElement(r.SurveyActionBar,{model:this.model.actionContainer}),this.model.topActionContainer.hasActions?i.createElement(r.SurveyActionBar,{model:this.model.topActionContainer}):null);return this.model.isGhost||!this.model.allowDragging?e:i.createElement("div",{className:"svc-question__drag-area",onPointerDown:e=>this.model.onPointerDown(e)},i.createElement(r.SvgIcon,{className:"svc-question__drag-element",size:"auto",iconName:"icon-drag-area-indicator_24x16"}),e)}renderFooter(){return i.createElement(r.SurveyActionBar,{model:this.model.footerActionsBar})}}r.ReactElementFactory.Instance.registerElement("svc-page",e=>i.createElement(D,e));class T extends r.SurveyElementBase{get model(){return this.item.data}get item(){return this.props.item}getStateElement(){return this.item}renderTypeSelector(){return i.createElement("div",{className:this.item.cssClasses.itemTypeSelector},r.ReactElementFactory.Instance.createElement("sv-action-bar-item-dropdown",{item:this.model.questionTypeSelectorModel}))}renderElement(){return i.createElement(i.Fragment,null,r.attachKey2click(i.createElement("div",{className:this.item.getActionBarItemCss(),onClick:e=>{e.stopPropagation(),this.model.addNewQuestion(this.model,new E(e))},onMouseOver:e=>this.model.hoverStopper&&this.model.hoverStopper(e.nativeEvent,e.currentTarget)},i.createElement("span",{className:this.item.getActionBarItemTitleCss()},this.model.addNewQuestionText),this.renderTypeSelector())))}}r.ReactElementFactory.Instance.registerElement("svc-add-new-question-btn",e=>i.createElement(T,e));class F extends y{renderElementPlaceholder(){return this.model.isEmptyElement?i.createElement("div",{className:"svc-panel__placeholder_frame-wrapper"},i.createElement("div",{className:"svc-panel__placeholder_frame"},i.createElement("div",{className:"svc-panel__placeholder"},this.model.placeholderText),this.model.showAddQuestionButton?i.createElement(r.SurveyActionBar,{model:this.model.addQuestionActionsContainer}):null)):null}disableTabStop(){return!0}createQuestionViewModel(e){return new n.PanelAdornerViewModel(e.componentData,e.question,null)}renderFooter(){return i.createElement(i.Fragment,null,!this.model.isEmptyElement&&this.model.element.isPanel&&this.model.showAddQuestionButton?i.createElement(r.SurveyActionBar,{model:this.model.addQuestionActionsContainer,handleClick:!1}):null,super.renderFooter())}}r.ReactElementFactory.Instance.registerElement("svc-panel",e=>i.createElement(F,e));class B extends p{constructor(e){super(e),this.rootRef=i.createRef()}createModel(e){let t=null;this.model&&(t=this.model.root),this.model=new n.LogoImageViewModel(e.data,t)}getUpdatedModelProps(){return["data"]}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.root=this.rootRef.current}renderButtons(){return i.createElement(r.SurveyActionBar,{model:this.model.actionsContainer})}renderImage(){return i.createElement("div",{className:this.model.containerCss},this.renderButtons(),i.createElement(r.LogoImage,{data:this.props.data.survey}))}renderPlaceHolder(){return this.model.allowEdit&&!this.model.isUploading?r.attachKey2click(i.createElement("div",{className:"svc-logo-image-placeholder",onClick:()=>this.model.chooseFile(this.model)},i.createElement("svg",null,i.createElement("use",{xlinkHref:"#icon-image-48x48"})))):null}renderInput(){return i.createElement("input",{"aria-hidden":"true",type:"file",tabIndex:-1,accept:this.model.acceptedTypes,className:"svc-choose-file-input"})}renderLoadingIndicator(){return i.createElement("div",{className:"svc-logo-image__loading"},i.createElement(r.LoadingIndicatorComponent,null))}render(){let e=null;return e=this.model.survey.locLogo.renderedHtml&&!this.model.isUploading?this.renderImage():this.model.isUploading?this.renderLoadingIndicator():this.renderPlaceHolder(),i.createElement("div",{ref:this.rootRef,className:"svc-logo-image"},this.renderInput(),e)}}r.ReactElementFactory.Instance.registerElement("svc-logo-image",e=>i.createElement(B,e));class k extends r.SurveyQuestionElementBase{get question(){return this.questionBase}renderClear(){const e=this.questionBase.showClear;return!this.questionBase.isReadOnly&&e?i.createElement(C,{classes:this.question.linkClearButtonCssClasses,click:()=>this.question.doClearClick(),text:n.editorLocalization.getString("pe.clear")}):null}renderElement(){return i.createElement(i.Fragment,null,i.createElement(C,{classes:this.question.linkSetButtonCssClasses,click:()=>this.question.doLinkClick(),selected:this.question.isSelected,disabled:!this.question.isClickable,text:this.question.linkValueText,title:this.question.tooltip,iconName:this.question.iconName}),this.renderClear())}}r.ReactQuestionFactory.Instance.registerQuestion("linkvalue",e=>i.createElement(k,e));class P extends r.SurveyQuestionElementBase{constructor(){super(...arguments),this.rootRef=i.createRef()}get embeddedSurvey(){const e=this.props.element||this.props.question;if(!e)return null;const t=e.embeddedSurvey;return t&&t.currentPage?t:null}get creator(){return this.props.creator}componentDidMount(){super.componentDidMount(),this.embeddedSurvey&&(this.embeddedSurvey.rootElement=this.rootRef.current)}render(){const e=this.embeddedSurvey;return e?i.createElement("div",{style:{display:"contents"},ref:this.rootRef},i.createElement(r.SurveyPage,{survey:e,page:e.currentPage,css:e.css,creator:this.creator})):null}}r.ReactQuestionFactory.Instance.registerQuestion("embeddedsurvey",e=>i.createElement(P,e));class U extends i.Component{get survey(){return this.props.survey}createQuestionElement(e){return r.ReactQuestionFactory.Instance.createQuestion(!e.isDefaultRendering||e.isDefaultRendering()?e.getTemplate():e.getComponentName(),{question:e,isDisplayMode:e.isInputReadOnly,creator:this})}questionTitleLocation(){return this.survey.questionTitleLocation}questionErrorLocation(){return this.survey.questionErrorLocation}renderError(e,t,r){return null}render(){const e=this.survey.getAllQuestions()[0];return i.createElement("div",{style:this.props.style},i.createElement(r.SurveyQuestion,{creator:this,element:e}))}}r.ReactElementFactory.Instance.registerElement("svc-question-editor-content",e=>i.createElement(U,e));class A extends p{constructor(e){super(e),this.onBlur=e=>{this.model.onFocusOut(e.nativeEvent)},this.rootRef=i.createRef()}createModel(e){this.model=new n.ItemValueWrapperViewModel(e.componentData.creator,e.question,e.item)}getUpdatedModelProps(){return["question","item"]}getStateElement(){return this.model}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.props.item.setRootElement(this.rootRef.current),e.item!==this.props.item&&e.item&&e.item.setRootElement(void 0)}componentDidMount(){super.componentDidMount(),this.props.item.setRootElement(this.rootRef.current)}componentWillUnmount(){super.componentWillUnmount(),this.props.item.setRootElement(void 0)}renderButton(e){return r.ReactElementFactory.Instance.createElement("sv-action-bar-item",{item:e})}render(){this.model.item=this.props.item;const e=this.model.allowAdd?this.renderButton(this.model.addAction):i.createElement(i.Fragment,null," ",this.model.isDraggable?i.createElement("span",{className:"svc-item-value-controls__drag"},i.createElement(r.SvgIcon,{className:"svc-item-value-controls__drag-icon",size:"auto",iconName:"icon-drag-24x24",title:this.model.dragTooltip})):null,this.model.allowRemove?this.renderButton(this.model.removeAction):null),t=this.props.element.key+(this.model.allowAdd?"_new":"");return i.createElement(i.Fragment,null,i.createElement("div",{ref:this.rootRef,className:"svc-item-value-wrapper"+(this.model.allowAdd?" svc-item-value--new":"")+(this.model.isDragging?" svc-item-value--dragging":"")+(this.model.isDragDropGhost?" svc-item-value--ghost":"")+(this.model.isDragDropMoveDown?" svc-item-value--movedown":"")+(this.model.isDragDropMoveUp?" svc-item-value--moveup":""),key:t,"data-sv-drop-target-item-value":this.model.isDraggable?this.model.item.value:void 0,onPointerDown:e=>this.model.onPointerDown(e)},i.createElement("div",{className:"svc-item-value__ghost"}),i.createElement("div",{className:"svc-item-value-controls",onBlur:this.onBlur},e),i.createElement("div",{className:"svc-item-value__item",onClick:e=>this.model.select(this.model,e.nativeEvent)},this.props.element),this.renderPanelAction()),this.renderPanel())}renderPanelAction(){if(!this.model.canShowPanel())return null;const e=this.renderButton(this.model.expandPanelAction);return i.createElement("div",{className:"svc-item-value-controls svc-choice-elements-button-container"},e)}renderPanel(){if(!this.model.renderedShowPanel)return null;const e=this.model.creator,t=e.survey;return i.createElement(L,{element:this.model.item.panel,survey:t,creator:e,css:t.getCss()})}}const L=i.memo(({element:e,survey:t,creator:n,css:s})=>i.createElement(r.SurveyPanel,{element:e,survey:t,creator:n,cssClasses:s}));L.displayName="ChoiceItemPanel",r.ReactElementFactory.Instance.registerElement("svc-item-value",e=>i.createElement(A,e));class V extends p{constructor(e){super(e),this.preventDragHandler=e=>{e.preventDefault()},this.rootRef=i.createRef()}createModel(e){this.model=new n.ImageItemValueWrapperViewModel(e.componentData.creator,e.question,e.item,null,null)}getUpdatedModelProps(){return["question","item"]}getStateElement(){return this.model}get question(){return this.props.question}componentDidMount(){super.componentDidMount(),this.model.itemsRoot=this.rootRef.current}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.model.itemsRoot=this.rootRef.current}renderLoadingIndicator(){return i.createElement("div",{className:"svc-image-item-value__loading"},i.createElement(r.LoadingIndicatorComponent,null))}renderNewItemControls(){const e=i.createElement(r.SurveyActionBar,{model:this.model.actionsContainer}),t=this.model.showPlaceholder?i.createElement("span",{className:"svc-image-item-value__placeholder"},this.model.placeholderText):null;return i.createElement(i.Fragment,null,t,e)}render(){this.model.item=this.props.item;const e=!this.props.question.isItemInList(this.props.item);this.model.isNew=e;const t=this.model.getIsNewItemSingle()?null:{width:this.question.renderedImageWidth,height:this.question.renderedImageHeight};let n=null;return n=e||this.model.isUploading?i.createElement(i.Fragment,null,i.createElement("div",{className:"svc-image-item-value__item"},i.createElement("div",{className:"sd-imagepicker__item sd-imagepicker__item--inline"},i.createElement("label",{className:"sd-imagepicker__label"},i.createElement("div",{style:t,className:"sd-imagepicker__image"},this.model.isUploading?this.renderLoadingIndicator():null)))),this.model.allowAdd&&!this.model.isUploading?i.createElement("div",{className:"svc-image-item-value-controls"},this.renderNewItemControls()):null):i.createElement(i.Fragment,null,i.createElement("div",{className:"svc-image-item-value__item"},this.props.element),this.model.canRenderControls?i.createElement(r.SurveyActionBar,{model:this.model.topActionsContainer}):null),i.createElement("div",{ref:this.rootRef,className:this.model.getRootCss(),key:this.props.element.key,"data-sv-drop-target-item-value":this.model.isDraggable?this.model.item.value:void 0,onPointerDown:e=>this.model.onPointerDown(e),onDragStart:this.preventDragHandler,onDrop:this.model.onDrop,onDragEnter:this.model.onDragEnter,onDragOver:this.model.onDragOver,onDragLeave:this.model.onDragLeave},i.createElement("div",{className:"svc-image-item-value-wrapper__ghost",style:t}),i.createElement("div",{className:"svc-image-item-value-wrapper__content"},i.createElement("input",{type:"file","aria-hidden":"true",tabIndex:-1,accept:this.model.acceptedTypes,className:"svc-choose-file-input",style:{position:"absolute",opacity:0,width:"1px",height:"1px",overflow:"hidden"}}),n))}}class Q extends r.SurveyElementBase{renderElement(){return i.createElement("span",{className:this.props.item.getActionBarItemCss(),onPointerDown:e=>this.props.item.data.model.onPointerDown(e)},i.createElement(r.SvgIcon,{size:"auto",iconName:this.props.item.iconName,className:this.props.item.cssClasses.itemIcon}))}}r.ReactElementFactory.Instance.registerElement("svc-image-item-drag-action",e=>i.createElement(Q,e)),r.ReactElementFactory.Instance.registerElement("svc-image-item-value",e=>i.createElement(V,e));class H extends p{createModel(e){var t;const r=e.componentData;let s=!1;this.model&&(s=this.model.isSelected),this.model=new n.MatrixCellWrapperViewModel(r.creator,r.element,r.question,r.row,r.column||(null===(t=r.element.cell)||void 0===t?void 0:t.column)),this.model.isSelected=s}getUpdatedModelProps(){return["componentData"]}componentDidUpdate(e,t){var r,n;super.componentDidUpdate(e,t);const s=this.props.componentData;this.model.templateData=s.element,this.model.row=s.row,this.model.column=s.column||(null===(n=null===(r=s.element)||void 0===r?void 0:r.cell)||void 0===n?void 0:n.column),this.model.question=s.question}getStateElement(){return this.model}render(){let e=null;return this.model.isSupportCellEditor&&(e=i.createElement("div",{className:"svc-matrix-cell__question-controls"},r.ReactElementFactory.Instance.createElement("sv-action-bar-item",{item:this.model.editAction}))),i.createElement("div",{className:"svc-matrix-cell",tabIndex:-1,key:this.props.element.key,onClick:e=>!this.props.question&&this.model.selectContext(this.model,e),onMouseOut:e=>this.model.hover(e.nativeEvent,e.currentTarget),onMouseOver:e=>this.model.hover(e.nativeEvent,e.currentTarget)},i.createElement("div",{className:"svc-matrix-cell--selected"+(this.model.isSelected?" svc-visible":"")}),this.props.element,e)}}r.ReactElementFactory.Instance.registerElement("svc-matrix-cell",e=>i.createElement(H,e));class W extends p{createModel(e){this.props.survey&&(this.model=new n.SurveyResultsModel(e.survey))}getUpdatedModelProps(){return["survey"]}getStateElement(){return this.model}render(){return this.model?i.createElement("div",{className:"svd-test-results"},i.createElement("div",{className:"svd-test-results__content"},i.createElement("div",{className:"svd-test-results__header"},i.createElement("div",{className:"svd-test-results__header-text"},this.model.surveyResultsText),i.createElement("div",{className:"svd-test-results__header-types"},i.createElement(C,{click:()=>this.model.selectTableClick(),text:this.model.surveyResultsTableText,selected:this.model.isTableSelected,disabled:!1}),i.createElement(C,{click:()=>this.model.selectJsonClick(),text:this.model.surveyResultsJsonText,selected:this.model.isJsonSelected,disabled:!1}))),this.renderResultAsText(),this.renderResultAsTable())):null}renderResultAsText(){return"text"!==this.model.resultViewType?null:i.createElement("div",{className:"svd-test-results__text svd-light-bg-color"},i.createElement("div",null,this.model.resultText))}renderResultAsTable(){return"table"!==this.model.resultViewType?null:i.createElement("div",{className:"svd-test-results__table svd-light-bg-color"},i.createElement("table",null,i.createElement("thead",null,i.createElement("tr",{className:"svd-light-background-color"},i.createElement("th",{key:1,className:"svd-dark-border-color"},this.model.resultsTitle),i.createElement("th",{key:2,className:"svd-dark-border-color"},this.model.resultsDisplayValue))),i.createElement("tbody",null,W.renderRows(this.model.resultData))))}static renderRows(e){const t=[];for(var r=0;r<e.length;r++)t.push(i.createElement(O,{key:r+1,row:e[r]}));return t}}class O extends p{get row(){return this.props.row}getStateElement(){return this.row}render(){return i.createElement(i.Fragment,null,r.attachKey2click(i.createElement("tr",{onClick:()=>this.row.toggle()},i.createElement("td",{key:1,style:{paddingLeft:this.row.textMargin},className:"svd-dark-border-color"},this.row.isNode?i.createElement("span",{style:{left:this.row.markerMargin},className:"svd-test-results__marker "+(this.row.collapsed?"":"svd-test-results__marker--expanded")},i.createElement(r.SvgIcon,{iconName:"icon-expand_16x16",size:16})):null,this.row.question?i.createElement(r.SurveyLocStringViewer,{model:this.row.question.locTitle}):i.createElement("span",null,this.row.title)),i.createElement("td",{key:2,className:this.row.isNode?"svd-test-results__node-value":"svd-dark-border-color"},this.row.getString(this.row.displayValue)))),this.row.isNode&&!this.row.collapsed?W.renderRows(this.row.data):null)}}class j extends p{constructor(e){super(e),this.rootRef=i.createRef()}createModel(e){this.model=new n.ToolboxToolViewModel(e.item,e.creator,e.parentModel)}getUpdatedModelProps(){return["creator","item"]}get item(){return this.props.item}get creator(){return this.props.creator}get isCompact(){return this.props.isCompact}getStateElement(){return this.item}render(){const e=this.item,t=r.ReactElementFactory.Instance.createElement(this.model.itemComponent,{item:e,creator:this.creator,parentModel:this.creator.toolbox,model:this.model,isCompact:this.isCompact});return i.createElement("div",{className:e.css,key:e.id,ref:this.rootRef},e.needSeparator&&!this.creator.toolbox.showCategoryTitles?i.createElement("div",{className:"svc-toolbox__category-separator"}):null,i.createElement("div",{className:"svc-toolbox__tool-content",onPointerDown:e=>{e.persist(),this.model.onPointerDown(e)}},t))}componentWillUnmount(){super.componentWillUnmount(),this.item.updateModeCallback=void 0}componentDidMount(){super.componentDidMount(),this.item.updateModeCallback=(e,t)=>{queueMicrotask(()=>{l.flushSync?l.flushSync(()=>{this.item.mode=e}):this.item.mode=e,queueMicrotask(()=>{t(e,this.rootRef.current)})})},this.item.afterRender()}}class K extends p{constructor(e){super(e)}getUpdatedModelProps(){return["creator","item"]}get item(){return this.props.item}get creator(){return this.props.creator}get model(){return this.props.model}getStateElement(){return this.model}render(){const e=this.props.isCompact?i.createElement("span",{className:"svc-toolbox__item-banner",onClick:e=>{e.persist(),this.model.click(e)}},i.createElement(r.SvgIcon,{size:"auto",iconName:this.item.iconName,className:"svc-toolbox__item-icon",title:this.item.getTooltip()}),i.createElement("span",null,this.item.title)):null,t=r.attachKey2click(i.createElement("div",{className:this.item.renderedCss,tabIndex:0,role:"button","aria-label":this.item.getTooltip(),onClick:e=>{e.persist(),this.model.click(e)}},i.createElement("span",{className:"svc-toolbox__item-container"},this.item.iconName?i.createElement(r.SvgIcon,{size:"auto",iconName:this.item.iconName,className:"svc-toolbox__item-icon"}):null),this.props.isCompact?null:i.createElement("span",{className:"svc-toolbox__item-title"},this.item.title)),void 0,{disableTabStop:!this.model.toolboxItem.enabled});return i.createElement(i.Fragment,null,t,e)}}r.ReactElementFactory.Instance.registerElement("svc-toolbox-item",e=>t.createElement(K,e));class z extends p{constructor(e){super(e)}getUpdatedModelProps(){return["creator","item"]}get item(){return this.props.item}get model(){return this.props.model}get creator(){return this.props.creator}get isCompact(){return this.props.isCompact}get parentModel(){return this.props.parentModel}getStateElement(){return this.item}render(){return i.createElement(i.Fragment,null,i.createElement(K,{item:this.item,creator:this.creator,model:this.model,parentModel:this.parentModel,isCompact:this.isCompact}),i.createElement("div",{className:"svc-toolbox__item-submenu-button",onMouseOver:e=>this.model.onMouseOver(this.item,e),onMouseLeave:e=>this.model.onMouseLeave(this.item,e)},i.createElement(r.SvgIcon,{size:"auto",iconName:this.item.subitemsButtonIcon}),i.createElement(r.Popup,{model:this.item.popupModel})))}}r.ReactElementFactory.Instance.registerElement("svc-toolbox-item-group",e=>i.createElement(z,e));class G extends r.SurveyElementBase{get category(){return this.props.category}get toolbox(){return this.props.toolbox}get class(){return"svc-toolbox__category"+(this.category.collapsed?" svc-toolbox__category--collapsed":"")+(this.category.empty?" svc-toolbox__category--empty":"")}getStateElement(){return this.category}render(){const e=this.renderCategoryHeader(),t=this.renderCategoryContent();return i.createElement("div",{className:this.class,key:this.category.name},i.createElement("div",{className:"svc-toolbox__category-header-wrapper"},e),t)}renderCategoryHeader(){let e="svc-toolbox__category-header";this.toolbox.canCollapseCategories&&(e+=" svc-toolbox__category-header--collapsed");const t=this.renderLocString(this.category.locTitle);return r.attachKey2click(i.createElement("div",{className:e,onClick:e=>this.category.toggleState()},i.createElement("span",{className:"svc-toolbox__category-title"},t),this.renderButton()))}renderButton(){if(!this.toolbox.canCollapseCategories)return null;const e=this.category.iconName;return i.createElement("div",{className:"svc-toolbox__category-header__controls"},i.createElement(r.SvgIcon,{className:this.category.iconClassName,iconName:e,size:"auto"}))}renderCategoryContent(){return this.renderItems(this.category.items)}renderItems(e,t=!1){return e.map((e,r)=>i.createElement(j,{item:e,creator:this.toolbox.creator,parentModel:this.toolbox,isCompact:t,key:"item"+r}))}}r.ReactElementFactory.Instance.registerElement("svc-toolbox-category",e=>i.createElement(G,e));class J extends r.SurveyElementBase{constructor(e){super(e)}get model(){return this.props.model}get creator(){return this.props.creator}getStateElement(){return this.model}render(){if(!this.model||!this.model.renderElements)return null;const e=this.renderItems();return i.createElement("div",{className:this.model.cssClasses.root},e)}renderItems(){return this.model.renderedActions.map((e,t)=>i.createElement(j,{item:e,creator:this.creator,parentModel:this.model,isCompact:!1,key:"item"+t}))}}r.ReactElementFactory.Instance.registerElement("svc-toolbox-list",e=>i.createElement(J,e));class X extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}constructor(e){super(e),this.state={filterString:this.model.filterString||""}}renderElement(){if(!this.model.isVisible)return null;return i.createElement("div",{className:"svc-search"},i.createElement("div",{className:"svc-search__search-icon"},i.createElement(r.SvgIcon,{iconName:"icon-search",size:"auto"})),i.createElement("input",{type:"text",className:"svc-search__input","aria-label":this.model.filterStringPlaceholder,placeholder:this.model.filterStringPlaceholder,value:this.state.filterString,onChange:e=>{const t=e.target,r=(null==t?void 0:t.getRootNode())||o.settings.environment.root;(r instanceof Document||r instanceof ShadowRoot)&&t===r.activeElement&&(this.model.filterString=t.value)},tabIndex:this.model.getTabIndex()}),i.createElement("div",{className:"svc-search__toolbar"},i.createElement("div",{className:"svc-search__toolbar-counter"},this.model.matchCounterText),i.createElement(r.SurveyActionBar,{model:this.model.searchActionBar})))}}r.ReactElementFactory.Instance.registerElement("svc-search",e=>i.createElement(X,e));class Y extends r.SurveyElementBase{constructor(e){super(e),this.rootRef=i.createRef()}componentDidUpdate(e,t){super.componentDidUpdate(e,t);const r=this.rootRef.current;r&&this.toolbox.afterRender(r)}componentDidMount(){super.componentDidMount();const e=this.rootRef.current;e&&this.toolbox.afterRender(e)}componentWillUnmount(){this.toolbox.beforeDestroy(),super.componentWillUnmount()}get creator(){return this.props.model}get toolbox(){return this.creator.toolbox}getStateElement(){return this.toolbox}renderItems(e,t=!1){return e.map((e,r)=>i.createElement(j,{item:e,creator:this.creator,parentModel:this.toolbox,isCompact:t,key:e.renderedId}))}renderCategories(){return this.toolbox.categories.map((e,t)=>r.ReactElementFactory.Instance.createElement("svc-toolbox-category",{category:e,toolbox:this.toolbox,key:"category"+t}))}renderSearch(){const e=this.toolbox.isCompactRendered?i.createElement(i.Fragment,null,i.createElement(j,{item:this.toolbox.searchItem,creator:this.creator,parentModel:this.toolbox,isCompact:this.toolbox.isCompactRendered,key:"searchitem"})):null;return i.createElement("div",{className:"svc-toolbox__search-container"},e,i.createElement(X,{model:this.toolbox.searchManager}),i.createElement("div",{className:"svc-toolbox__category-separator svc-toolbox__category-separator--search"}))}render(){const e=this.toolbox.showSearch?this.renderSearch():null,t=this.toolbox.showPlaceholder?i.createElement("div",{className:"svc-toolbox__placeholder"},this.toolbox.toolboxNoResultsFound):null;return i.createElement("div",{ref:this.rootRef,className:this.toolbox.classNames,style:this.toolbox.getRootStyle()},i.createElement("div",{onBlur:e=>this.toolbox.focusOut(e),className:"svc-toolbox__panel"},e,t,i.createElement(r.Scroll,null,this.toolbox.showInSingleCategory?i.createElement("div",{className:"svc-toolbox__category"},this.renderItems(this.toolbox.renderedActions,this.toolbox.isCompactRendered)):this.renderCategories())))}}r.ReactElementFactory.Instance.registerElement("svc-toolbox",e=>i.createElement(Y,e));class Z extends r.SurveyElementBase{constructor(){super(...arguments),this.onPropChangedHandler=(e,t)=>{if(this.isRendering)return;const r=["showProgressBar","progressBarType","currentPageValue"];if(!(r.indexOf(t.name)<0)){for(var n={},s=0;s<r.length;s++){var o=r[s];n[o]=this.survey[o]}this.setState(n)}}}componentDidMount(){super.componentDidMount(),this.setHandler()}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.setHandler()}setHandler(){this.survey&&!this.survey.onPropertyChanged.hasFunc(this.onPropChangedHandler)&&this.survey.onPropertyChanged.add(this.onPropChangedHandler)}componentWillUnmount(){super.componentWillUnmount(),this.survey&&this.survey.onPropertyChanged.remove(this.onPropChangedHandler)}get survey(){return this.props.survey}get location(){return this.props.location}get isTop(){return"top"==this.location}canRender(){return this.isTop?this.survey.isShowProgressBarOnTop:this.survey.isShowProgressBarOnBottom}renderElement(){return r.ReactElementFactory.Instance.createElement(this.survey.getProgressTypeComponent(),{survey:this.survey,css:this.survey.css,isTop:this.isTop})}}class $ extends r.SurveyElementBase{constructor(e){super(e)}getStateElement(){return this.props.model}renderElement(){if(!this.props.model.visible)return null;const e=r.ReactElementFactory.Instance.createElement(this.props.model.component||"sv-action-bar-item",{item:this.props.model});return i.createElement("div",{className:"svc-sidebar-tabs__item"},e)}}class ee extends r.SurveyElementBase{constructor(e){super(e)}getStateElement(){return this.props.model}canRender(){return!!this.props.model&&super.canRender()}renderElement(){return i.createElement("div",{className:this.props.model.sideBarClassName},i.createElement("div",{className:"svc-sidebar-tabs__top-container"},i.createElement("div",{className:"svc-sidebar-tabs__collapse-button"},i.createElement($,{model:this.props.model.expandCollapseAction})),i.createElement("div",{className:"svc-sidebar-tabs__separator"},i.createElement("div",null)),i.createElement(r.Scroll,null,i.createElement("div",{className:"svc-sidebar-tabs__items"},i.createElement(te,{model:this.props.model.topToolbar})))),i.createElement("div",{className:"svc-sidebar-tabs__bottom-container"},i.createElement("div",{className:"svc-sidebar-tabs__items"},i.createElement(r.SurveyActionBar,{model:this.props.model.bottomToolbar}))))}}r.ReactElementFactory.Instance.registerElement("svc-tab-control",e=>i.createElement(ee,e));class te extends r.SurveyElementBase{constructor(e){super(e)}getStateElement(){return this.props.model}renderElement(){return i.createElement(i.Fragment,null,this.props.model.actions.map((e,t)=>i.createElement($,{model:e,key:"item"+t})))}}class re extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}renderElement(){const e=this.model.title?i.createElement("div",{className:"svc-side-bar__container-title"},this.model.title):null;return i.createElement("div",{className:"svc-side-bar__container-header"},i.createElement("div",{className:"svc-side-bar__container-actions"},i.createElement(r.SurveyActionBar,{model:this.model.toolbar})),e)}}r.ReactElementFactory.Instance.registerElement("svc-side-bar-default-header",e=>i.createElement(re,e));class ne extends r.SurveyElementBase{get objectSelectionAction(){return this.props.model}getStateElement(){return this.objectSelectionAction}renderElement(){const e=r.attachKey2click(i.createElement("div",{className:this.objectSelectionAction.getActionBarItemCss()+" svc-sidebar__header-object-selector",onClick:()=>this.objectSelectionAction.action()},i.createElement("div",{className:"svc-sidebar__header-caption"},i.createElement("span",{className:"svc-sidebar__header-title"},this.objectSelectionAction.title),i.createElement("span",{className:"svc-sidebar__header-subtitle"},this.objectSelectionAction.tooltip))),this.props.model);return i.createElement("div",{className:"svc-sidebar__header svc-sidebar__header--tabbed"},i.createElement("div",{className:"svc-sidebar__header-container svc-sidebar__header-container--with-subtitle"},i.createElement("div",{className:"svc-sidebar__header-content"},e,i.createElement(r.Popup,{model:this.objectSelectionAction.popupModel}))))}}r.ReactElementFactory.Instance.registerElement("svc-side-bar-property-grid-header",e=>i.createElement(ne,e));class se extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}renderElement(){return i.createElement("div",{className:"svc-side-bar__container-header svc-sidebar__header-container"},this.model.subTitle?i.createElement("div",{className:"svc-sidebar__header-caption"},i.createElement("span",{className:"svc-sidebar__header-title"},this.model.title),i.createElement("span",{className:"svc-sidebar__header-subtitle"},this.model.subTitle)):i.createElement("div",{className:"svc-side-bar__container-title"},this.model.title))}}r.ReactElementFactory.Instance.registerElement("svc-side-bar-header",e=>i.createElement(se,e));class oe extends r.SurveyElementBase{get model(){return this.props.model}constructor(e){super(e),this.containerRef=i.createRef()}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.initResizeManager(this.containerRef.current)}componentWillUnmount(){super.componentWillUnmount(),this.model.resetResizeManager()}canRender(){return!!this.model&&super.canRender()}renderElement(){const e={display:this.model.renderRoot?"":"none"},t={display:this.model.renderContainer?"":"none"},n=this.model.pages.map(e=>i.createElement(ae,{page:e,key:e.id})),s=r.ReactElementFactory.Instance.createElement(this.model.header.component,{model:this.model.header.componentModel});let o=null;return this.model.sideAreaComponentName&&(o=r.ReactElementFactory.Instance.createElement(this.model.sideAreaComponentName,{model:this.model.sideAreaComponentData})),i.createElement("div",{className:this.model.rootCss,style:e},i.createElement("div",{className:"svc-side-bar__shadow",onClick:()=>this.model.collapseSidebar(),style:t}),i.createElement("div",{className:"svc-flex-row svc-side-bar__wrapper"},i.createElement("div",{className:"svc-side-bar__container-wrapper",style:t},i.createElement("div",{ref:this.containerRef,className:"svc-side-bar__container"},s,i.createElement("div",{className:"svc-side-bar__container-content"},n))),o))}}class ae extends r.SurveyElementBase{get page(){return this.props.page}getStateElement(){return this.page}renderElement(){if(!this.page.visible)return null;return r.ReactElementFactory.Instance.createElement(this.page.componentName,{model:this.page.componentData})}}r.ReactQuestionFactory.Instance.registerQuestion("svc-side-bar-page",e=>i.createElement(ae,e)),r.ReactElementFactory.Instance.registerElement("svc-side-bar",e=>i.createElement(oe,e));class ie extends i.Component{render(){const e=this.props.model;return e?i.createElement("div",{className:"spg-launch"},i.createElement("button",{className:"spg-launch__card",onClick:e.onClick},i.createElement("div",{className:"spg-launch__container"},i.createElement("div",{className:"spg-launch__text"},e.title),i.createElement("div",{className:"spg-launch__text2"},e.description)),i.createElement("div",{className:"spg-launch__icon"},i.createElement("div",{className:"spg-launch__chevron-right-16-x-16"},i.createElement("div",{className:"spg-launch__icon2"},i.createElement(r.SvgIcon,{size:"auto",iconName:"chevrondown-24x24"})))))):null}}r.ReactElementFactory.Instance.registerElement("svc-side-bar-launch-card",e=>i.createElement(ie,e));class le extends i.Component{render(){return i.createElement("div",{className:"sd-translation-line-skeleton"})}}r.ReactElementFactory.Instance.registerElement("sd-translation-line-skeleton",e=>i.createElement(le,e));class ce extends r.SurveyElementBase{get item(){return this.props.item}getStateElement(){return this.item}renderElement(){const e=this.item;return i.createElement("div",{className:e.data.containerCss},i.createElement("span",{className:e.data.additionalTitleCss},e.data.additionalTitle),r.ReactElementFactory.Instance.createElement("sv-action-bar-item-dropdown",{item:this.item}))}}r.ReactElementFactory.Instance.registerElement("svc-translate-from-action",e=>i.createElement(ce,e));class me extends p{constructor(e){var t;super(e),this.onChangedHandler=(e,t)=>{this.setState({changed:this.state&&this.state.changed?this.state.changed+1:1})},this.onBlur=e=>(this.svStringEditorRef.current&&(this.svStringEditorRef.current.spellcheck=!1),this.locString.__isEditing=!1,this.justFocused=!1,this.baseModel.onBlur(e.nativeEvent),this.baseModel.errorText),this.onCompositionStart=e=>{this.baseModel.onCompositionStart(e.nativeEvent)},this.onCompositionEnd=e=>{this.baseModel.onCompositionEnd(e.nativeEvent)},this.onBeforeInput=e=>{this.baseModel.onBeforeInput(e)},this.onInput=e=>{this.baseModel.onInput(e.nativeEvent)},this.onPaste=e=>{this.baseModel.onPaste(e.nativeEvent)},this.justFocused=!1,this.onFocus=e=>{this.baseModel.onFocus(e.nativeEvent),this.justFocused=!0},this.onKeyDown=e=>this.baseModel.onKeyDown(e.nativeEvent),this.onKeyUp=e=>this.baseModel.onKeyUp(e.nativeEvent),this.onMouseUp=e=>this.baseModel.onMouseUp(e.nativeEvent),this.done=e=>{this.baseModel.done(e),this.locString.__isEditing=!1},this.edit=e=>{this.svStringEditorRef.current.focus(),this.locString.__isEditing=!0,this.baseModel.onClick(e)},this.htmlValue={__html:null===(t=this.locString)||void 0===t?void 0:t.renderedHtml},this.state={changed:0},this.svStringEditorRef=i.createRef()}createModel(e){this.baseModel&&this.baseModel.dispose(),this.baseModel=new n.StringEditorViewModelBase(this.locString,this.creator)}getUpdatedModelProps(){return["creator","locString"]}get locString(){return this.props.model.locStr}get creator(){return this.props.model.creator}get style(){return this.props.style}getStateElement(){return this.baseModel}get errorText(){return this.baseModel.errorText}componentDidMount(){super.componentDidMount(),this.locString&&(this.baseModel.setLocString(this.locString),this.baseModel.getEditorElement=()=>this.svStringEditorRef.current,this.baseModel.blurEditor=()=>{this.svStringEditorRef.current.blur(),this.svStringEditorRef.current.spellcheck=!1},this.baseModel.afterRender(),this.locString.onStringChanged.add(this.onChangedHandler),this.locString.__isEditing&&this.svStringEditorRef.current.focus())}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.baseModel.setLocString(this.locString),this.baseModel.afterRender(),this.locString.onStringChanged.add(this.onChangedHandler)}componentWillUnmount(){super.componentWillUnmount(),this.baseModel.detachFromUI(),this.locString&&this.locString.onStringChanged.remove(this.onChangedHandler)}get placeholder(){return this.baseModel.placeholder}get contentEditable(){return this.baseModel.contentEditable}get className(){return this.baseModel.className(this.locString.renderedHtml)}render(){if(!this.locString)return null;let e=null;this.locString.hasHtml?(this.htmlValue.__html!==this.locString.renderedHtml&&(this.htmlValue={__html:this.locString.renderedHtml}),e=i.createElement("span",{role:"textbox",ref:this.svStringEditorRef,className:"sv-string-editor sv-string-editor--html",contentEditable:this.contentEditable,spellCheck:!1,"aria-placeholder":this.placeholder,"aria-label":this.placeholder||"content editable",suppressContentEditableWarning:!0,tabIndex:this.baseModel.tabIndex,dangerouslySetInnerHTML:this.htmlValue,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onClick:this.edit})):e=i.createElement("span",{role:"textbox",ref:this.svStringEditorRef,className:"sv-string-editor",contentEditable:this.contentEditable,tabIndex:this.baseModel.tabIndex,spellCheck:!1,"aria-placeholder":this.placeholder,"aria-label":this.placeholder||"content editable",suppressContentEditableWarning:!0,key:this.locString.renderedHtml,onBlur:this.onBlur,onBeforeInput:this.onBeforeInput,onInput:this.onInput,onPaste:this.onPaste,onCompositionStart:this.onCompositionStart,onCompositionEnd:this.onCompositionEnd,onFocus:this.onFocus,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,onMouseUp:this.onMouseUp,onClick:this.edit},this.locString.renderedHtml);const t=this.baseModel.showCharacterCounter?i.createElement(r.CharacterCounterComponent,{counter:this.baseModel.characterCounter,remainingCharacterCounter:this.baseModel.getCharacterCounterClass}):null;return i.createElement("span",{className:this.className},i.createElement("span",{className:"svc-string-editor__content"},i.createElement("div",{className:"svc-string-editor__border svc-string-editor__border--hover",onClick:this.edit}),i.createElement("div",{className:"svc-string-editor__border svc-string-editor__border--focus",onClick:this.edit}),i.createElement("span",{className:"svc-string-editor__input"},e,i.createElement("div",{className:"svc-string-editor__controls",onClick:this.edit}),t)),this.errorText?i.createElement("span",{className:"svc-string-editor__error"},this.errorText):"")}}r.ReactElementFactory.Instance.registerElement(n.editableStringRendererName,e=>i.createElement(me,e));class de extends i.Component{render(){return i.createElement("div",null,i.createElement(r.SvgIcon,{"aria-hidden":"true",iconName:"icon-alert_24x24",size:"auto",className:this.props.cssClasses.error.icon}),i.createElement("span",{className:this.props.cssClasses.error.item||void 0},i.createElement(r.SurveyLocStringViewer,{model:this.props.error.locText})))}}r.ReactElementFactory.Instance.registerElement("svc-question-error",e=>i.createElement(de,e));class ue extends r.SurveyQuestionDropdown{constructor(e){super(e)}renderInput(){const e=this.question;n.initLogicOperator(e);const t=e.locReadOnlyText?this.renderLocString(e.locReadOnlyText):"",r=this.question.dropdownListModel;return i.createElement("div",{id:this.question.inputId,className:e.getControlClass(),tabIndex:this.question.isInputReadOnly?void 0:0,disabled:this.question.isInputReadOnly,required:this.question.isRequired,onChange:this.updateValueOnEvent,onInput:this.updateValueOnEvent,onKeyUp:this.keyhandler,role:r.ariaQuestionRole,"aria-required":r.ariaQuestionRequired,"aria-invalid":r.ariaQuestionInvalid,"aria-errormessage":r.ariaQuestionErrorMessage,"aria-expanded":r.ariaQuestionExpanded,"aria-label":r.ariaQuestionLabel,"aria-labelledby":r.ariaQuestionLabelledby,"aria-controls":r.ariaQuestionControls},i.createElement("div",{className:this.question.cssClasses.controlValue},t))}renderEditorButtons(){return null}}r.ReactQuestionFactory.Instance.registerQuestion("sv-logic-operator",e=>i.createElement(ue,e)),o.RendererFactory.Instance.registerRenderer("dropdown","logicoperator","sv-logic-operator");class he extends p{constructor(e){super(e),this.containerRef=i.createRef()}createModel(e){this.model&&this.model.dispose(),this.model=new n.PageNavigatorViewModel(e.pagesController,e.pageEditMode)}getUpdatedModelProps(){return["pagesController","pageEditMode"]}getStateElement(){return this.model}componentDidMount(){super.componentDidMount();const e=this.containerRef.current;this.model.attachToUI(e)}componentWillUnmount(){super.componentWillUnmount(),this.model.stopItemsContainerHeightObserver(),this.model.setScrollableContainer(void 0)}renderElement(){return i.createElement("div",{className:"svc-page-navigator",ref:this.containerRef,style:{display:this.model.visible?"flex":"none"}},i.createElement("div",null,r.ReactElementFactory.Instance.createElement("sv-action-bar-item-dropdown",{item:this.model.selectorAction})),i.createElement("div",null,this.model.visibleItems.map(e=>i.createElement(pe,{key:e.id,item:e}))))}}class pe extends p{getStateElement(){return this.props.item}renderElement(){const e=this.props.item;let t="svc-page-navigator-item-content";return o.unwrap(e.active)&&(t+=" svc-page-navigator-item--selected"),o.unwrap(e.disabled)&&(t+=" svc-page-navigator-item--disabled"),i.createElement("div",{className:"svc-page-navigator-item"},r.attachKey2click(i.createElement("div",{role:"button",className:t,onClick:t=>{e.action(e),t.stopPropagation()}},i.createElement("div",{className:"svc-page-navigator-item__dot",title:e.title},i.createElement("div",{className:"svc-page-navigator-item__dot-content"})),i.createElement("div",{className:"svc-page-navigator-item__banner"},i.createElement("span",{className:"svc-page-navigator-item__text"},e.title),i.createElement("span",{className:"svc-page-navigator-item__dot"},i.createElement("span",{className:"svc-page-navigator-item__dot-content"}))))))}}class ve extends i.Component{constructor(e){super(e)}render(){return i.createElement("div",{className:"svc-surface-placeholder"},i.createElement("div",{className:"svc-surface-placeholder__image svc-surface-placeholder__image--"+this.props.name}),i.createElement("div",{className:"svc-surface-placeholder__text"},i.createElement("div",{className:"svc-surface-placeholder__title"},this.props.placeholderTitleText),i.createElement("div",{className:"svc-surface-placeholder__description"},this.props.placeholderDescriptionText)))}}r.ReactElementFactory.Instance.registerElement("svc-surface-placeholder",e=>i.createElement(ve,e));class Ee extends r.SurveyElementBase{constructor(){super(...arguments),this.denyUpdate=()=>{this.denyComponentUpdate()},this.allowUpdate=()=>{this.allowComponentUpdate()},this.addDragDropEvents=()=>{this.creator.onDragStart.add(this.denyUpdate),this.creator.onDragClear.add(this.allowUpdate)},this.clearDragDropEvents=()=>{this.creator.onDragStart.remove(this.denyUpdate),this.creator.onDragClear.remove(this.allowUpdate)}}get model(){return this.props.data}get creator(){return this.model.creator}componentDidMount(){super.componentDidMount(),this.addDragDropEvents()}componentWillUnmount(){super.componentWillUnmount(),this.clearDragDropEvents(),super.componentWillUnmount()}getStateElements(){return[this.model,this.model.survey,this.model.pagesController]}getRenderedPages(){const e=[];if("bypage"!==this.creator.pageEditMode){this.model.pages.forEach(t=>{e.push(this.createRenderedPage(t,"svc-page",t==this.model.newPage))})}else{const t=this.model.pagesController.page2Display;t&&e.push(this.createRenderedPage(t,"svc-page",this.model.newPage===t))}return e}createRenderedPage(e,t,r){return i.createElement(ge,{key:null==e?void 0:e.id,page:e,isGhost:r,creator:this.creator,className:t})}renderElement(){const e="svc-tab-designer "+this.model.getRootCss();return i.createElement(i.Fragment,null,i.createElement("div",{className:"svc-flex-column"},this.model.isToolboxVisible?r.ReactElementFactory.Instance.createElement("svc-toolbox",{model:this.creator}):null),i.createElement("div",{className:e,onClick:()=>this.model.clickDesigner()},i.createElement(r.Scroll,null,i.createElement("div",{className:"svc-tab-designer_content"},this.model.showPlaceholder?this.renderPlaceHolder():this.renderTabContent()))))}renderHeader(e){if(!e)return null;const t=this.creator.survey;return i.createElement(i.Fragment,null,i.createElement("div",{className:"svc-designer-header"},i.createElement(r.SurveyHeader,{survey:t})))}renderPlaceHolder(){const e=this.renderHeader(this.creator.showSurveyHeader&&this.creator.showHeaderInEmptySurvey);return i.createElement(i.Fragment,null,e,i.createElement("div",{className:"svc-designer__placeholder-container","data-sv-drop-target-survey-element":"newGhostPage"},this.renderPlaceHolderContent(),this.createRenderedPage(this.model.newPage,"svc-designer-placeholder-page",!0)))}renderPlaceHolderContent(){return i.createElement(ve,{name:"designer",placeholderTitleText:this.model.placeholderTitleText,placeholderDescriptionText:this.model.placeholderDescriptionText})}renderTabContent(){const e=this.creator.survey,t=this.renderHeader(this.creator.showSurveyHeader),r={...this.model.surfaceCssVariables};r.maxWidth=e.renderedWidth;const n=this.renderTabTools();return i.createElement(i.Fragment,null,i.createElement("div",{className:this.model.designerCss,style:r},t,this.getRenderedPages()),n)}renderTabTools(){if(!this.model.showSurfaceTools)return null;const e=this.creator.showPageNavigator?i.createElement("div",{className:"svc-tab-designer__page-navigator"},i.createElement(he,{pagesController:this.model.pagesController,pageEditMode:this.model.creator.pageEditMode})):null,t=this.model.showSurfaceToolbar?i.createElement(r.SurveyActionBar,{model:this.model.surfaceToolbar,handleClick:!1}):null;return i.createElement("div",{className:"svc-tab-designer__tools"},e,t)}}r.ReactElementFactory.Instance.registerElement("svc-tab-designer",e=>i.createElement(Ee,e));class ge extends i.Component{constructor(e){super(e),this.id="PageWrapperCallback_"+ ++ge.ID,this.state={changed:0}}render(){var e,t;const n=this.props.page?r.ReactElementFactory.Instance.createElement("svc-page",{survey:this.props.creator.survey,page:this.props.page,creator:this.props.creator,isGhost:this.props.isGhost}):null;return i.createElement("div",{className:this.props.className,"data-sv-drop-target-page":null===(e=this.props.page)||void 0===e?void 0:e.name,"data-sv-drop-target-survey-element":this.props.isGhost?"newGhostPage":null===(t=this.props.page)||void 0===t?void 0:t.name},n)}setupCallback(e){e&&e.registerFunctionOnPropertyValueChanged("name",()=>{this.setState({changed:this.state&&this.state.changed?this.state.changed+1:1})},this.id)}clearCallback(e){e&&e.unRegisterFunctionOnPropertyValueChanged("name")}componentDidUpdate(e,t){e.page!==this.props.page&&(this.clearCallback(e.page),this.setupCallback(this.props.page))}componentDidMount(){this.setupCallback(this.props.page)}componentWillUnmount(){this.clearCallback(this.props.page)}}ge.ID=0;class ye extends r.SurveyElementBase{getStateElement(){return this.model}get model(){return this.props.data}renderElement(){return i.createElement("div",{className:"svc-json-editor-tab__errros_list",style:{display:this.model.hasErrors?"block":"none"}},i.createElement(r.List,{model:this.model.errorList}))}}class be extends r.SurveyElementBase{constructor(e){super(e)}getStateElement(){return this.model}get model(){return this.props.data}renderElement(){const e=e=>{this.model.textElement=e},t=i.createElement(ye,{data:this.model});return i.createElement("div",{className:"svc-creator-tab__content"},i.createElement("div",{className:"svc-json-editor-tab__content"},i.createElement("textarea",{ref:t=>e(t),className:"svc-json-editor-tab__content-area",value:this.model.text,onChange:e=>this.model.text=e.target.value,onKeyDown:e=>this.model.checkKey(e,e),disabled:this.model.readOnly,"aria-label":this.model.ariaLabel}),t))}}r.ReactElementFactory.Instance.registerElement("svc-tab-json-editor-textarea",e=>i.createElement(be,e));class _e extends r.SurveyElementBase{constructor(e){super(e),this.aceEditorrRef=i.createRef()}getStateElement(){return this.model}get model(){return this.props.data}componentDidMount(){this.model.init(ace.edit(this.aceEditorrRef.current))}renderElement(){const e=i.createElement(ye,{data:this.model});return i.createElement("div",{className:"svc-creator-tab__content"},i.createElement("div",{className:"svc-json-editor-tab__content"},i.createElement("div",{className:"svc-json-editor-tab__ace-editor",ref:this.aceEditorrRef}),e))}}r.ReactElementFactory.Instance.registerElement("svc-tab-json-editor-ace",e=>i.createElement(_e,e));class Ce extends r.SurveyElementBase{get model(){return this.props.data}getStateElement(){return this.model}renderElement(){this.model;var e=this.renderViewContent();return i.createElement("div",{className:"svc-creator-tab__content svc-logic-tab"},e)}renderViewContent(){const e="svc-plugin-tab__content svc-logic-tab svc-logic-tab__content "+(this.model.hasItems?"":"svc-logic-tab--empty"),n=this.model.readOnly?void 0:i.createElement(r.SurveyActionBar,{model:this.model.contentActionsContainer});return i.createElement(t.Fragment,null,i.createElement("div",{className:e},this.model.hasItems?i.createElement(i.Fragment,null,i.createElement(r.Survey,{model:this.model.itemsSurvey}),n):i.createElement("div",{className:"svc-logic-tab__content-empty"},i.createElement(ve,{name:"logic",placeholderTitleText:this.model.placeholderTitleText,placeholderDescriptionText:this.model.placeholderDescriptionText}),n)))}}r.ReactElementFactory.Instance.registerElement("svc-tab-logic",e=>i.createElement(Ce,e));class Ne extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.queueSurveyLayoutRefresh()}componentDidUpdate(e,t){super.componentDidUpdate(e,t),this.model.queueSurveyLayoutRefresh()}componentWillUnmount(){this.model.cancelSurveyLayoutRefresh(),super.componentWillUnmount()}renderElement(){const e=this.model.getRootCss(),t=(n=this.model.popupOverlayHeight)?{"--sv-popup-overlay-height":n}:{};var n;return this.model.survey?this.model.hasFrame?i.createElement("div",{className:e,onKeyDown:e=>this.model.tryToZoom(e,e),onMouseEnter:"desktop"===this.model.device?null:this.model.activateZoom,onMouseLeave:"desktop"===this.model.device?null:this.model.deactivateZoom},i.createElement("div",{className:"svd-simulator-wrapper",id:"svd-simulator-wrapper",style:{width:this.model.simulatorFrame.frameWidth+"px",height:this.model.simulatorFrame.frameHeight+"px"}},i.createElement("div",{className:"svd-simulator",style:{width:this.model.simulatorFrame.deviceWidth+"px",height:this.model.simulatorFrame.deviceHeight+"px",transform:"scale("+this.model.simulatorFrame.scale+") translate(-50%, -50%)"}},i.createElement("div",{className:"svd-simulator-content",style:t},i.createElement(r.Survey,{model:this.model.survey}))))):i.createElement("div",{className:e},i.createElement("div",{className:"svd-simulator-content",style:t},i.createElement(r.Survey,{model:this.model.survey}))):i.createElement("div",{className:e})}}class Se extends r.SurveyElementBase{constructor(e){super(e)}get model(){return this.props.data}getStateElement(){return this.model}renderPlaceholder(){return i.createElement(ve,{name:"preview",placeholderTitleText:this.model.placeholderTitleText,placeholderDescriptionText:this.model.placeholderDescriptionText})}renderSimulator(){return i.createElement("div",{className:"svc-plugin-tab__content"},i.createElement(Ne,{model:this.model.simulator}),this.model.showResults?i.createElement(W,{survey:this.model.simulator.survey}):null)}renderElement(){const e="svc-creator-tab__content svc-test-tab__content "+this.model.tabContentAdditionalCss;return i.createElement("div",{className:e},this.model.simulator.survey.isEmpty?this.renderPlaceholder():this.renderSimulator(),this.getBottomToolbar())}getBottomToolbar(){return this.model.isPageToolbarVisible?i.createElement("div",{className:"svc-test-tab__content-actions"},i.createElement(r.SurveyActionBar,{model:this.model.pages})):null}}r.ReactElementFactory.Instance.registerElement("svc-tab-preview",e=>i.createElement(Se,e));class xe extends i.Component{render(){return i.createElement("div",{className:"svc-property-grid-placeholder"},i.createElement("div",{className:"svc-property-grid-placeholder__header"},i.createElement("span",{className:"svc-property-grid-placeholder__title"},n.editorLocalization.getString("ed.propertyGridPlaceholderTitle")),i.createElement("span",{className:"svc-property-grid-placeholder__description"},n.editorLocalization.getString("ed.propertyGridPlaceholderDescription"))),i.createElement("div",{className:"svc-property-grid-placeholder__content"},i.createElement("div",{className:"svc-property-grid-placeholder__gap"}),i.createElement("div",{className:"svc-property-grid-placeholder__image"})))}}r.ReactElementFactory.Instance.registerElement("svc-property-grid-placeholder",e=>i.createElement(xe,e));class fe extends r.SurveyElementBase{get model(){return this.props.data}getStateElement(){return this.model}renderPlaceholder(){return i.createElement(ve,{name:"theme",placeholderTitleText:this.model.placeholderTitleText,placeholderDescriptionText:this.model.placeholderDescriptionText})}renderSimulator(){return i.createElement("div",{className:"svc-plugin-tab__content"},i.createElement(Ne,{model:this.model.simulator}),this.model.showResults?i.createElement(W,{survey:this.model.simulator.survey}):null)}renderElement(){const e="svc-creator-tab__content svc-test-tab__content "+this.model.tabContentAdditionalCss;return i.createElement("div",{className:e},this.model.simulator.survey.isEmpty?this.renderPlaceholder():this.renderSimulator(),this.getBottomToolbar())}getBottomToolbar(){return this.model.isPageToolbarVisible?i.createElement("div",{className:"svc-test-tab__content-actions"},i.createElement(r.SurveyActionBar,{model:this.model.pages})):null}}r.ReactElementFactory.Instance.registerElement("svc-tab-theme",e=>i.createElement(fe,e));class Ie extends r.SurveyElementBase{get model(){return this.props.data||this.props.model}getStateElement(){return this.model}renderElement(){return this.model?i.createElement("div",{className:"svc-creator-tab__content svc-translation-tab"+(this.model.isEmpty?" svc-translation-tab--empty":"")},this.renderElementContent()):null}renderElementContent(){return this.model.isEmpty?i.createElement(ve,{name:"translation",placeholderTitleText:this.model.placeholderTitleText,placeholderDescriptionText:this.model.placeholderDescriptionText}):this.model.isSideBySideForm?this.renderSideBySideContent(this.model):this.renderStringsContent(this.model)}renderStringsContent(e){var t,n;return i.createElement("div",{className:"st-content"},i.createElement("div",{className:"svc-flex-column st-strings-wrapper"},i.createElement("div",{className:"svc-flex-row st-strings-header"},i.createElement(r.Survey,{key:null===(t=e.stringsHeaderSurvey)||void 0===t?void 0:t.elementIdPrefix,model:e.stringsHeaderSurvey})),i.createElement("div",{className:"svc-flex-row svc-plugin-tab__content st-strings"},i.createElement(r.Survey,{key:null===(n=e.stringsSurvey)||void 0===n?void 0:n.elementIdPrefix,model:e.stringsSurvey}))))}renderSideBySideContent(e){var t;const n=e.targetSurvey;return i.createElement("div",{className:e.sideBySideRootCss},i.createElement("div",{key:null===(t=e.sourceSurvey)||void 0===t?void 0:t.elementIdPrefix,className:"st-side-by-side__source",ref:t=>{e.setSourceScrollElement(t)}},i.createElement(r.Survey,{model:e.sourceSurvey})),n?i.createElement("div",{key:n.elementIdPrefix,className:"st-side-by-side__target",ref:t=>{e.setTargetScrollElement(t)}},i.createElement(r.Survey,{model:n})):null)}}r.ReactElementFactory.Instance.registerElement("svc-tab-translation",e=>i.createElement(Ie,e));class we extends r.SurveyElementBase{get item(){return this.props.item}getStateElement(){return this.item}renderElement(){const e=this.item;if(!e)return null;const t=n.getTranslationLocaleProgress(e);return i.createElement("div",{className:"svc-translation-locale-item"},i.createElement("span",{className:"svc-translation-locale-item__name"},this.renderLocString(e.locTitle,void 0,"locString")),t?i.createElement("span",{className:"svc-translation-locale-item__progress"},t):null)}}r.ReactElementFactory.Instance.registerElement(n.translationLocaleItemComponentName,e=>i.createElement(we,e));class Re extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}renderElement(){return this.model.isVisible?i.createElement(r.List,{model:this.model.list}):null}}r.ReactElementFactory.Instance.registerElement("svc-object-selector",e=>i.createElement(Re,e));class Me extends r.SurveyElementBase{get model(){return this.props.model}getStateElement(){return this.model}canRender(){return!!this.model&&super.canRender()}renderElement(){return i.createElement("div",{className:this.model.rootCss},i.createElement(X,{model:this.model.searchManager}),i.createElement(r.Survey,{model:this.model.survey}))}}r.ReactElementFactory.Instance.registerElement("svc-property-grid",e=>i.createElement(Me,e));class qe extends i.Component{constructor(e){super(e)}render(){const e=this.props.model.elements.map((e,t)=>r.ReactElementFactory.Instance.createElement(e.componentName,{...e.componentData,key:t})),t=this.props.model.scrollable?i.createElement(r.Scroll,null," ",e," "):e;return this.props.model.wrapped?i.createElement("div",{className:this.props.model.cssClass}," ",t," "):i.createElement(i.Fragment,null,t)}}r.ReactElementFactory.Instance.registerElement("svc-component-container",e=>i.createElement(qe,e));class De extends i.Component{render(){const e=this.props.item;return e?i.createElement("div",{className:"svc-icon-item"},i.createElement(r.SvgIcon,{className:"svc-icon-item__icon",size:"auto",iconName:e.value}),i.createElement("span",{className:"svc-icon-item__text"},e.title)):null}}r.ReactElementFactory.Instance.registerElement("svc-presets-icon-item",e=>i.createElement(De,e));class Te extends r.SurveyElementBase{get item(){return this.props.item}getStateElement(){return this.item}renderElement(){const e=this.item.tooltip||this.item.title,t=this.item.hasTitle?i.createElement("span",{className:"svc-switcher__title"},this.item.title):null;return r.attachKey2click(i.createElement("button",{className:this.item.getActionBarItemCss(),type:"button",disabled:this.item.disabled,onClick:e=>this.item.action(this.item,this.item.getIsTrusted(e)),title:e,"aria-checked":this.item.ariaChecked,"aria-expanded":this.item.ariaExpanded,role:this.item.ariaRole},i.createElement("div",{className:this.item.getSwitcherIconCss()},i.createElement("div",{className:"svc-switcher__icon-thumb"})),t),this.item,{processEsc:!1})}}r.ReactElementFactory.Instance.registerElement("svc-switcher",e=>i.createElement(Te,e));class Fe extends r.SurveyElementBase{get item(){return this.props.item}getStateElement(){return this.item}canRender(){return!!this.item&&this.item.visible&&super.canRender()}renderMarker(){const e=this.item;return e.hasMarkerText?i.createElement("span",{className:e.markerCss},e.markerText):e.hasMarkerIcon?i.createElement("span",{className:"svc-collab-row__icon"},i.createElement(r.SvgIcon,{iconName:e.markerIconName,size:e.markerIconSize})):null}renderElement(){const e=this.item;return i.createElement("div",{className:e.rowCss,role:e.rowRole||void 0,"aria-expanded":e.ariaExpanded},this.renderMarker(),i.createElement("span",{className:"svc-collab-row__title"},e.title),e.hasSubtitle?i.createElement("span",{className:"svc-collab-row__subtitle"},e.subtitle):null)}}r.ReactElementFactory.Instance.registerElement("svc-collab-row",e=>i.createElement(Fe,e));class Be extends r.SurveyElementBase{constructor(e){super(e),this.root=i.createRef()}get model(){return this.props.model}getStateElement(){return this.model}componentDidMount(){super.componentDidMount(),this.model.setComponentElement(this.root.current)}componentWillUnmount(){super.componentWillUnmount(),this.model.resetComponentElement()}renderElement(){const e=this.model,t=r.ReactElementFactory.Instance.createElement(e.contentComponentName,e.contentComponentData);return i.createElement("div",{ref:this.root,className:e.rootCss,style:e.style,role:"dialog","aria-modal":!1,"aria-labelledby":e.titleId,tabIndex:-1,onPointerDownCapture:()=>e.bringToFront()},i.createElement("div",{className:e.headerCss,onPointerDown:t=>e.onPointerDown(t.nativeEvent)},i.createElement("span",{id:e.titleId,className:"svc-floating-panel__title"},e.titleText),i.createElement("span",{className:"svc-floating-panel__drag","aria-hidden":"true"},i.createElement(r.SvgIcon,{iconName:"icon-draghorizontal-24x16",size:"auto"})),i.createElement(r.SurveyActionBar,{model:e.headerToolbar})),i.createElement("div",{className:e.bodyCss},t))}}r.ReactElementFactory.Instance.registerElement("svc-floating-panel",e=>i.createElement(Be,e));let ke=class extends r.SurveyElementBase{render(){const e=this.props.item;return i.createElement(i.Fragment,null,i.createElement(r.SvgIcon,{iconName:e.iconName,size:e.iconSize,className:"svc-json-error__icon"}),i.createElement("div",{className:"svc-json-error__container"},i.createElement("div",{className:"svc-json-error__title"},i.createElement("span",{key:2},this.renderLocString(e.locTitle,void 0,"locString"))),this.renderFixButton()))}renderFixButton(){if(!this.props.item.data.showFixButton)return null;const e=this.props.item;return r.attachKey2click(i.createElement("button",{type:"button",onClick:t=>{t.stopPropagation(),e.data.fixError()},title:e.data.fixButtonTitle,className:"svc-json-error__fix-button"},i.createElement(r.SvgIcon,{iconName:e.data.fixButtonIcon,size:"auto"})))}};r.ReactElementFactory.Instance.registerElement("json-error-item",e=>i.createElement(ke,e));class Pe extends r.SurveyElementBase{constructor(e){super(e)}getStateElement(){return this.model}get model(){return this.props.data}renderElement(){return i.createElement(qe,{model:this.model.containerModel})}}r.ReactElementFactory.Instance.registerElement("svc-tab-container",e=>i.createElement(Pe,e));class Ue extends r.SurveyQuestionText{constructor(e){super(e)}get question(){return this.questionBase}renderInput(){return i.createElement(i.Fragment,null,i.createElement("input",{role:"spinbutton",id:this.question.inputId,disabled:this.isDisplayMode,className:this.question.cssClasses.control,ref:e=>this.setControl(e),placeholder:this.question.renderedPlaceholder,autoComplete:"off",onBlur:e=>this.question.onBlur(e.nativeEvent),onFocus:e=>this.question.onFocus(e.nativeEvent),onChange:this.question.onChange,onBeforeInput:e=>this.question.onBeforeInput(e.nativeEvent),onKeyUp:e=>this.question.onKeyUp(e.nativeEvent),onKeyDown:e=>this.question.onInputKeyDown(e.nativeEvent),"aria-required":this.question.a11y_input_ariaRequired,"aria-label":this.question.a11y_input_ariaLabel,"aria-labelledby":this.question.a11y_input_ariaLabelledBy,"aria-describedby":this.question.a11y_input_ariaDescribedBy,"aria-invalid":this.question.a11y_input_ariaInvalid,"aria-errormessage":this.question.a11y_input_ariaErrormessage}))}renderElement(){return i.createElement("div",{className:this.question.cssClasses.root,onKeyDown:e=>this.question.onKeyDown(e.nativeEvent)},this.renderInput(),this.renderButtons())}getValueCore(){return this.question.renderedValue}renderButtons(){return i.createElement(r.SurveyActionBar,{model:this.question.inputActionsContainer})}}class Ae extends r.SurveyElementBase{get item(){return this.props.item}get itemAction(){return this.props.item}getStateElement(){return this.itemAction}get question(){return this.item.data.question}renderElement(){return i.createElement("button",{tabIndex:-1,"aria-hidden":"true",className:this.itemAction.getActionBarItemCss(),disabled:this.itemAction.disabled,onClick:()=>this.item.action(),onMouseDown:this.item.data.onMouseDown,onMouseUp:this.question.onButtonMouseUp,onMouseLeave:this.question.onButtonMouseLeave,onBlur:e=>this.question.onBlur(e.nativeEvent),onFocus:e=>this.question.onFocus(e.nativeEvent)},i.createElement(r.SvgIcon,{className:this.itemAction.cssClasses.itemIcon,iconName:this.item.iconName,size:"auto"}))}}r.ReactElementFactory.Instance.registerElement("sv-spinedit-button",e=>i.createElement(Ae,e)),r.ReactQuestionFactory.Instance.registerQuestion("spinedit",e=>i.createElement(Ue,e));class Le extends i.Component{get rootClassName(){var e;return null!==(e=this.props.className)&&void 0!==e?e:"sd-color-swatch"}get rootStyle(){return{backgroundColor:this.props.color}}renderIcon(){var e,t;return this.props.showIcon?i.createElement(r.SvgIcon,{iconName:null!==(e=this.props.swatchIcon)&&void 0!==e?e:"icon-dropper-16x16",size:"auto",className:null!==(t=this.props.iconClassName)&&void 0!==t?t:"sd-color-swatch__icon"}):null}renderColorInput(){const{onColorInputChange:e,colorInputValue:t,colorInputClassName:r,inputDisabled:n,arias:s}=this.props;return e?i.createElement("input",{type:"color",disabled:n,value:t,className:r,onChange:e,tabIndex:-1,...s}):null}render(){const e=i.createElement("div",{className:"sd-color-swatch__content",style:this.rootStyle},this.renderIcon(),this.renderColorInput());return this.props.onColorInputChange?i.createElement("label",{className:this.rootClassName},e):i.createElement("div",{className:this.rootClassName},e)}}class Ve extends r.SurveyElementBase{render(){const e=this.props.item;return i.createElement("div",{className:"sd-color-swatch-item"},i.createElement("div",{className:"sd-color-swatch-item__label"},i.createElement("span",{key:2,className:"sd-color-swatch-item__caption"},this.renderLocString(e.locTitle,void 0,"locString"))),i.createElement(Le,{color:e.value}))}}r.ReactElementFactory.Instance.registerElement("color-item",e=>i.createElement(Ve,e));class Qe extends r.SurveyQuestionText{constructor(e){super(e)}get question(){return this.questionBase}renderInput(){return i.createElement(i.Fragment,null,i.createElement("input",{id:this.question.inputId,disabled:this.isDisplayMode,className:this.question.cssClasses.control,ref:e=>this.setControl(e),placeholder:this.question.renderedPlaceholder,autoComplete:"off",onKeyUp:e=>this.question.onKeyUp(e.nativeEvent),onBlur:e=>this.question.onBlur(e.nativeEvent),onChange:this.question.onChange,onBeforeInput:e=>this.question.onBeforeInput(e.nativeEvent),"aria-required":this.question.a11y_input_ariaRequired,"aria-labelledby":this.question.a11y_input_ariaLabelledBy,"aria-label":this.question.a11y_input_ariaLabel,"aria-invalid":this.question.a11y_input_ariaInvalid,"aria-describedby":this.question.a11y_input_ariaDescribedBy}))}renderElement(){return i.createElement("div",{className:this.question.cssClasses.rootWrapper},i.createElement("div",{className:this.question.cssClasses.root,onKeyDown:e=>this.question.onKeyDown(e.nativeEvent)},this.renderColorSwatch(),this.renderInput(),this.renderButtons()))}getValueCore(){return this.question.renderedValue}renderColorSwatch(){const e=this.question;return i.createElement("div",{className:e.cssClasses.colorSwatch},i.createElement(Le,{className:e.getSwatchCss(),swatchIcon:e.cssClasses.swatchIcon,iconClassName:e.cssClasses.iconClassName,color:e.renderedValue,showIcon:!0,colorInputValue:e.renderedColorValue,colorInputClassName:e.cssClasses.colorInput,inputDisabled:this.isDisplayMode,onColorInputChange:t=>e.onColorInputChange(t.nativeEvent),arias:{"aria-required":e.a11y_input_ariaRequired,"aria-labelledby":e.a11y_input_ariaLabelledBy,"aria-label":e.a11y_input_ariaLabel,"aria-invalid":e.a11y_input_ariaInvalid,"aria-describedby":e.a11y_input_ariaDescribedBy}}))}renderButtons(){return this.question.hasVisibleInputActions?i.createElement(r.SurveyActionBar,{model:this.question.inputActionsContainer}):null}}r.ReactQuestionFactory.Instance.registerQuestion("color",e=>i.createElement(Qe,e));class He extends r.SurveyQuestionText{constructor(e){super(e)}get questionFile(){return this.questionBase}getValueCore(){return this.question.renderedValue}renderInput(){return i.createElement(i.Fragment,null,i.createElement("input",{disabled:this.question.isTextInputReadOnly,className:this.questionFile.cssClasses.control,placeholder:this.questionFile.renderedPlaceholder,ref:e=>this.setControl(e),autoComplete:"off",type:"text",onBlur:e=>this.questionFile.onInputBlur(e.nativeEvent),onChange:e=>this.questionFile.onInputChange(e.nativeEvent)}))}renderButtons(){return this.question.hasVisibleInputActions?i.createElement(r.SurveyActionBar,{model:this.questionFile.inputActionsContainer}):null}renderElement(){return i.createElement("div",{className:this.questionFile.cssClasses.root,ref:e=>this.setContent(e),onDragEnter:this.questionFile.onDragEnter,onDragOver:this.questionFile.onDragOver,onDrop:this.questionFile.onDrop,onDragLeave:this.questionFile.onDragLeave,onKeyDown:e=>this.question.onKeyDown(e.nativeEvent)},this.renderInput(),this.renderButtons())}}class We extends r.SurveyElementBase{get item(){return this.props.item}get question(){return this.props.item.data.question}getStateElement(){return this.item}renderElement(){return i.createElement("div",null,r.attachKey2click(i.createElement("label",{onClick:e=>this.question.chooseFiles(e.nativeEvent),className:this.item.getActionBarItemCss(),htmlFor:this.question.inputId,"aria-label":this.question.chooseButtonCaption},i.createElement(r.SvgIcon,{iconName:this.item.iconName,size:"auto",title:this.item.title,className:this.item.cssClasses.itemIcon}),i.createElement("span",{className:"sv-visuallyhidden"},this.question.chooseButtonCaption))),i.createElement("input",{type:"file",disabled:this.item.disabled,className:this.question.cssClasses.fileInput,id:this.question.inputId,"aria-required":this.question.ariaRequired,"aria-label":this.question.ariaLabel,"aria-invalid":this.question.ariaInvalid,"aria-describedby":this.question.ariaDescribedBy,multiple:!1,title:this.question.inputTitle,accept:this.question.acceptedTypes,tabIndex:-1,onChange:e=>this.question.onFileInputChange(e.nativeEvent)}))}}r.ReactQuestionFactory.Instance.registerQuestion("fileedit",e=>i.createElement(He,e)),r.ReactElementFactory.Instance.registerElement("sv-fileedit-button",e=>i.createElement(We,e)),e.Version=void 0,e.Version="3.0.2",o.checkLibraryVersion("3.0.2","survey-creator-react"),Object.defineProperty(e,"PropertyGridEditorCollection",{enumerable:!0,get:function(){return n.PropertyGridEditorCollection}}),Object.defineProperty(e,"SurveyLogic",{enumerable:!0,get:function(){return n.SurveyLogic}}),Object.defineProperty(e,"SurveyLogicUI",{enumerable:!0,get:function(){return n.SurveyLogicUI}}),Object.defineProperty(e,"SurveyQuestionEditorDefinition",{enumerable:!0,get:function(){return n.SurveyQuestionEditorDefinition}}),Object.defineProperty(e,"ToolboxToolViewModel",{enumerable:!0,get:function(){return n.ToolboxToolViewModel}}),Object.defineProperty(e,"editorLocalization",{enumerable:!0,get:function(){return n.editorLocalization}}),Object.defineProperty(e,"localization",{enumerable:!0,get:function(){return n.localization}}),Object.defineProperty(e,"settings",{enumerable:!0,get:function(){return n.settings}}),Object.defineProperty(e,"svgBundle",{enumerable:!0,get:function(){return n.svgBundle}}),e.ActionButton=C,e.AdaptiveToolbox=Y,e.AddQuestionButtonComponent=T,e.CellQuestionAdornerComponent=w,e.CellQuestionDropdownAdornerComponent=R,e.CollabRowComponent=Fe,e.ComponentContainer=qe,e.CreatorSurveyPageComponent=D,e.FloatingPanelComponent=Be,e.IconItem=De,e.ImageItemValueAdornerComponent=V,e.ItemValueAdornerComponent=A,e.LogoImageComponent=B,e.MatrixCellAdornerComponent=H,e.PanelAdornerComponent=F,e.PropertyGridComponent=Me,e.PropertyGridPlaceholderComponent=xe,e.QuestionAdornerComponent=y,e.QuestionBanner=N,e.QuestionDropdownAdornerComponent=S,e.QuestionEditorContentComponent=U,e.QuestionErrorComponent=de,e.QuestionImageAdornerComponent=x,e.QuestionRatingAdornerComponent=f,e.QuestionWidgetAdornerComponent=I,e.QuestionWrapperFooter=_,e.QuestionWrapperHeader=b,e.ReactDragEvent=class extends E{constructor(e){super(e),this.event=e}get dataTransfer(){return this.event.dataTransfer}},e.ReactMouseEvent=E,e.RowWrapper=v,e.SearchComponent=X,e.SideBarDefaultHeader=re,e.SideBarLaunchCard=ie,e.SidebarComponent=oe,e.SurveyCreator=h,e.SurveyCreatorComponent=u,e.SurveyCreatorToolboxCategory=G,e.SurveyCreatorToolboxItem=K,e.SurveyCreatorToolboxItemGroup=z,e.SurveyCreatorToolboxTool=j,e.SurveyElementEmbeddedSurvey=P,e.SurveyLocStringEditor=me,e.SurveyLogicOpertor=ue,e.SurveyNavigation=Z,e.SurveyQuestionColor=Qe,e.SurveyQuestionFileEditor=He,e.SurveyQuestionFileEditorButton=We,e.SurveyQuestionLinkValue=k,e.SurveyQuestionSpinEditor=Ue,e.SurveyResults=W,e.SurveyResultsByRow=O,e.SurveySimulator=Ne,e.SurveySpinEditorButton=Ae,e.SwitcherComponent=Te,e.TabButtonComponent=$,e.TabContainerComponent=Pe,e.TabDesignerComponent=Ee,e.TabJsonEditorAceComponent=_e,e.TabJsonEditorErrorsComponent=ye,e.TabJsonEditorTextareaComponent=be,e.TabLogicComponent=Ce,e.TabPreviewSurveyComponent=Se,e.TabThemeSurveyComponent=fe,e.TabTranslationComponent=Ie,e.TabbedMenuComponent=c,e.TabbedMenuItemComponent=d,e.ToolboxList=J,e.TranslateFromAction=ce,e.TranslationDropdownQuestionComponent=M,e.TranslationLineSkeleton=le,e.TranslationLocaleItemComponent=we});
|
|
@@ -73,5 +73,5 @@ export { settings } from "survey-creator-core";
|
|
|
73
73
|
export { svgBundle } from "survey-creator-core";
|
|
74
74
|
export { SurveyLogic, SurveyLogicUI } from "survey-creator-core";
|
|
75
75
|
export { SurveyQuestionEditorDefinition } from "survey-creator-core";
|
|
76
|
-
export { ISurveyCreatorOptions, IPropertyGridEditor } from "survey-creator-core";
|
|
76
|
+
export type { ISurveyCreatorOptions, IPropertyGridEditor } from "survey-creator-core";
|
|
77
77
|
export { ToolboxToolViewModel, PropertyGridEditorCollection } from "survey-creator-core";
|