/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@wg-npm/survey-creator@1.78.511910/dist/survey-creator.esm.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import Vue from"vue";import _$1 from"lodash";import{Dropdown,DropdownMenu,DropdownItem,Button,Row,Col,Icon,Input as Input$1,Tooltip as Tooltip$1,Badge,Modal,Radio,RadioGroup,Checkbox,CheckboxGroup,Divider,Card,Slider,Form,FormItem,ButtonGroup,InputNumber,Alert,Select,Option,Table as Table$1,OptionGroup,Message,Drawer,Tabs,TabPane,Scroll as Scroll$1}from"view-design";import deepmerge from"deepmerge";import draggable from"vuedraggable";var defaultLang={survey_creator:{locale:"zh-CN",common:{back:"返回",save:"保存",copy:"复制",cancel:"取消",operation:"操作",delete:"删除",languages:{"zh-CN":"简体中文","zh-TW":"繁体中文","en-US":"English"},layout:{HORIZONTAL:"水平",VERTICAL:"垂直"},settings:{translate:"多语言翻译",preview:"预览"},tips:{edit:"编辑",copy:"复制",delete:"删除",jump:"设置跳转逻辑",please_input_answer:"请输入回答",get_screen_shot_name:"插入视频截图",upload_image_exceed_the_limit:"图片数量超过限制",max_length_hint:"字数超过限制",upload_fail:"上传文件失败"},tab:{question_setting:"题目设置",language:"多语言翻译"}},survey:{question_count:"题目数",total_score:"总配分",layout:"布局"},question:{no_data:"还未创建题目",create:"新增题目",max_score:"最高分值:",star_single:"此题计星",star_multi_prefix:"当选择",star_multi_suffix:"项及以上时计星",type:"题型",types:{SINGLE_SELECTION:"单选题",MULTI_SELECTION:"多选题",FILL_BLANK:"填空题",SHORT_ANSWER:"简答题",MATRIX:"分数量表",SCORING:"打分题",TEXT_TITLE:"文字说明",EVALUATION:"统计题"},jump:{title:"跳转逻辑",add_setting:"添加逻辑设置",no_option_to_setting:"没有可设置的选项",no_setting_tips:"你还未添加跳转逻辑",option_is:"如果选项是",jump_to:"跳转到",otherwise_to_next:"，否则正常进入下一题",selected_jump:"选中则跳转第{0}题",delete_option:"删除选项",delete_question:"删除题目",delete_option_desc:"该选项参与逻辑跳转设置，删除后，相关逻辑跳转关系会自动清除，是否确认要删除？",delete_question_desc:"该题目参与逻辑跳转设置，删除后，相关逻辑跳转关系会自动清除，是否确认要删除？"},incomplete_tips:"题目未设置完整",optional:"选项",sub_questions:"子题",score:"分值",scores:"分",totalScores:"总分",selectScore:"请选择分值",questionRequired:"此题必填",titleRequiredTip:"请填写题目内容",inputEnabledTip:"用户选中该项后可输入",textTitleRequiredTip:"请填写文字说明",scoreRequiredTip:"分值不能为空",scoreExceedTotalTip:"分数不能超过总分",minScoreGreaterThanMaxTip:"最小分值不能大于最大分值",maxScoreLessThanMinTip:"最大分值不能小于最小分值",subQuestionRequiredTip:"子題不能为空",optionalRequiredTip:"选项不能为空",commitRequiredTip:"描述不能为空",levelRequiredTip:"等级不能为空",addItem:"新增子题",noQuestion:"还未添加题目！",noQuestionTip:"新增题目请按右上角「新增题目按钮」",wordCountLimit:"字数限制",multi_selection:"多选题",single_selection:"单选题",remote_selection:"单选题",short_answer:"简答题",fill_blank:"填空题",matrix:"分数量表",text_title:"文字说明",group:"题组",level:"量表范围",matrixLevel1:"非常不同意",matrixLevel2:"不同意",matrixLevel3:"部分同意",matrixLevel4:"同意",matrixLevel5:"非常同意",scoreErrorTip:"分值为100以内的两位小数",notEmpty:"不能为空",pleaseEnter:"请填写",wordsLimit:"字数限制：",noDesc:"无选项描述",noSubDesc:"暂无子题描述",noQuestionDesc:"暂无题目描述",unSave:"未保存",surveyConfirmContent:"确认要提交？提交后问卷即锁定不可再修改！",unSaveConfirm:"有未保存的题目，确定要返回吗？",scoringEnabled:"此题占分",starEnabled:"此题计星",optionalStarTip:"此项得星",starLeastOneTip:"至少一项得星",inputLeastOneTip:"至少一项输入项",starMinCountPrefix:"当选择",starMinCountSuffix:"项及以上时计星",maxScore:"最高分值：",enableMultiSelect:"可复选",evaluation_tag:{label:"评价对象",TEACHER:"评教师",COURSE:"评课程"},evaluation:{level:{1:"好",2:"较好",3:"一般",4:"较差",5:"差"},type:{STAR:"计星",EXPR:"条件判断"},levelNameLabel:"评价等级",levelLabel:"评价标准",selectedType:"统计方式",desc:{atPoint:"{0}星",inRange:"{0}-{1}星",outOfRange:"{0}星以上"},condition:{if:"如果",else:"否则",add_if_template:"添加如果模板",requirements:"满足条件",score_condition_title:"总分数范围为",type:{ASSIGN:"题目范围为__的结果为__的数量__",AUTO:"题目范围为__的结果为__",SCORE:"总分数范围为__"},evaluation_label:"设置总体评价为",evaluation_require_tip:"总体评价不能为空",question:"题目",question_scope:"题目范围",question_result:"的结果为",question_count:"的数量",choose_result:"选择结果",operator:"运算符",other:"其他",assign_template:"{0} 项为 {1}  {2} {3}项",auto_template:"{0} 项为 {1}",score_template:"总分数范围为: {0}{1} 总分 {2}{3}"}},exclusive_enabled:"添加互斥项",exclusive_option_tooltip:"选择互斥项后将不能选择其他选项。如“与以上选项互斥”",inputted_enabled:"选项后增加输入项",inputted_enabled_prefix:"输入项字数不少于",inputted_enabled_suffix:"字",option_header_choice:"设置选项",option_header_scoring:"分值",option_header_inputing:"输入项",exclusive_choice:"与以上选项互斥",presetReply:"预制回复",addPresetReply:"预制回复",presetReplyRequiredTip:"预制回复内容不能为空",presetReplyDuplicateTip:"预制回复内容不能重复",presetReplyTip:"提示：快速选择预设内容（点击一键填入）",scoring:{extreme_value_label:"极值标签",extreme_value_labels:{satisfaction:{label:"满意度",minValue:"非常不满意",maxValue:"非常满意"},importance:{label:"重要度",minValue:"非常不重要",maxValue:"非常重要"},degree_of_conformity:{label:"符合度",minValue:"非常不符合",maxValue:"非常符合"},degree_of_approval:{label:"认同度",minValue:"非常不认同",maxValue:"非常认同"},willingness:{label:"愿意度",minValue:"非常不愿意",maxValue:"非常愿意"},undefined:{label:"",minValue:"",maxValue:""}},setScoringRange:"请设置打分范围",retainDecimal:"保留小数点后",decimalPlaces:"位",addSubQuestion:"添加子题",scoreRange:"分值区间："},rich_text:{filler:"插入填空符",alert:"题目填空部分由老师补充完整",input_placeholder:"由老师补充"}},page:{question:"题目",textTitle:"说明",subQuestion:"子题",matrixQuestion:"主题标题",count:"题目数",arrangement:"选项排列",horizontal:"横向",vertical:"纵向",totalScore:"总配分"},translator:{save:"保存",cancel:"取消",table:{header_type:"类型",header_primary_name:"（默认语言）",header_zhCn:"简体中文",header_enUs:"English",header_zhTw:"繁体中文"}},previewer:{counter_total:"(共 {0} 道题) 已选",counter_suffix:"题"},message:{saveSuccess:"保存成功",saveFailed:"保存失败",surveyLocaleNoSettingCompleted:"问卷题目翻译不完全，是否继续？",noSettingLocale:"未设置多国语言！"}}};let lang=defaultLang,merged=!1,i18nHandler=function(...e){const t=Object.getPrototypeOf(this||Vue).$t;if("function"==typeof t&&Vue.locale)return merged||(merged=!0,Vue.locale(Vue.config.lang,deepmerge(lang,Vue.locale(Vue.config.lang)||{},{clone:!0}))),t.apply(this,e)};const t=function(...e){let t=i18nHandler.apply(this,e);if(null!=t)return t;const i=e[0].split(".");let n=lang;for(let e=0,o=i.length;e<o;e++){if(t=n[i[e]],e===o-1)return t;if(!t)return"";n=t}return""},use=function(e){lang=e||lang},i18n=function(e){i18nHandler=e||i18nHandler};function currentLang(){return lang}var locale={use:use,t:t,i18n:i18n,currentLang:currentLang};class QuestionFactory{constructor(e){this.creatorHash={},this.locale=e,this.registerQuestion("FILL_BLANK",(e=>new BaseQuestionModel("FILL_BLANK",e))),this.registerQuestion("SHORT_ANSWER",(e=>new BaseQuestionModel("SHORT_ANSWER",e))),this.registerQuestion("MATRIX",(e=>new QuestionMatrixModel("MATRIX",e))),this.registerQuestion("SCORING",(e=>new QuestionScoringModel("SCORING",e))),this.registerQuestion("TEXT_TITLE",(e=>new QuestionTextTitleModel("TEXT_TITLE",e))),this.registerQuestion("SINGLE_SELECTION",(e=>new QuestionCheckBoxModel("SINGLE_SELECTION",e))),this.registerQuestion("MULTI_SELECTION",(e=>new QuestionCheckBoxModel("MULTI_SELECTION",e))),this.registerQuestion("EVALUATION",(e=>new QuestionEvaluationModel("EVALUATION",e)))}static getInstance(e){return QuestionFactory.instance||(QuestionFactory.instance=new QuestionFactory(e)),QuestionFactory.instance}static createDefault(e){return new ChoiceModel(e)}static createSubQuestion(e){return new SubQuestionModel(e)}static createEvaluationItem(e){return new StarEvaluationItemModel(e)}static createSelectionQuestionChoices(e){return _$1.range(4).map((()=>this.createDefault(e)))}static createMatrixQuestionChoices(e){return _$1.range(5).map((()=>this.createDefault(e)))}static createEvaluationItems(e){return _$1.range(5).map((()=>this.createEvaluationItem(e)))}registerQuestion(e,t){this.creatorHash[e]=t}createQuestion(e){return(0,this.creatorHash[e])(this.locale)}static createExclusiveChoice(e){return new ExclusiveChoiceModel(e)}}const defaultText=function(e){return _$1.set({},e,"")};class ChoiceOptionModel{constructor(){this.score=null,this.star=!1,this.starCount=null,this.exclusiveEnabled=!1}}class ChoiceModel{constructor(e){this.id=ChoiceModel.createChoiceId(),this.text=defaultText(e),this.options=new ChoiceOptionModel}static createChoiceId(){return`Choice-${_$1.now()}-${_$1.random(0,9999999)}`}}class ExclusiveChoiceModel extends ChoiceModel{constructor(e){super(e),_$1.isEmpty(this.options)||_$1.set(this.options,"exclusiveEnabled",!0)}}class EvaluationItemModel{constructor(e){this.id=EvaluationItemModel.createChoiceId(),this.text=defaultText(e)}static createChoiceId(){return`Evaluation-Item-${_$1.now()}-${_$1.random(0,9999999)}`}}class StarEvaluationItemModel extends EvaluationItemModel{constructor(e){super(e)}}class QuestionOptionsModel{constructor(e){this.inputMinLength=10,this.required=e,this.visible=!0}}class QuestionHeaderModel{constructor(e){this.text=defaultText(e),this.number=null}}class SubQuestionModel{constructor(e){this.id=`SubQ-${_$1.now()}-${_$1.random(0,9999999)}`,this.text=defaultText(e),this.number=null}static createSubPrefixId(){return`SubQ-${_$1.now()}-`}}class BaseQuestionModel{constructor(e,t){this.id=BaseQuestionModel.createQuestionId(),this.type=e,this.header=new QuestionHeaderModel(t),this.options=new QuestionOptionsModel(!1)}static getMaxScore(e){if("SINGLE_SELECTION"==e.type)return _$1.max(_$1.map(e.choices,(e=>parseFloat(_$1.get(e,"options.score",0)||0))))||0;if("MULTI_SELECTION"==e.type){const t=_$1.sumBy(e.choices,(e=>parseFloat(_$1.get(e,"options.score")||0)));return Math.round(100*t)/100}if("MATRIX"==e.type){return(_$1.max(_$1.map(e.choices,(e=>parseFloat(_$1.get(e,"options.score",0)||0))))||0)*e.subQuestions.length}if("SCORING"==e.type){return e.options.maxRange*(_$1.isEmpty(e.subQuestions)?1:e.subQuestions.length)}return 0}static getScoreRange(e){if("SCORING"==e.type){return e.options.minRange+" - "+e.options.maxRange}return""}static createQuestionId(){return`Q-${_$1.now()}-${_$1.random(0,9999999)}`}static getNumber(e,t){return e+1}static refreshSurvey(e){this.rebuildQuestionNumber(e.questions),this.deleteUnusedProperties(e.questions),e.statistics.maxScore=this.calculationAllQuestionMaxScore(e.questions),e.statistics.questionCount=this.calculationAllQuestionCount(e.questions)}static calculationAllQuestionCount(e){let t=0;const i=["TEXT_TITLE"];return _$1.forEach(e,(e=>{_$1.includes(i,e.type)||t++})),t}static calculationAllQuestionMaxScore(e){let t=0;return _$1.forEach(e,(e=>{t+=this.getMaxScore(e)})),t}static setActiveQuestion(e,t){_$1.forEach(t,(t=>{t.id==e.id?t.active=!0:t.active=!1}))}static rebuildQuestionNumber(e){let t=0;_$1.forEach(e,(function(e){let i;i="TEXT_TITLE"===e.type?QuestionTextTitleModel.getNumber(t,e):"MATRIX"===e.type?QuestionMatrixModel.getNumber(t,e):"SCORING"===e.type?QuestionScoringModel.getNumber(t,e):BaseQuestionModel.getNumber(t,e),e.header.number=i,i&&(t=i)}))}static deleteUnusedProperties(e){_$1.forEach(e,(function(e){"SCORING"===e.type&&QuestionScoringModel.removeUnusedProperty(e)}))}}class QuestionCheckBoxModel extends BaseQuestionModel{constructor(e,t){super(e,t),this.choices=QuestionFactory.createSelectionQuestionChoices(t)}}class QuestionEvaluationModel extends BaseQuestionModel{constructor(e,t){super(e,t),this.evaluationItems=QuestionFactory.createEvaluationItems(t)}}class QuestionTextTitleModel extends BaseQuestionModel{constructor(e,t){super(e,t)}static getNumber(e,t){return null}}class QuestionMatrixModel extends BaseQuestionModel{constructor(e,t){super(e,t),this.choices=QuestionFactory.createMatrixQuestionChoices(t),this.subQuestions=[QuestionFactory.createSubQuestion(t)]}static getNumber(e,t){const i=e+1;return _$1.forEach(t.subQuestions,((e,t)=>{e.number=t+1})),i}}class QuestionScoringModel extends BaseQuestionModel{constructor(e,t){super(e,t),this.subQuestions=[]}static getNumber(e,t){const i=e+1;return _$1.forEach(t.subQuestions,((e,t)=>{e.number=t+1})),i}static removeUnusedProperty(e){delete e.options.sliderValue,_$1.forEach(e.subQuestions,(e=>{delete e.sliderValue}))}}const ZH_CN=_$1.camelCase("zh-CN"),EN_US=_$1.camelCase("en-US"),ZH_TW=_$1.camelCase("zh-TW");function getValue(e,t){const i=_$1.get(e,_$1.camelCase(t),"");return _$1.isEmpty(i)?_$1.get(e,t,""):i}function translate(e,t,i=!1){const n=getValue(e,t);return _$1.isEmpty(n)&&i?e[ZH_CN]||e["zh-CN"]||e[EN_US]||e["en-US"]||e[ZH_TW]||e["zh-TW"]:n}const CUSTOM_INPUT_REG=/(_{5,})/g;function formatTitle(e,t){const i=translate(e.header.text,t,!0);if(!_$1.get(e,"options.richTextEnabled",!1))return[i];return i.split(CUSTOM_INPUT_REG)}var LocaleMixin=Vue.extend({filters:{translate:(e,t)=>translate(e,Vue.$surveyLanguage,t)},methods:{setSurveyLanguage(e){Vue.$surveyLanguage=currentLang()||e.options.primaryLanguage},t(...e){return t.apply(this,e)},translate:(e,t)=>translate(e,Vue.$surveyLanguage,t)}}),SurveyTranslatorMixin=Vue.extend({data:()=>({SUB_QUESTION_TYPE:"SUB_QUESTION"}),methods:{getPrimaryLanguage:e=>e.options.primaryLanguage,getLanguagesExcludedPrimaryLanguage(e){const t=_$1.cloneDeep(e.options.languages);return _$1.pull(t,this.getPrimaryLanguage(e)),t},buildQuestionId:e=>"question-"+e.id,buildChoiceId:(e,t)=>"question-"+e.id+"choice-"+t.id,buildSubQuestionId:(e,t)=>"question-"+e.id+"sub-"+t.id,buildDataMap(e){const t={};return _$1.forEach(e,(e=>{t[e.tempId]=e,_$1.forEach(e.children,(e=>{t[e.tempId]=e})),_$1.forEach(e.subQuestions,(e=>{t[e.tempId]=e}))})),t},allTranslationIsCompleted(e){let t=!0;const i=_$1.cloneDeep(e.options.languages);return _$1.forEach(i,(i=>{this.translationIsCompleted(e,i)||(t=!1)})),t},translationIsCompleted(e,t){const i=_$1.camelCase(t);let n=!0;return _$1.forEach(e.questions,(function(e){if(!_$1.get(e,`header.text.${i}`))return n=!1,n;_$1.forEach(e.choices,(function(e){if(!_$1.get(e,`text.${i}`))return n=!1,n})),_$1.forEach(e.sub_questions,(function(e){if(!_$1.get(e,`text.${i}`))return n=!1,n}))})),n}}}),script=Vue.extend({name:"create-question-dropdown",mixins:[LocaleMixin],inject:["$rootComponent"],components:{Dropdown:Dropdown,DropdownMenu:DropdownMenu,DropdownItem:DropdownItem,Button:Button},props:{options:{type:Object,required:!1}},data:()=>({questionTypes:["SINGLE_SELECTION","MULTI_SELECTION","FILL_BLANK","SHORT_ANSWER","MATRIX","TEXT_TITLE","EVALUATION"]}),created(){this.options.enabledSpeciallyQuestions||_.remove(this.questionTypes,(e=>"EVALUATION"==e)),this.options.enabledScoringQuestion&&this.questionTypes.push("SCORING")},methods:{onCreate(e){this.$rootComponent.createQuestion(e)}}});function normalizeComponent(e,t,i,n,o,s,r,a,l,c){"boolean"!=typeof r&&(l=a,a=r,r=!1);const u="function"==typeof i?i.options:i;let d;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,o&&(u.functional=!0)),n&&(u._scopeId=n),s?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=d):t&&(d=r?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),d)if(u.functional){const e=u.render;u.render=function(t,i){return d.call(i),e(t,i)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,d):[d]}return i}const __vue_script__=script;var __vue_render__=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Dropdown",{attrs:{transfer:!0}},[i("Button",{attrs:{icon:"md-add",type:"primary"}},[e._v(e._s(e.t("survey_creator.question.create"))+"\n    ")]),e._v(" "),i("DropdownMenu",{attrs:{slot:"list"},slot:"list"},e._l(e.questionTypes,(function(t){return i("DropdownItem",{key:t,staticClass:"dropdown_item",nativeOn:{click:function(i){return e.onCreate(t)}}},[e._v(e._s(e.t("survey_creator.question.types."+t))+"\n        ")])})),1)],1)},__vue_staticRenderFns__=[];const __vue_inject_styles__=void 0,__vue_scope_id__=void 0,__vue_module_identifier__=void 0,__vue_is_functional_template__=!1,__vue_component__=normalizeComponent({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},undefined,__vue_script__,undefined,false,undefined,!1,void 0,void 0,void 0);var script$1=Vue.extend({name:"change-language",mixins:[LocaleMixin],inject:["$rootComponent"],components:{Button:Button,Row:Row,Col:Col,Icon:Icon,Dropdown:Dropdown,DropdownItem:DropdownItem,DropdownMenu:DropdownMenu},props:{languages:{type:Array,required:!0}},data:()=>({language:Vue.$surveyLanguage}),methods:{onChangeLanguage(e){this.language=e,this.$rootComponent.onChangeLanguage(e)}}});const __vue_script__$1=script$1;var __vue_render__$1=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Dropdown",[i("Button",{attrs:{type:"primary"}},[e._v("\n    "+e._s(e.t("survey_creator.common.languages."+this.language))+"\n    "),i("Icon",{attrs:{type:"ios-arrow-down"}})],1),e._v(" "),i("DropdownMenu",{attrs:{slot:"list"},slot:"list"},e._l(e.languages,(function(t){return i("DropdownItem",{key:t,attrs:{transfer:!0},nativeOn:{click:function(i){return e.onChangeLanguage(t)}}},[e._v(e._s(e.t("survey_creator.common.languages."+t)))])})),1)],1)},__vue_staticRenderFns__$1=[];const __vue_inject_styles__$1=void 0,__vue_scope_id__$1=void 0,__vue_module_identifier__$1=void 0,__vue_is_functional_template__$1=!1,__vue_component__$1=normalizeComponent({render:__vue_render__$1,staticRenderFns:__vue_staticRenderFns__$1},undefined,__vue_script__$1,undefined,false,undefined,!1,void 0,void 0,void 0);var script$2=Vue.extend({name:"toolbar",mixins:[LocaleMixin],inject:["$rootComponent"],components:{Row:Row,Col:Col,Button:Button,CreateQuestionDropdown:__vue_component__,ChangeLanguage:__vue_component__$1},props:{survey:{type:Object,required:!0},createQuestion:{type:Boolean,required:!1,default:!0},preview:{type:Boolean,required:!1,default:!0},changeLanguage:{type:Boolean,required:!1,default:!0}},methods:{onCreate(e){this.$rootComponent.createQuestion(e)}}});const __vue_script__$2=script$2;var __vue_render__$2=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Row",{staticClass:"toolbar-wrapper",attrs:{type:"flex",justify:"end",align:"middle",gutter:20}},[e.preview?i("Col",[i("Button",{attrs:{icon:"ios-search",type:"primary"},on:{click:this.$rootComponent.onPreview}},[e._v(e._s(e.t("survey_creator.common.settings.preview"))+"\n    ")])],1):e._e(),e._v(" "),e.changeLanguage?i("Col",[i("change-language",{attrs:{languages:e.survey.options.languages}})],1):e._e()],1)},__vue_staticRenderFns__$2=[];const __vue_inject_styles__$2=void 0,__vue_scope_id__$2=void 0,__vue_module_identifier__$2=void 0,__vue_is_functional_template__$2=!1,__vue_component__$2=normalizeComponent({render:__vue_render__$2,staticRenderFns:__vue_staticRenderFns__$2},undefined,__vue_script__$2,undefined,false,undefined,!1,void 0,void 0,void 0);var script$3=Vue.component("question-title-dynamic",{components:{Input:Input$1},props:{splitedTitles:{type:Array,required:!0},customFilledTitle:{type:Array,required:!1}},render(e){let t=[];const i=this;return _$1.forEach(this.splitedTitles,((n,o)=>{if(CUSTOM_INPUT_REG.test(n)){let n=_$1.find(i.customFilledTitle,(e=>e.index===o));void 0!==n&&t.push(e(Input$1,{domProps:{value:n.title},props:{value:n.title},on:{input:function(e){n.title=e}}}))}else t.push(n)})),e("div",{class:"content pl-sm"},t)}});const isOldIE="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function createInjector(e){return(e,t)=>addStyle(e,t)}let HEAD;const styles={};function addStyle(e,t){const i=isOldIE?t.media||"default":e,n=styles[i]||(styles[i]={ids:new Set,styles:[]});if(!n.ids.has(e)){n.ids.add(e);let i=t.source;if(t.map&&(i+="\n/*# sourceURL="+t.map.sources[0]+" */",i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",t.media&&n.element.setAttribute("media",t.media),void 0===HEAD&&(HEAD=document.head||document.getElementsByTagName("head")[0]),HEAD.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(i),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{const e=n.ids.size-1,t=document.createTextNode(i),o=n.element.childNodes;o[e]&&n.element.removeChild(o[e]),o.length?n.element.insertBefore(t,o[e]):n.element.appendChild(t)}}}const __vue_script__$3=script$3,__vue_inject_styles__$3=function(e){e&&e("data-v-282886be_0",{source:"[data-v-282886be] .ivu-input-wrapper{width:auto}",map:void 0,media:void 0})},__vue_scope_id__$3="data-v-282886be",__vue_module_identifier__$3=void 0,__vue_is_functional_template__$3=void 0,__vue_component__$3=normalizeComponent({},__vue_inject_styles__$3,__vue_script__$3,"data-v-282886be",undefined,undefined,!1,createInjector,void 0,void 0);var script$4=Vue.extend({name:"question-title",components:{Icon:Icon,Input:Input$1,QuestionTitleDynamic:__vue_component__$3},mixins:[LocaleMixin],inject:["$rootComponent"],props:{question:{type:Object,required:!0},customQuestion:{type:Object,required:!1}},computed:{customFilledTitle(){return this.customQuestion?.filledTitle},maxScore(){return BaseQuestionModel.getMaxScore(this.question)},haveScoreRange(){return"SCORING"==this.question.type},scoreRange(){return BaseQuestionModel.getScoreRange(this.question)},haveMaxScore(){return _$1.get(this.question,"options.scoringEnabled",!1)&&"SCORING"!=this.question.type},haveStar(){return _$1.get(this.question,"options.starEnabled",!1)},isSingleSelection(){return"SINGLE_SELECTION"==this.question.type}},methods:{getTitle:e=>formatTitle(e,Vue.$surveyLanguage)}});const __vue_script__$4=script$4;var __vue_render__$3=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"question-title"},[i("label",{staticClass:"star",staticStyle:{"padding-top":"4px"}},[e._v(e._s(e.question.options.required?"*":""))]),e._v(" "),e.question.header.number?i("span",{staticClass:"number pl-sm",staticStyle:{"padding-top":"4px"}},[e._v(e._s(e.question.header.number)+".")]):e._e(),e._v(" "),e.question?i("question-title-dynamic",{attrs:{splitedTitles:e.getTitle(e.question),customFilledTitle:e.customFilledTitle}}):e._e(),e._v(" "),e.haveMaxScore?i("span",{staticClass:"options-explain pl-sm title-score-related",staticStyle:{"padding-top":"4px"}},[e._v("("+e._s(e.t("survey_creator.question.max_score",e.$rootComponent.currentLanguage))+e._s(e.maxScore)+")\n")]):e._e(),e._v(" "),e.haveScoreRange?i("span",{staticClass:"options-explain pl-sm title-score-related"},[e._v("("+e._s(e.t("survey_creator.question.scoring.scoreRange",e.$rootComponent.currentLanguage))+e._s(e.scoreRange)+")\n")]):e._e(),e._v(" "),e.haveStar?i("span",{staticClass:"options-explain pl-sm"},[e.isSingleSelection?i("span",[e._v("\n    ("+e._s(e.t("survey_creator.question.star_single",e.$rootComponent.currentLanguage))+"\n    "),i("span",[i("Icon",{attrs:{type:"md-star",color:"orange",size:16}})],1),e._v(")\n  ")]):i("span",[e._v("\n    (\n    "+e._s(e.t("survey_creator.question.star_single",e.$rootComponent.currentLanguage))+"\n    "),i("Icon",{attrs:{type:"md-star",color:"orange",size:16}}),e._v("\n    "+e._s(e.t("survey_creator.question.star_multi_prefix",e.$rootComponent.currentLanguage))+"\n    "+e._s(e.question.options.starMinCount)+"\n    "+e._s(e.t("survey_creator.question.star_multi_suffix",e.$rootComponent.currentLanguage))+"\n    )\n  ")],1)]):e._e()],1)},__vue_staticRenderFns__$3=[];const __vue_inject_styles__$4=function(e){e&&e("data-v-c07f8646_0",{source:".flex[data-v-c07f8646]{display:flex;align-items:center}.pl-sm[data-v-c07f8646]{padding-left:4px}.title-score-related[data-v-c07f8646]{min-width:90px}",map:void 0,media:void 0})},__vue_scope_id__$4="data-v-c07f8646",__vue_module_identifier__$4=void 0,__vue_is_functional_template__$4=!1,__vue_component__$4=normalizeComponent({render:__vue_render__$3,staticRenderFns:__vue_staticRenderFns__$3},__vue_inject_styles__$4,__vue_script__$4,"data-v-c07f8646",false,undefined,!1,createInjector,void 0,void 0);var script$5=Vue.extend({name:"clickable-icon",components:{Tooltip:Tooltip$1,Icon:Icon},props:{tooltip:String,type:String,custom:String,size:{type:[Number,String],default:"24"},to:{type:String,required:!1}},methods:{click(){this.to?this.$go(this.to):this.$emit("click")}}});const __vue_script__$5=script$5;var __vue_render__$4=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.tooltip?i("Tooltip",{attrs:{content:e.tooltip,transfer:!0}},[i("span",{staticClass:"icon-button hover-able",on:{click:e.click}},[i("Icon",{attrs:{type:e.type,custom:e.custom,size:e.size}})],1)]):i("span",{staticClass:"icon-button hover-able"},[i("Icon",{attrs:{type:e.type,custom:e.custom,size:e.size},on:{click:e.click}})],1)},__vue_staticRenderFns__$4=[];const __vue_inject_styles__$5=function(e){e&&e("data-v-4c0c6e94_0",{source:".icon-button{cursor:pointer;line-height:1.5}",map:void 0,media:void 0})},__vue_scope_id__$5=void 0,__vue_module_identifier__$5=void 0,__vue_is_functional_template__$5=!1,__vue_component__$5=normalizeComponent({render:__vue_render__$4,staticRenderFns:__vue_staticRenderFns__$4},__vue_inject_styles__$5,__vue_script__$5,undefined,false,undefined,!1,createInjector,void 0,void 0);var script$6=Vue.extend({name:"editor-question-toolbar",components:{Row:Row,Col:Col,ClickableIcon:__vue_component__$5,Badge:Badge,Tooltip:Tooltip$1,Modal:Modal},mixins:[LocaleMixin],props:{edit:{type:Boolean,required:!1,default:!0},copy:{type:Boolean,required:!1,default:!0},enableDelete:{type:Boolean,required:!1,default:!0},enabledJump:{type:Boolean,required:!1,default:!1},question:{type:Object,required:!0},survey:{type:Object,required:!0}},computed:{jumps(){return _$1.get(this.question,"jumps",[])},editable(){return _$1.get(this.question,"options.editable",!0)}},methods:{onEdit(){this.$emit("on-edit")},onCopy(){this.$emit("on-copy")},onDelete(){let e=_$1.map(_$1.flatMap(this.survey.questions,(e=>_$1.get(e,"jumps",[]))),"toQuestionId");this.jumps.length>0||_$1.includes(e,this.question.id)?Modal.confirm({title:this.t("survey_creator.question.jump.delete_question"),content:this.t("survey_creator.question.jump.delete_question_desc"),onOk:()=>{this.$emit("on-delete")}}):this.$emit("on-delete")},onJump(){this.$emit("on-jump")}}}),__$_require_images_jump_svg__="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMCAyMSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYuMzI4ODcgNi40MTQ4N0wxMy4zNTk4IDYuNDE0ODciIHN0cm9rZT0iIzcwNzQ4QyIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8cGF0aCBkPSJNOS44NDQzNiA2LjQxNDg5VjEyLjExODRDOS44NDQzNiAxMy4yMjMgMTAuNzM5OCAxNC4xMTg0IDExLjg0NDQgMTQuMTE4NEgxMy4yMjk3IiBzdHJva2U9IiM3MDc0OEMiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KPGNpcmNsZSBjeD0iNC4yNDU1MyIgY3k9IjYuNDE0ODgiIHI9IjIuMDgzMzMiIHN0cm9rZT0iIzcwNzQ4QyIgc3Ryb2tlLXdpZHRoPSIxLjUiLz4KPGVsbGlwc2UgY3g9IjE1LjQ0MzIiIGN5PSI2LjQxNDg4IiByeD0iMi4wODMzMyIgcnk9IjIuMDgzMzMiIHN0cm9rZT0iIzcwNzQ4QyIgc3Ryb2tlLXdpZHRoPSIxLjUiLz4KPGVsbGlwc2UgY3g9IjE1LjQ0MzIiIGN5PSIxMy45NzIxIiByeD0iMi4wODMzMyIgcnk9IjIuMDgzMzMiIHN0cm9rZT0iIzcwNzQ4QyIgc3Ryb2tlLXdpZHRoPSIxLjUiLz4KPC9zdmc+Cg==";const __vue_script__$6=script$6;var __vue_render__$5=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Row",{staticClass:"editor-question-toolbar",attrs:{gutter:8,type:"flex",justify:"center",align:"middle"}},[e.enabledJump?i("Col",{staticStyle:{width:"32px"}},[i("Badge",{attrs:{count:e.jumps.length}},[i("Tooltip",{attrs:{content:e.t("survey_creator.common.tips.jump"),transfer:!0}},[i("img",{staticStyle:{"margin-top":"4px",cursor:"pointer"},attrs:{src:__$_require_images_jump_svg__},on:{click:e.onJump}})])],1)],1):e._e(),e._v(" "),e.edit&&e.editable?i("Col",[i("clickable-icon",{attrs:{tooltip:e.t("survey_creator.common.tips.edit"),type:"ios-create-outline"},on:{click:e.onEdit}})],1):e._e(),e._v(" "),e.copy&&e.editable?i("Col",[i("clickable-icon",{attrs:{tooltip:e.t("survey_creator.common.tips.copy"),type:"ios-copy-outline"},on:{click:e.onCopy}})],1):e._e(),e._v(" "),e.enableDelete&&e.editable?i("Col",[i("clickable-icon",{attrs:{tooltip:e.t("survey_creator.common.tips.delete"),type:"ios-trash-outline"},on:{click:e.onDelete}})],1):e._e()],1)},__vue_staticRenderFns__$5=[];const __vue_inject_styles__$6=void 0,__vue_scope_id__$6=void 0,__vue_module_identifier__$6=void 0,__vue_is_functional_template__$6=!1,__vue_component__$6=normalizeComponent({render:__vue_render__$5,staticRenderFns:__vue_staticRenderFns__$5},undefined,__vue_script__$6,undefined,false,undefined,!1,void 0,void 0,void 0);var script$7=Vue.extend({name:"question-default-layout",components:{Row:Row,Col:Col,QuestionTitle:__vue_component__$4,EditQuestionToolbar:__vue_component__$6},mixins:[LocaleMixin],inject:["$rootComponent"],props:{question:{type:Object,required:!0},survey:{type:Object,required:!0}},computed:{customQuestion(){let e=[];return _$1.each(formatTitle(this.question,Vue.$surveyLanguage),((t,i)=>{if(CUSTOM_INPUT_REG.test(t)){let t={title:"",index:i};e.push(t)}})),{id:this.question.id,surveyId:this.survey.id,filledTitle:e}},enabledJump(){return"SINGLE_SELECTION"===_$1.get(this.question,"type")&&_$1.get(this.$rootComponent,"options.enabledJump")}},methods:{onEdit(){this.$rootComponent.onQuestionEdit(this.question.id)},onCopy(){this.$rootComponent.onQuestionCopy(this.question.id)},onDelete(){this.$rootComponent.onQuestionDelete(this.question.id)},onJump(){this.$rootComponent.onQuestionJump(this.question.id)}}});const __vue_script__$7=script$7;var __vue_render__$6=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"question"},[i("Row",{attrs:{type:"flex",justify:"space-between",align:"middle"}},[i("Col",[i("question-title",{attrs:{question:e.question,"custom-question":e.customQuestion,"max-score":!0}})],1),e._v(" "),i("Col",[i("edit-question-toolbar",{attrs:{"enabled-jump":e.enabledJump,question:e.question,survey:e.survey},on:{"on-edit":e.onEdit,"on-copy":e.onCopy,"on-delete":e.onDelete,"on-jump":e.onJump}})],1)],1),e._v(" "),e._t("default")],2)},__vue_staticRenderFns__$6=[];const __vue_inject_styles__$7=function(e){e&&e("data-v-680b4aab_0",{source:".question .ivu-row[data-v-680b4aab]{flex-flow:row}",map:void 0,media:void 0})},__vue_scope_id__$7="data-v-680b4aab",__vue_module_identifier__$7=void 0,__vue_is_functional_template__$7=!1,__vue_component__$7=normalizeComponent({render:__vue_render__$6,staticRenderFns:__vue_staticRenderFns__$6},__vue_inject_styles__$7,__vue_script__$7,"data-v-680b4aab",false,undefined,!1,createInjector,void 0,void 0);var script$8=Vue.extend({name:"single-selection",components:{Row:Row,Col:Col,Radio:Radio,RadioGroup:RadioGroup,Icon:Icon,Input:Input$1},mixins:[LocaleMixin],inject:["$rootComponent"],props:{question:{type:Object,required:!0},survey:{type:Object,required:!0}},data(){return{choiceClasses:this.buildChoiceClasses()}},computed:{haveMaxScore(){return _$1.get(this.question,"options.scoringEnabled",!1)},jumps(){return _$1.get(this.question,"jumps",[])}},watch:{"question.options.layout"(){this.choiceClasses=this.buildChoiceClasses()}},methods:{buildChoiceClasses(){return["question-choice",`question-choice-${_$1.lowerCase(this.question.options.layout||"HORIZONTAL")}`]},haveStar:e=>e.options?.star??!1,getJumpDesc(e){let t=_$1.find(this.jumps,(t=>t.choiceId===e));if(_$1.isEmpty(t))return null;let i=_$1.find(this.survey.questions,(e=>e.id===t.toQuestionId));return this.t("survey_creator.question.jump.selected_jump",[i.header.number])}}});const __vue_script__$8=script$8;var __vue_render__$7=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("RadioGroup",{attrs:{vertical:e.vertical}},[i("Row",{attrs:{type:"flex",justify:"start",gutter:50}},e._l(e.question.choices,(function(t){return i("Col",{key:t.id,class:e.choiceClasses},[i("Radio",{attrs:{label:t.id,disabled:e.question.options.readonly},nativeOn:{click:function(i){return e.toggleAnswer(t.id)}}},[e.haveStar(t)?i("span",[i("Icon",{attrs:{type:"md-star",color:"orange",size:16}})],1):e._e(),e._v(" "),i("span",{staticClass:"choice-title"},[e._v(e._s(e._f("translate")(t.text,!0)))]),e._v(" "),e.haveMaxScore?i("span",{staticClass:"choice-score mr-small"},[e._v(e._s("("+(t.options.score||0)+" "+e.t("survey_creator.question.scores",e.$rootComponent.currentLanguage)+")"))]):e._e(),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.options.inputEnabled&&e.question.options.inputtedEnabled,expression:"\n            choice.options.inputEnabled && question.options.inputtedEnabled\n          "}],staticClass:"mr-small"},[i("Input")],1),e._v(" "),i("span",{staticClass:"jump-desc"},[e._v(e._s(e.getJumpDesc(t.id)))])])],1)})),1)],1)},__vue_staticRenderFns__$7=[];const __vue_inject_styles__$8=function(e){e&&e("data-v-74bc869a_0",{source:".ivu-row-flex-start[data-v-74bc869a]{align-items:center}.ivu-radio-group-item[data-v-74bc869a]{display:flex;flex-direction:row;align-items:center}.choice-title[data-v-74bc869a]{margin-left:8px;margin-right:8px}.mr-small[data-v-74bc869a]{margin-right:8px}",map:void 0,media:void 0})},__vue_scope_id__$8="data-v-74bc869a",__vue_module_identifier__$8=void 0,__vue_is_functional_template__$8=!1,__vue_component__$8=normalizeComponent({render:__vue_render__$7,staticRenderFns:__vue_staticRenderFns__$7},__vue_inject_styles__$8,__vue_script__$8,"data-v-74bc869a",false,undefined,!1,createInjector,void 0,void 0);var script$9=Vue.extend({name:"multi-selection",components:{Row:Row,Col:Col,Checkbox:Checkbox,CheckboxGroup:CheckboxGroup,Input:Input$1},mixins:[LocaleMixin],inject:["$rootComponent"],props:{question:{type:Object,required:!0}},data(){return{choiceClasses:this.buildChoiceClasses(),value:{answer:[]}}},computed:{haveMaxScore(){return _$1.get(this.question,"options.scoringEnabled",!1)}},watch:{"question.options.layout"(){this.choiceClasses=this.buildChoiceClasses()}},methods:{buildChoiceClasses(){return["question-choice",`question-choice-${_$1.lowerCase(this.question.options.layout||"HORIZONTAL")}`]},setCheckboxStatus(){let e="";const t=new Array;_$1.each(this.question.choices,(i=>{i.options.exclusiveEnabled?e=i.id:t.push(i)})),_$1.each(t,(t=>{_$1.includes(this.value.answer,e)?t.readonly=!0:t.readonly=!1}))},selChange(e){_$1.each(this.question.choices,(t=>{_$1.each(e,(e=>{t.id==e&&t.options.exclusiveEnabled&&(this.value.answer=[e])}))})),this.setCheckboxStatus()}}});const __vue_script__$9=script$9;var __vue_render__$8=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("CheckboxGroup",{on:{"on-change":e.selChange},model:{value:e.value.answer,callback:function(t){e.$set(e.value,"answer",t)},expression:"value.answer"}},[i("Row",{attrs:{type:"flex",justify:"start",gutter:50}},e._l(e.question.choices,(function(t){return i("Col",{key:t.id,class:e.choiceClasses},[i("Checkbox",{attrs:{label:t.id,disabled:e.question.options.readonly||t.readonly}},[i("span",{staticClass:"choice-title"},[e._v(e._s(e._f("translate")(t.text,!0)))]),e._v(" "),e.haveMaxScore?i("span",{staticClass:"choice-score"},[e._v(e._s("("+(t.options.score||0)+" "+e.t("survey_creator.question.scores",e.$rootComponent.currentLanguage)+")"))]):e._e(),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.options.inputEnabled&&e.question.options.inputtedEnabled,expression:"\n            choice.options.inputEnabled && question.options.inputtedEnabled\n          "}]},[i("Input")],1)])],1)})),1)],1)},__vue_staticRenderFns__$8=[];const __vue_inject_styles__$9=function(e){e&&e("data-v-528d90ae_0",{source:".ivu-row-flex-start[data-v-528d90ae]{align-items:center}.ivu-checkbox-group-item[data-v-528d90ae]{display:flex;flex-direction:row;align-items:center}.choice-title[data-v-528d90ae]{margin-left:8px;margin-right:8px}.choice-score[data-v-528d90ae]{margin-right:8px}",map:void 0,media:void 0})},__vue_scope_id__$9="data-v-528d90ae",__vue_module_identifier__$9=void 0,__vue_is_functional_template__$9=!1,__vue_component__$9=normalizeComponent({render:__vue_render__$8,staticRenderFns:__vue_staticRenderFns__$8},__vue_inject_styles__$9,__vue_script__$9,"data-v-528d90ae",false,undefined,!1,createInjector,void 0,void 0);var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol=root.Symbol,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=Symbol?Symbol.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty.call(e,symToStringTag),i=e[symToStringTag];try{e[symToStringTag]=void 0;var n=!0}catch(e){}var o=nativeObjectToString.call(e);return n&&(t?e[symToStringTag]=i:delete e[symToStringTag]),o}var objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString;function objectToString(e){return nativeObjectToString$1.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag$1=Symbol?Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag$1&&symToStringTag$1 in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==typeof e}var isArray=Array.isArray;function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function identity(e){return e}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto=Function.prototype,funcToString=funcProto.toString;function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$2=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$1=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$1).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue$1(e,t){return null==e?void 0:e[t]}function getNative(e,t){var i=getValue$1(e,t);return baseIsNative(i)?i:void 0}var WeakMap$1=getNative(root,"WeakMap"),objectCreate=Object.create,baseCreate=function(){function e(){}return function(t){if(!isObject(t))return{};if(objectCreate)return objectCreate(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function apply(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function copyArray(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}var HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut(e){var t=0,i=0;return function(){var n=nativeNow(),o=HOT_SPAN-(n-i);if(i=n,o>0){if(++t>=HOT_COUNT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function constant(e){return function(){return e}}var defineProperty=function(){try{var e=getNative(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),baseSetToString=defineProperty?function(e,t){return defineProperty(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity,setToString=shortOut(baseSetToString);function arrayEach(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););return e}var MAX_SAFE_INTEGER=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var i=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER:t)&&("number"==i||"symbol"!=i&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}function baseAssignValue(e,t,i){"__proto__"==t&&defineProperty?defineProperty(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function eq(e,t){return e===t||e!=e&&t!=t}var objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty;function assignValue(e,t,i){var n=e[t];hasOwnProperty$2.call(e,t)&&eq(n,i)&&(void 0!==i||t in e)||baseAssignValue(e,t,i)}function copyObject(e,t,i,n){var o=!i;i||(i={});for(var s=-1,r=t.length;++s<r;){var a=t[s],l=n?n(i[a],e[a],a,i,e):void 0;void 0===l&&(l=e[a]),o?baseAssignValue(i,a,l):assignValue(i,a,l)}return i}var nativeMax=Math.max;function overRest(e,t,i){return t=nativeMax(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,s=nativeMax(n.length-t,0),r=Array(s);++o<s;)r[o]=n[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=n[o];return a[t]=i(r),apply(e,this,a)}}function baseRest(e,t){return setToString(overRest(e,t,identity),e+"")}var MAX_SAFE_INTEGER$1=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER$1}function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function isIterateeCall(e,t,i){if(!isObject(i))return!1;var n=typeof t;return!!("number"==n?isArrayLike(i)&&isIndex(t,i.length):"string"==n&&t in i)&&eq(i[t],e)}function createAssigner(e){return baseRest((function(t,i){var n=-1,o=i.length,s=o>1?i[o-1]:void 0,r=o>2?i[2]:void 0;for(s=e.length>3&&"function"==typeof s?(o--,s):void 0,r&&isIterateeCall(i[0],i[1],r)&&(s=o<3?void 0:s,o=1),t=Object(t);++n<o;){var a=i[n];a&&e(t,a,n,s)}return t}))}var objectProto$4=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$4)}function baseTimes(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}var argsTag="[object Arguments]";function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==argsTag}var objectProto$5=Object.prototype,hasOwnProperty$3=objectProto$5.hasOwnProperty,propertyIsEnumerable=objectProto$5.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&hasOwnProperty$3.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")};function stubFalse(){return!1}var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer=moduleExports?root.Buffer:void 0,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,argsTag$1="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag$1="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!typedArrayTags[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal.process,nodeUtil=function(){try{var e=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return e||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,objectProto$6=Object.prototype,hasOwnProperty$4=objectProto$6.hasOwnProperty;function arrayLikeKeys(e,t){var i=isArray(e),n=!i&&isArguments(e),o=!i&&!n&&isBuffer(e),s=!i&&!n&&!o&&isTypedArray(e),r=i||n||o||s,a=r?baseTimes(e.length,String):[],l=a.length;for(var c in e)!t&&!hasOwnProperty$4.call(e,c)||r&&("length"==c||o&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||isIndex(c,l))||a.push(c);return a}function overArg(e,t){return function(i){return e(t(i))}}var nativeKeys=overArg(Object.keys,Object),objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys(e);var t=[];for(var i in Object(e))hasOwnProperty$5.call(e,i)&&"constructor"!=i&&t.push(i);return t}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function nativeKeysIn(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}var objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function baseKeysIn(e){if(!isObject(e))return nativeKeysIn(e);var t=isPrototype(e),i=[];for(var n in e)("constructor"!=n||!t&&hasOwnProperty$6.call(e,n))&&i.push(n);return i}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED="__lodash_hash_undefined__",objectProto$9=Object.prototype,hasOwnProperty$7=objectProto$9.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var i=t[e];return i===HASH_UNDEFINED?void 0:i}return hasOwnProperty$7.call(t,e)?t[e]:void 0}var objectProto$a=Object.prototype,hasOwnProperty$8=objectProto$a.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty$8.call(t,e)}var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}function Hash(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(e,t){for(var i=e.length;i--;)if(eq(e[i][0],t))return i;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,i=assocIndexOf(t,e);return!(i<0)&&(i==t.length-1?t.pop():splice.call(t,i,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,i=assocIndexOf(t,e);return i<0?void 0:t[i][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var i=this.__data__,n=assocIndexOf(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this}function ListCache(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var i=e.__data__;return isKeyable(t)?i["string"==typeof t?"string":"hash"]:i.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var i=getMapData(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this}function MapCache(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function arrayPush(e,t){for(var i=-1,n=t.length,o=e.length;++i<n;)e[o+i]=t[i];return e}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var getPrototype=overArg(Object.getPrototypeOf,Object),objectTag$1="[object Object]",funcProto$2=Function.prototype,objectProto$b=Object.prototype,funcToString$2=funcProto$2.toString,hasOwnProperty$9=objectProto$b.hasOwnProperty,objectCtorString=funcToString$2.call(Object);function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=objectTag$1)return!1;var t=getPrototype(e);if(null===t)return!0;var i=hasOwnProperty$9.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&funcToString$2.call(i)==objectCtorString}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}var LARGE_ARRAY_SIZE=200;function stackSet(e,t){var i=this.__data__;if(i instanceof ListCache){var n=i.__data__;if(!Map||n.length<LARGE_ARRAY_SIZE-1)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new MapCache(n)}return i.set(e,t),this.size=i.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function baseAssign(e,t){return e&&copyObject(t,keys(t),e)}function baseAssignIn(e,t){return e&&copyObject(t,keysIn(t),e)}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var freeExports$2="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$2=freeModule$2&&freeModule$2.exports===freeExports$2,Buffer$1=moduleExports$2?root.Buffer:void 0,allocUnsafe=Buffer$1?Buffer$1.allocUnsafe:void 0;function cloneBuffer(e,t){if(t)return e.slice();var i=e.length,n=allocUnsafe?allocUnsafe(i):new e.constructor(i);return e.copy(n),n}function arrayFilter(e,t){for(var i=-1,n=null==e?0:e.length,o=0,s=[];++i<n;){var r=e[i];t(r,i,e)&&(s[o++]=r)}return s}function stubArray(){return[]}var objectProto$c=Object.prototype,propertyIsEnumerable$1=objectProto$c.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable$1.call(e,t)})))}:stubArray;function copySymbols(e,t){return copyObject(e,getSymbols(e),t)}var nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbolsIn=nativeGetSymbols$1?function(e){for(var t=[];e;)arrayPush(t,getSymbols(e)),e=getPrototype(e);return t}:stubArray;function copySymbolsIn(e,t){return copyObject(e,getSymbolsIn(e),t)}function baseGetAllKeys(e,t,i){var n=t(e);return isArray(e)?n:arrayPush(n,i(e))}function getAllKeys(e){return baseGetAllKeys(e,keys,getSymbols)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,getSymbolsIn)}var DataView=getNative(root,"DataView"),Promise$1=getNative(root,"Promise"),Set$1=getNative(root,"Set"),mapTag$1="[object Map]",objectTag$2="[object Object]",promiseTag="[object Promise]",setTag$1="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$1="[object DataView]",dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap$1),getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag$1||Map&&getTag(new Map)!=mapTag$1||Promise$1&&getTag(Promise$1.resolve())!=promiseTag||Set$1&&getTag(new Set$1)!=setTag$1||WeakMap$1&&getTag(new WeakMap$1)!=weakMapTag$1)&&(getTag=function(e){var t=baseGetTag(e),i=t==objectTag$2?e.constructor:void 0,n=i?toSource(i):"";if(n)switch(n){case dataViewCtorString:return dataViewTag$1;case mapCtorString:return mapTag$1;case promiseCtorString:return promiseTag;case setCtorString:return setTag$1;case weakMapCtorString:return weakMapTag$1}return t});var getTag$1=getTag,objectProto$d=Object.prototype,hasOwnProperty$a=objectProto$d.hasOwnProperty;function initCloneArray(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&hasOwnProperty$a.call(e,"index")&&(i.index=e.index,i.input=e.input),i}var Uint8Array=root.Uint8Array;function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}function cloneDataView(e,t){var i=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}var reFlags=/\w*$/;function cloneRegExp(e){var t=new e.constructor(e.source,reFlags.exec(e));return t.lastIndex=e.lastIndex,t}var symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function cloneSymbol(e){return symbolValueOf?Object(symbolValueOf.call(e)):{}}function cloneTypedArray(e,t){var i=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var boolTag$1="[object Boolean]",dateTag$1="[object Date]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag(e,t,i){var n=e.constructor;switch(t){case arrayBufferTag$1:return cloneArrayBuffer(e);case boolTag$1:case dateTag$1:return new n(+e);case dataViewTag$2:return cloneDataView(e,i);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(e,i);case mapTag$2:return new n;case numberTag$1:case stringTag$1:return new n(e);case regexpTag$1:return cloneRegExp(e);case setTag$2:return new n;case symbolTag:return cloneSymbol(e)}}function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:baseCreate(getPrototype(e))}var mapTag$3="[object Map]";function baseIsMap(e){return isObjectLike(e)&&getTag$1(e)==mapTag$3}var nodeIsMap=nodeUtil&&nodeUtil.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,setTag$3="[object Set]";function baseIsSet(e){return isObjectLike(e)&&getTag$1(e)==setTag$3}var nodeIsSet=nodeUtil&&nodeUtil.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4,argsTag$2="[object Arguments]",arrayTag$1="[object Array]",boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$1="[object Error]",funcTag$2="[object Function]",genTag$1="[object GeneratorFunction]",mapTag$4="[object Map]",numberTag$2="[object Number]",objectTag$3="[object Object]",regexpTag$2="[object RegExp]",setTag$4="[object Set]",stringTag$2="[object String]",symbolTag$1="[object Symbol]",weakMapTag$2="[object WeakMap]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",cloneableTags={};function baseClone(e,t,i,n,o,s){var r,a=t&CLONE_DEEP_FLAG,l=t&CLONE_FLAT_FLAG,c=t&CLONE_SYMBOLS_FLAG;if(i&&(r=o?i(e,n,o,s):i(e)),void 0!==r)return r;if(!isObject(e))return e;var u=isArray(e);if(u){if(r=initCloneArray(e),!a)return copyArray(e,r)}else{var d=getTag$1(e),p=d==funcTag$2||d==genTag$1;if(isBuffer(e))return cloneBuffer(e,a);if(d==objectTag$3||d==argsTag$2||p&&!o){if(r=l||p?{}:initCloneObject(e),!a)return l?copySymbolsIn(e,baseAssignIn(r,e)):copySymbols(e,baseAssign(r,e))}else{if(!cloneableTags[d])return o?e:{};r=initCloneByTag(e,d,a)}}s||(s=new Stack);var h=s.get(e);if(h)return h;s.set(e,r),isSet(e)?e.forEach((function(n){r.add(baseClone(n,t,i,n,e,s))})):isMap(e)&&e.forEach((function(n,o){r.set(o,baseClone(n,t,i,o,e,s))}));var _=u?void 0:(c?l?getAllKeysIn:getAllKeys:l?keysIn:keys)(e);return arrayEach(_||e,(function(n,o){_&&(n=e[o=n]),assignValue(r,o,baseClone(n,t,i,o,e,s))})),r}cloneableTags[argsTag$2]=cloneableTags[arrayTag$1]=cloneableTags[arrayBufferTag$2]=cloneableTags[dataViewTag$3]=cloneableTags[boolTag$2]=cloneableTags[dateTag$2]=cloneableTags[float32Tag$2]=cloneableTags[float64Tag$2]=cloneableTags[int8Tag$2]=cloneableTags[int16Tag$2]=cloneableTags[int32Tag$2]=cloneableTags[mapTag$4]=cloneableTags[numberTag$2]=cloneableTags[objectTag$3]=cloneableTags[regexpTag$2]=cloneableTags[setTag$4]=cloneableTags[stringTag$2]=cloneableTags[symbolTag$1]=cloneableTags[uint8Tag$2]=cloneableTags[uint8ClampedTag$2]=cloneableTags[uint16Tag$2]=cloneableTags[uint32Tag$2]=!0,cloneableTags[errorTag$1]=cloneableTags[funcTag$2]=cloneableTags[weakMapTag$2]=!1;var CLONE_DEEP_FLAG$1=1,CLONE_SYMBOLS_FLAG$1=4;function cloneDeep(e){return baseClone(e,CLONE_DEEP_FLAG$1|CLONE_SYMBOLS_FLAG$1)}var HASH_UNDEFINED$2="__lodash_hash_undefined__";function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED$2),this}function setCacheHas(e){return this.__data__.has(e)}function SetCache(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new MapCache;++t<i;)this.add(e[t])}function arraySome(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function cacheHas(e,t){return e.has(t)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;function equalArrays(e,t,i,n,o,s){var r=i&COMPARE_PARTIAL_FLAG,a=e.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,h=i&COMPARE_UNORDERED_FLAG?new SetCache:void 0;for(s.set(e,t),s.set(t,e);++d<a;){var _=e[d],m=t[d];if(n)var g=r?n(m,_,d,t,e,s):n(_,m,d,e,t,s);if(void 0!==g){if(g)continue;p=!1;break}if(h){if(!arraySome(t,(function(e,t){if(!cacheHas(h,t)&&(_===e||o(_,e,i,n,s)))return h.push(t)}))){p=!1;break}}else if(_!==m&&!o(_,m,i,n,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function mapToArray(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function setToArray(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}var COMPARE_PARTIAL_FLAG$1=1,COMPARE_UNORDERED_FLAG$1=2,boolTag$3="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",mapTag$5="[object Map]",numberTag$3="[object Number]",regexpTag$3="[object RegExp]",setTag$5="[object Set]",stringTag$3="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",symbolProto$1=Symbol?Symbol.prototype:void 0,symbolValueOf$1=symbolProto$1?symbolProto$1.valueOf:void 0;function equalByTag(e,t,i,n,o,s,r){switch(i){case dataViewTag$4:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag$3:return!(e.byteLength!=t.byteLength||!s(new Uint8Array(e),new Uint8Array(t)));case boolTag$3:case dateTag$3:case numberTag$3:return eq(+e,+t);case errorTag$2:return e.name==t.name&&e.message==t.message;case regexpTag$3:case stringTag$3:return e==t+"";case mapTag$5:var a=mapToArray;case setTag$5:var l=n&COMPARE_PARTIAL_FLAG$1;if(a||(a=setToArray),e.size!=t.size&&!l)return!1;var c=r.get(e);if(c)return c==t;n|=COMPARE_UNORDERED_FLAG$1,r.set(e,t);var u=equalArrays(a(e),a(t),n,o,s,r);return r.delete(e),u;case symbolTag$2:if(symbolValueOf$1)return symbolValueOf$1.call(e)==symbolValueOf$1.call(t)}return!1}var COMPARE_PARTIAL_FLAG$2=1,objectProto$e=Object.prototype,hasOwnProperty$b=objectProto$e.hasOwnProperty;function equalObjects(e,t,i,n,o,s){var r=i&COMPARE_PARTIAL_FLAG$2,a=getAllKeys(e),l=a.length;if(l!=getAllKeys(t).length&&!r)return!1;for(var c=l;c--;){var u=a[c];if(!(r?u in t:hasOwnProperty$b.call(t,u)))return!1}var d=s.get(e),p=s.get(t);if(d&&p)return d==t&&p==e;var h=!0;s.set(e,t),s.set(t,e);for(var _=r;++c<l;){var m=e[u=a[c]],g=t[u];if(n)var v=r?n(g,m,u,t,e,s):n(m,g,u,e,t,s);if(!(void 0===v?m===g||o(m,g,i,n,s):v)){h=!1;break}_||(_="constructor"==u)}if(h&&!_){var f=e.constructor,b=t.constructor;f==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof f&&f instanceof f&&"function"==typeof b&&b instanceof b||(h=!1)}return s.delete(e),s.delete(t),h}var COMPARE_PARTIAL_FLAG$3=1,argsTag$3="[object Arguments]",arrayTag$2="[object Array]",objectTag$4="[object Object]",objectProto$f=Object.prototype,hasOwnProperty$c=objectProto$f.hasOwnProperty;function baseIsEqualDeep(e,t,i,n,o,s){var r=isArray(e),a=isArray(t),l=r?arrayTag$2:getTag$1(e),c=a?arrayTag$2:getTag$1(t),u=(l=l==argsTag$3?objectTag$4:l)==objectTag$4,d=(c=c==argsTag$3?objectTag$4:c)==objectTag$4,p=l==c;if(p&&isBuffer(e)){if(!isBuffer(t))return!1;r=!0,u=!1}if(p&&!u)return s||(s=new Stack),r||isTypedArray(e)?equalArrays(e,t,i,n,o,s):equalByTag(e,t,l,i,n,o,s);if(!(i&COMPARE_PARTIAL_FLAG$3)){var h=u&&hasOwnProperty$c.call(e,"__wrapped__"),_=d&&hasOwnProperty$c.call(t,"__wrapped__");if(h||_){var m=h?e.value():e,g=_?t.value():t;return s||(s=new Stack),o(m,g,i,n,s)}}return!!p&&(s||(s=new Stack),equalObjects(e,t,i,n,o,s))}function baseIsEqual(e,t,i,n,o){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:baseIsEqualDeep(e,t,i,n,baseIsEqual,o))}function createBaseFor(e){return function(t,i,n){for(var o=-1,s=Object(t),r=n(t),a=r.length;a--;){var l=r[e?a:++o];if(!1===i(s[l],l,s))break}return t}}var baseFor=createBaseFor();function assignMergeValue(e,t,i){(void 0!==i&&!eq(e[t],i)||void 0===i&&!(t in e))&&baseAssignValue(e,t,i)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function safeGet(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function toPlainObject(e){return copyObject(e,keysIn(e))}function baseMergeDeep(e,t,i,n,o,s,r){var a=safeGet(e,i),l=safeGet(t,i),c=r.get(l);if(c)assignMergeValue(e,i,c);else{var u=s?s(a,l,i+"",e,t,r):void 0,d=void 0===u;if(d){var p=isArray(l),h=!p&&isBuffer(l),_=!p&&!h&&isTypedArray(l);u=l,p||h||_?isArray(a)?u=a:isArrayLikeObject(a)?u=copyArray(a):h?(d=!1,u=cloneBuffer(l,!0)):_?(d=!1,u=cloneTypedArray(l,!0)):u=[]:isPlainObject(l)||isArguments(l)?(u=a,isArguments(a)?u=toPlainObject(a):isObject(a)&&!isFunction(a)||(u=initCloneObject(l))):d=!1}d&&(r.set(l,u),o(u,l,n,s,r),r.delete(l)),assignMergeValue(e,i,u)}}function baseMerge(e,t,i,n,o){e!==t&&baseFor(t,(function(s,r){if(o||(o=new Stack),isObject(s))baseMergeDeep(e,t,r,i,baseMerge,n,o);else{var a=n?n(safeGet(e,r),s,r+"",e,t,o):void 0;void 0===a&&(a=s),assignMergeValue(e,r,a)}}),keysIn)}function isEqual(e,t){return baseIsEqual(e,t)}var merge=createAssigner((function(e,t,i){baseMerge(e,t,i)})),Scope=(e=>(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(Scope||{});class Attributor{constructor(e,t,i={}){this.attrName=e,this.keyName=t;const n=Scope.TYPE&Scope.ATTRIBUTE;this.scope=null!=i.scope?i.scope&Scope.LEVEL|n:Scope.ATTRIBUTE,null!=i.whitelist&&(this.whitelist=i.whitelist)}static keys(e){return Array.from(e.attributes).map((e=>e.name))}add(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)}canAdd(e,t){return null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1)}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class ParchmentError extends Error{constructor(e){super(e="[Parchment] "+e),this.message=e,this.name=this.constructor.name}}const _Registry=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(null==e)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let i=null;try{i=e.parentNode}catch{return null}return this.find(i,t)}return null}create(t,i,n){const o=this.query(i);if(null==o)throw new ParchmentError(`Unable to create ${i} blot`);const s=o,r=i instanceof Node||i.nodeType===Node.TEXT_NODE?i:s.create(n),a=new s(t,r,n);return e.blots.set(a.domNode,a),a}find(t,i=!1){return e.find(t,i)}query(e,t=Scope.ANY){let i;return"string"==typeof e?i=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?i=this.types.text:"number"==typeof e?e&Scope.LEVEL&Scope.BLOCK?i=this.types.block:e&Scope.LEVEL&Scope.INLINE&&(i=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((e=>(i=this.classes[e],!!i))),i=i||this.tags[e.tagName]),null==i?null:"scope"in i&&t&Scope.LEVEL&i.scope&&t&Scope.TYPE&i.scope?i:null}register(...e){return e.map((e=>{const t="blotName"in e,i="attrName"in e;if(!t&&!i)throw new ParchmentError("Invalid definition");if(t&&"abstract"===e.blotName)throw new ParchmentError("Cannot register abstract class");const n=t?e.blotName:i?e.attrName:void 0;return this.types[n]=e,i?"string"==typeof e.keyName&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map((e=>e.toUpperCase())):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach((t=>{(null==this.tags[t]||null==e.className)&&(this.tags[t]=e)})))),e}))}};_Registry.blots=new WeakMap;let Registry=_Registry;function match(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter((e=>0===e.indexOf(`${t}-`)))}class ClassAttributor extends Attributor{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((e=>e.split("-").slice(0,-1).join("-")))}add(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0)}remove(e){match(e,this.keyName).forEach((t=>{e.classList.remove(t)})),0===e.classList.length&&e.removeAttribute("class")}value(e){const t=(match(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const ClassAttributor$1=ClassAttributor;function camelize(e){const t=e.split("-"),i=t.slice(1).map((e=>e[0].toUpperCase()+e.slice(1))).join("");return t[0]+i}class StyleAttributor extends Attributor{static keys(e){return(e.getAttribute("style")||"").split(";").map((e=>e.split(":")[0].trim()))}add(e,t){return!!this.canAdd(e,t)&&(e.style[camelize(this.keyName)]=t,!0)}remove(e){e.style[camelize(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[camelize(this.keyName)];return this.canAdd(e,t)?t:""}}const StyleAttributor$1=StyleAttributor;class AttributorStore{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Registry.find(this.domNode);if(null==e)return;const t=Attributor.keys(this.domNode),i=ClassAttributor$1.keys(this.domNode),n=StyleAttributor$1.keys(this.domNode);t.concat(i).concat(n).forEach((t=>{const i=e.scroll.query(t,Scope.ATTRIBUTE);i instanceof Attributor&&(this.attributes[i.attrName]=i)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const i=this.attributes[t].value(this.domNode);e.format(t,i)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((e=>{this.attributes[e].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}}const AttributorStore$1=AttributorStore,_ShadowBlot=class{constructor(e,t){this.scroll=e,this.domNode=t,Registry.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(null==this.tagName)throw new ParchmentError("Blot definition missing tagName");let t,i;return Array.isArray(this.tagName)?("string"==typeof e?(i=e.toUpperCase(),parseInt(i,10).toString()===i&&(i=parseInt(i,10))):"number"==typeof e&&(i=e),t="number"==typeof i?document.createElement(this.tagName[i-1]):i&&this.tagName.indexOf(i)>-1?document.createElement(i):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){null!=this.parent&&this.parent.removeChild(this),Registry.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,i,n){const o=this.isolate(e,t);if(null!=this.scroll.query(i,Scope.BLOT)&&n)o.wrap(i,n);else if(null!=this.scroll.query(i,Scope.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);o.wrap(e),e.format(i,n)}}insertAt(e,t,i){const n=null==i?this.scroll.create("text",t):this.scroll.create(t,i),o=this.split(e);this.parent.insertBefore(n,o||void 0)}isolate(e,t){const i=this.split(e);if(null==i)throw new Error("Attempt to isolate at end");return i.split(t),i}length(){return 1}offset(e=this.parent){return null==this.parent||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const i="string"==typeof e?this.scroll.create(e,t):e;return null!=this.parent&&(this.parent.insertBefore(i,this.next||void 0),this.remove()),i}split(e,t){return 0===e?this:this.next}update(e,t){}wrap(e,t){const i="string"==typeof e?this.scroll.create(e,t):e;if(null!=this.parent&&this.parent.insertBefore(i,this.next||void 0),"function"!=typeof i.appendChild)throw new ParchmentError(`Cannot wrap ${e}`);return i.appendChild(this),i}};_ShadowBlot.blotName="abstract";let ShadowBlot=_ShadowBlot;const _LeafBlot=class extends ShadowBlot{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let i=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(i+=1),[this.parent.domNode,i]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};_LeafBlot.scope=Scope.INLINE_BLOT;let LeafBlot=_LeafBlot;const LeafBlot$1=LeafBlot;class LinkedList{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let i=t();for(;i&&e>0;)e-=1,i=t();return i}contains(e){const t=this.iterator();let i=t();for(;i;){if(i===e)return!0;i=t()}return!1}indexOf(e){const t=this.iterator();let i=t(),n=0;for(;i;){if(i===e)return n;n+=1,i=t()}return-1}insertBefore(e,t){null!=e&&(this.remove(e),e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,i=this.head;for(;null!=i;){if(i===e)return t;t+=i.length(),i=i.next}return-1}remove(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return null!=e&&(e=e.next),t}}find(e,t=!1){const i=this.iterator();let n=i();for(;n;){const o=n.length();if(e<o||t&&e===o&&(null==n.next||0!==n.next.length()))return[n,e];e-=o,n=i()}return[null,0]}forEach(e){const t=this.iterator();let i=t();for(;i;)e(i),i=t()}forEachAt(e,t,i){if(t<=0)return;const[n,o]=this.find(e);let s=e-o;const r=this.iterator(n);let a=r();for(;a&&s<e+t;){const n=a.length();e>s?i(a,e-s,Math.min(t,s+n-e)):i(a,0,Math.min(n,e+t-s)),s+=n,a=r()}}map(e){return this.reduce(((t,i)=>(t.push(e(i)),t)),[])}reduce(e,t){const i=this.iterator();let n=i();for(;n;)t=e(t,n),n=i();return t}}function makeAttachedBlot(e,t){const i=t.find(e);if(i)return i;try{return t.create(e)}catch{const i=t.create(Scope.INLINE);return Array.from(e.childNodes).forEach((e=>{i.domNode.appendChild(e)})),e.parentNode&&e.parentNode.replaceChild(i.domNode,e),i.attach(),i}}const _ParentBlot=class e extends ShadowBlot{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new LinkedList,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=makeAttachedBlot(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof ParchmentError)return;throw e}}))}deleteAt(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,((e,t,i)=>{e.deleteAt(t,i)}))}descendant(t,i=0){const[n,o]=this.children.find(i);return null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t?[n,o]:n instanceof e?n.descendant(t,o):[null,-1]}descendants(t,i=0,n=Number.MAX_VALUE){let o=[],s=n;return this.children.forEachAt(i,n,((i,n,r)=>{(null==t.blotName&&t(i)||null!=t.blotName&&i instanceof t)&&o.push(i),i instanceof e&&(o=o.concat(i.descendants(t,n,s))),s-=r})),o}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach((i=>{t||this.statics.allowedChildren.some((e=>i instanceof e))||(i.statics.scope===Scope.BLOCK_BLOT?(null!=i.next&&this.splitAfter(i),null!=i.prev&&this.splitAfter(i.prev),i.parent.unwrap(),t=!0):i instanceof e?i.unwrap():i.remove())}))}formatAt(e,t,i,n){this.children.forEachAt(e,t,((e,t,o)=>{e.formatAt(t,o,i,n)}))}insertAt(e,t,i){const[n,o]=this.children.find(e);if(n)n.insertAt(o,t,i);else{const e=null==i?this.scroll.create("text",t):this.scroll.create(t,i);this.appendChild(e)}}insertBefore(e,t){null!=e.parent&&e.parent.children.remove(e);let i=null;this.children.insertBefore(e,t||null),e.parent=this,null!=t&&(i=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==i)&&this.domNode.insertBefore(e.domNode,i),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((i=>{e.insertBefore(i,t)}))}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,i=!1){const[n,o]=this.children.find(t,i),s=[[this,t]];return n instanceof e?s.concat(n.path(o,i)):(null!=n&&s.push([n,o]),s)}removeChild(e){this.children.remove(e)}replaceWith(t,i){const n="string"==typeof t?this.scroll.create(t,i):t;return n instanceof e&&this.moveChildren(n),super.replaceWith(n)}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const i=this.clone();return this.parent&&this.parent.insertBefore(i,this.next||void 0),this.children.forEachAt(e,this.length(),((e,n,o)=>{const s=e.split(n,t);null!=s&&i.appendChild(s)})),i}splitAfter(e){const t=this.clone();for(;null!=e.next;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const i=[],n=[];e.forEach((e=>{e.target===this.domNode&&"childList"===e.type&&(i.push(...e.addedNodes),n.push(...e.removedNodes))})),n.forEach((e=>{if(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const t=this.scroll.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===this.domNode)&&t.detach()})),i.filter((e=>e.parentNode===this.domNode&&e!==this.uiNode)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((e=>{let t=null;null!=e.nextSibling&&(t=this.scroll.find(e.nextSibling));const i=makeAttachedBlot(e,this.scroll);(i.next!==t||null==i.next)&&(null!=i.parent&&i.parent.removeChild(this),this.insertBefore(i,t||void 0))})),this.enforceAllowedChildren()}};_ParentBlot.uiClass="";let ParentBlot=_ParentBlot;const ParentBlot$1=ParentBlot;function isEqual$1(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(e[i]!==t[i])return!1;return!0}const _InlineBlot=class e extends ParentBlot$1{static create(e){return super.create(e)}static formats(t,i){const n=i.query(e.blotName);if(null==n||t.tagName!==n.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new AttributorStore$1(this.domNode)}format(t,i){if(t!==this.statics.blotName||i){const e=this.scroll.query(t,Scope.INLINE);if(null==e)return;e instanceof Attributor?this.attributes.attribute(e,i):i&&(t!==this.statics.blotName||this.formats()[t]!==i)&&this.replaceWith(t,i)}else this.children.forEach((t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)})),this.unwrap()}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,i,n){null!=this.formats()[i]||this.scroll.query(i,Scope.ATTRIBUTE)?this.isolate(e,t).format(i,n):super.formatAt(e,t,i,n)}optimize(t){super.optimize(t);const i=this.formats();if(0===Object.keys(i).length)return this.unwrap();const n=this.next;n instanceof e&&n.prev===this&&isEqual$1(i,n.formats())&&(n.moveChildren(this),n.remove())}replaceWith(e,t){const i=super.replaceWith(e,t);return this.attributes.copy(i),i}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}wrap(t,i){const n=super.wrap(t,i);return n instanceof e&&this.attributes.move(n),n}};_InlineBlot.allowedChildren=[_InlineBlot,LeafBlot$1],_InlineBlot.blotName="inline",_InlineBlot.scope=Scope.INLINE_BLOT,_InlineBlot.tagName="SPAN";let InlineBlot=_InlineBlot;const InlineBlot$1=InlineBlot,_BlockBlot=class e extends ParentBlot$1{static create(e){return super.create(e)}static formats(t,i){const n=i.query(e.blotName);if(null==n||t.tagName!==n.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new AttributorStore$1(this.domNode)}format(t,i){const n=this.scroll.query(t,Scope.BLOCK);null!=n&&(n instanceof Attributor?this.attributes.attribute(n,i):t!==this.statics.blotName||i?i&&(t!==this.statics.blotName||this.formats()[t]!==i)&&this.replaceWith(t,i):this.replaceWith(e.blotName))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,i,n){null!=this.scroll.query(i,Scope.BLOCK)?this.format(i,n):super.formatAt(e,t,i,n)}insertAt(e,t,i){if(null==i||null!=this.scroll.query(t,Scope.INLINE))super.insertAt(e,t,i);else{const n=this.split(e);if(null==n)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,i);n.parent.insertBefore(e,n)}}}replaceWith(e,t){const i=super.replaceWith(e,t);return this.attributes.copy(i),i}update(e,t){super.update(e,t),e.some((e=>e.target===this.domNode&&"attributes"===e.type))&&this.attributes.build()}};_BlockBlot.blotName="block",_BlockBlot.scope=Scope.BLOCK_BLOT,_BlockBlot.tagName="P",_BlockBlot.allowedChildren=[InlineBlot$1,_BlockBlot,LeafBlot$1];let BlockBlot=_BlockBlot;const BlockBlot$1=BlockBlot,_ContainerBlot=class extends ParentBlot$1{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,i,n){super.formatAt(e,t,i,n),this.enforceAllowedChildren()}insertAt(e,t,i){super.insertAt(e,t,i),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};_ContainerBlot.blotName="container",_ContainerBlot.scope=Scope.BLOCK_BLOT;let ContainerBlot=_ContainerBlot;const ContainerBlot$1=ContainerBlot;class EmbedBlot extends LeafBlot$1{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,i,n){0===e&&t===this.length()?this.format(i,n):super.formatAt(e,t,i,n)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const EmbedBlot$1=EmbedBlot,OBSERVER_CONFIG={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},MAX_OPTIMIZE_ITERATIONS=100,_ScrollBlot=class extends ParentBlot$1{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((e=>{this.update(e)})),this.observer.observe(this.domNode,OBSERVER_CONFIG),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const i=this.registry.find(e,t);return i?i.scroll===this?i:t?this.find(i.scroll.domNode.parentNode,!0):null:null}query(e,t=Scope.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),0===e&&t===this.length()?this.children.forEach((e=>{e.remove()})):super.deleteAt(e,t)}formatAt(e,t,i,n){this.update(),super.formatAt(e,t,i,n)}insertAt(e,t,i){this.update(),super.insertAt(e,t,i)}optimize(e=[],t={}){super.optimize(t);const i=t.mutationsMap||new WeakMap;let n=Array.from(this.observer.takeRecords());for(;n.length>0;)e.push(n.pop());const o=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(i.has(e.domNode)||i.set(e.domNode,[]),t&&o(e.parent))},s=e=>{i.has(e.domNode)&&(e instanceof ParentBlot$1&&e.children.forEach(s),i.delete(e.domNode),e.optimize(t))};let r=e;for(let t=0;r.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(r.forEach((e=>{const t=this.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(o(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach((e=>{const t=this.find(e,!1);o(t,!1),t instanceof ParentBlot$1&&t.children.forEach((e=>{o(e,!1)}))}))):"attributes"===e.type&&o(t.prev)),o(t))})),this.children.forEach(s),r=Array.from(this.observer.takeRecords()),n=r.slice();n.length>0;)e.push(n.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const i=new WeakMap;e.map((e=>{const t=this.find(e.target,!0);return null==t?null:i.has(t.domNode)?(i.get(t.domNode).push(e),null):(i.set(t.domNode,[e]),t)})).forEach((e=>{null!=e&&e!==this&&i.has(e.domNode)&&e.update(i.get(e.domNode)||[],t)})),t.mutationsMap=i,i.has(this.domNode)&&super.update(i.get(this.domNode),t),this.optimize(e,t)}};_ScrollBlot.blotName="scroll",_ScrollBlot.defaultChild=BlockBlot$1,_ScrollBlot.allowedChildren=[BlockBlot$1,ContainerBlot$1],_ScrollBlot.scope=Scope.BLOCK_BLOT,_ScrollBlot.tagName="DIV";let ScrollBlot=_ScrollBlot;const ScrollBlot$1=ScrollBlot,_TextBlot=class e extends LeafBlot$1{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,i){null==i?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,i)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const i=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(i,this.next||void 0),this.text=this.statics.value(this.domNode),i}update(e,t){e.some((e=>"characterData"===e.type&&e.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};_TextBlot.blotName="text",_TextBlot.scope=Scope.INLINE_BLOT;let TextBlot=_TextBlot;const TextBlot$1=TextBlot;var Parchment=Object.freeze({__proto__:null,Attributor:Attributor,AttributorStore:AttributorStore$1,BlockBlot:BlockBlot$1,ClassAttributor:ClassAttributor$1,ContainerBlot:ContainerBlot$1,EmbedBlot:EmbedBlot$1,InlineBlot:InlineBlot$1,LeafBlot:LeafBlot$1,ParentBlot:ParentBlot$1,Registry:Registry,Scope:Scope,ScrollBlot:ScrollBlot$1,StyleAttributor:StyleAttributor$1,TextBlot:TextBlot$1}),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return commonjsRequire(e,null==t?i.path:t)}},i.exports),i.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;function diff_main(e,t,i,n,o){if(e===t)return e?[[DIFF_EQUAL,e]]:[];if(null!=i){var s=find_cursor_edit_diff(e,t,i);if(s)return s}var r=diff_commonPrefix(e,t),a=e.substring(0,r);r=diff_commonSuffix(e=e.substring(r),t=t.substring(r));var l=e.substring(e.length-r),c=diff_compute_(e=e.substring(0,e.length-r),t=t.substring(0,t.length-r));return a&&c.unshift([DIFF_EQUAL,a]),l&&c.push([DIFF_EQUAL,l]),diff_cleanupMerge(c,o),n&&diff_cleanupSemantic(c),c}function diff_compute_(e,t){var i;if(!e)return[[DIFF_INSERT,t]];if(!t)return[[DIFF_DELETE,e]];var n=e.length>t.length?e:t,o=e.length>t.length?t:e,s=n.indexOf(o);if(-1!==s)return i=[[DIFF_INSERT,n.substring(0,s)],[DIFF_EQUAL,o],[DIFF_INSERT,n.substring(s+o.length)]],e.length>t.length&&(i[0][0]=i[2][0]=DIFF_DELETE),i;if(1===o.length)return[[DIFF_DELETE,e],[DIFF_INSERT,t]];var r=diff_halfMatch_(e,t);if(r){var a=r[0],l=r[1],c=r[2],u=r[3],d=r[4],p=diff_main(a,c),h=diff_main(l,u);return p.concat([[DIFF_EQUAL,d]],h)}return diff_bisect_(e,t)}function diff_bisect_(e,t){for(var i=e.length,n=t.length,o=Math.ceil((i+n)/2),s=o,r=2*o,a=new Array(r),l=new Array(r),c=0;c<r;c++)a[c]=-1,l[c]=-1;a[s+1]=0,l[s+1]=0;for(var u=i-n,d=u%2!=0,p=0,h=0,_=0,m=0,g=0;g<o;g++){for(var v=-g+p;v<=g-h;v+=2){for(var f=s+v,b=(w=v===-g||v!==g&&a[f-1]<a[f+1]?a[f+1]:a[f-1]+1)-v;w<i&&b<n&&e.charAt(w)===t.charAt(b);)w++,b++;if(a[f]=w,w>i)h+=2;else if(b>n)p+=2;else if(d){if((x=s+u-v)>=0&&x<r&&-1!==l[x])if(w>=(q=i-l[x]))return diff_bisectSplit_(e,t,w,b)}}for(var y=-g+_;y<=g-m;y+=2){for(var q,x=s+y,T=(q=y===-g||y!==g&&l[x-1]<l[x+1]?l[x+1]:l[x-1]+1)-y;q<i&&T<n&&e.charAt(i-q-1)===t.charAt(n-T-1);)q++,T++;if(l[x]=q,q>i)m+=2;else if(T>n)_+=2;else if(!d){if((f=s+u-y)>=0&&f<r&&-1!==a[f]){var w;b=s+(w=a[f])-f;if(w>=(q=i-q))return diff_bisectSplit_(e,t,w,b)}}}}return[[DIFF_DELETE,e],[DIFF_INSERT,t]]}function diff_bisectSplit_(e,t,i,n){var o=e.substring(0,i),s=t.substring(0,n),r=e.substring(i),a=t.substring(n),l=diff_main(o,s),c=diff_main(r,a);return l.concat(c)}function diff_commonPrefix(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var i=0,n=Math.min(e.length,t.length),o=n,s=0;i<o;)e.substring(s,o)==t.substring(s,o)?s=i=o:n=o,o=Math.floor((n-i)/2+i);return is_surrogate_pair_start(e.charCodeAt(o-1))&&o--,o}function diff_commonOverlap_(e,t){var i=e.length,n=t.length;if(0==i||0==n)return 0;i>n?e=e.substring(i-n):i<n&&(t=t.substring(0,i));var o=Math.min(i,n);if(e==t)return o;for(var s=0,r=1;;){var a=e.substring(o-r),l=t.indexOf(a);if(-1==l)return s;r+=l,0!=l&&e.substring(o-r)!=t.substring(0,r)||(s=r,r++)}}function diff_commonSuffix(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var i=0,n=Math.min(e.length,t.length),o=n,s=0;i<o;)e.substring(e.length-o,e.length-s)==t.substring(t.length-o,t.length-s)?s=i=o:n=o,o=Math.floor((n-i)/2+i);return is_surrogate_pair_end(e.charCodeAt(e.length-o))&&o--,o}function diff_halfMatch_(e,t){var i=e.length>t.length?e:t,n=e.length>t.length?t:e;if(i.length<4||2*n.length<i.length)return null;function o(e,t,i){for(var n,o,s,r,a=e.substring(i,i+Math.floor(e.length/4)),l=-1,c="";-1!==(l=t.indexOf(a,l+1));){var u=diff_commonPrefix(e.substring(i),t.substring(l)),d=diff_commonSuffix(e.substring(0,i),t.substring(0,l));c.length<d+u&&(c=t.substring(l-d,l)+t.substring(l,l+u),n=e.substring(0,i-d),o=e.substring(i+u),s=t.substring(0,l-d),r=t.substring(l+u))}return 2*c.length>=e.length?[n,o,s,r,c]:null}var s,r,a,l,c,u=o(i,n,Math.ceil(i.length/4)),d=o(i,n,Math.ceil(i.length/2));return u||d?(s=d?u&&u[4].length>d[4].length?u:d:u,e.length>t.length?(r=s[0],a=s[1],l=s[2],c=s[3]):(l=s[0],c=s[1],r=s[2],a=s[3]),[r,a,l,c,s[4]]):null}function diff_cleanupSemantic(e){for(var t=!1,i=[],n=0,o=null,s=0,r=0,a=0,l=0,c=0;s<e.length;)e[s][0]==DIFF_EQUAL?(i[n++]=s,r=l,a=c,l=0,c=0,o=e[s][1]):(e[s][0]==DIFF_INSERT?l+=e[s][1].length:c+=e[s][1].length,o&&o.length<=Math.max(r,a)&&o.length<=Math.max(l,c)&&(e.splice(i[n-1],0,[DIFF_DELETE,o]),e[i[n-1]+1][0]=DIFF_INSERT,n--,s=--n>0?i[n-1]:-1,r=0,a=0,l=0,c=0,o=null,t=!0)),s++;for(t&&diff_cleanupMerge(e),diff_cleanupSemanticLossless(e),s=1;s<e.length;){if(e[s-1][0]==DIFF_DELETE&&e[s][0]==DIFF_INSERT){var u=e[s-1][1],d=e[s][1],p=diff_commonOverlap_(u,d),h=diff_commonOverlap_(d,u);p>=h?(p>=u.length/2||p>=d.length/2)&&(e.splice(s,0,[DIFF_EQUAL,d.substring(0,p)]),e[s-1][1]=u.substring(0,u.length-p),e[s+1][1]=d.substring(p),s++):(h>=u.length/2||h>=d.length/2)&&(e.splice(s,0,[DIFF_EQUAL,u.substring(0,h)]),e[s-1][0]=DIFF_INSERT,e[s-1][1]=d.substring(0,d.length-h),e[s+1][0]=DIFF_DELETE,e[s+1][1]=u.substring(h),s++),s++}s++}}var nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,whitespaceRegex_=/\s/,linebreakRegex_=/[\r\n]/,blanklineEndRegex_=/\n\r?\n$/,blanklineStartRegex_=/^\r?\n\r?\n/;function diff_cleanupSemanticLossless(e){function t(e,t){if(!e||!t)return 6;var i=e.charAt(e.length-1),n=t.charAt(0),o=i.match(nonAlphaNumericRegex_),s=n.match(nonAlphaNumericRegex_),r=o&&i.match(whitespaceRegex_),a=s&&n.match(whitespaceRegex_),l=r&&i.match(linebreakRegex_),c=a&&n.match(linebreakRegex_),u=l&&e.match(blanklineEndRegex_),d=c&&t.match(blanklineStartRegex_);return u||d?5:l||c?4:o&&!r&&a?3:r||a?2:o||s?1:0}for(var i=1;i<e.length-1;){if(e[i-1][0]==DIFF_EQUAL&&e[i+1][0]==DIFF_EQUAL){var n=e[i-1][1],o=e[i][1],s=e[i+1][1],r=diff_commonSuffix(n,o);if(r){var a=o.substring(o.length-r);n=n.substring(0,n.length-r),o=a+o.substring(0,o.length-r),s=a+s}for(var l=n,c=o,u=s,d=t(n,o)+t(o,s);o.charAt(0)===s.charAt(0);){n+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var p=t(n,o)+t(o,s);p>=d&&(d=p,l=n,c=o,u=s)}e[i-1][1]!=l&&(l?e[i-1][1]=l:(e.splice(i-1,1),i--),e[i][1]=c,u?e[i+1][1]=u:(e.splice(i+1,1),i--))}i++}}function diff_cleanupMerge(e,t){e.push([DIFF_EQUAL,""]);for(var i,n=0,o=0,s=0,r="",a="";n<e.length;)if(n<e.length-1&&!e[n][1])e.splice(n,1);else switch(e[n][0]){case DIFF_INSERT:s++,a+=e[n][1],n++;break;case DIFF_DELETE:o++,r+=e[n][1],n++;break;case DIFF_EQUAL:var l=n-s-o-1;if(t){if(l>=0&&ends_with_pair_start(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),r=c+r,a=c+a,!e[l][1]){e.splice(l,1),n--;var u=l-1;e[u]&&e[u][0]===DIFF_INSERT&&(s++,a=e[u][1]+a,u--),e[u]&&e[u][0]===DIFF_DELETE&&(o++,r=e[u][1]+r,u--),l=u}}if(starts_with_pair_end(e[n][1])){c=e[n][1].charAt(0);e[n][1]=e[n][1].slice(1),r+=c,a+=c}}if(n<e.length-1&&!e[n][1]){e.splice(n,1);break}if(r.length>0||a.length>0){r.length>0&&a.length>0&&(0!==(i=diff_commonPrefix(a,r))&&(l>=0?e[l][1]+=a.substring(0,i):(e.splice(0,0,[DIFF_EQUAL,a.substring(0,i)]),n++),a=a.substring(i),r=r.substring(i)),0!==(i=diff_commonSuffix(a,r))&&(e[n][1]=a.substring(a.length-i)+e[n][1],a=a.substring(0,a.length-i),r=r.substring(0,r.length-i)));var d=s+o;0===r.length&&0===a.length?(e.splice(n-d,d),n-=d):0===r.length?(e.splice(n-d,d,[DIFF_INSERT,a]),n=n-d+1):0===a.length?(e.splice(n-d,d,[DIFF_DELETE,r]),n=n-d+1):(e.splice(n-d,d,[DIFF_DELETE,r],[DIFF_INSERT,a]),n=n-d+2)}0!==n&&e[n-1][0]===DIFF_EQUAL?(e[n-1][1]+=e[n][1],e.splice(n,1)):n++,s=0,o=0,r="",a=""}""===e[e.length-1][1]&&e.pop();var p=!1;for(n=1;n<e.length-1;)e[n-1][0]===DIFF_EQUAL&&e[n+1][0]===DIFF_EQUAL&&(e[n][1].substring(e[n][1].length-e[n-1][1].length)===e[n-1][1]?(e[n][1]=e[n-1][1]+e[n][1].substring(0,e[n][1].length-e[n-1][1].length),e[n+1][1]=e[n-1][1]+e[n+1][1],e.splice(n-1,1),p=!0):e[n][1].substring(0,e[n+1][1].length)==e[n+1][1]&&(e[n-1][1]+=e[n+1][1],e[n][1]=e[n][1].substring(e[n+1][1].length)+e[n+1][1],e.splice(n+1,1),p=!0)),n++;p&&diff_cleanupMerge(e,t)}function is_surrogate_pair_start(e){return e>=55296&&e<=56319}function is_surrogate_pair_end(e){return e>=56320&&e<=57343}function starts_with_pair_end(e){return is_surrogate_pair_end(e.charCodeAt(0))}function ends_with_pair_start(e){return is_surrogate_pair_start(e.charCodeAt(e.length-1))}function remove_empty_tuples(e){for(var t=[],i=0;i<e.length;i++)e[i][1].length>0&&t.push(e[i]);return t}function make_edit_splice(e,t,i,n){return ends_with_pair_start(e)||starts_with_pair_end(n)?null:remove_empty_tuples([[DIFF_EQUAL,e],[DIFF_DELETE,t],[DIFF_INSERT,i],[DIFF_EQUAL,n]])}function find_cursor_edit_diff(e,t,i){var n="number"==typeof i?{index:i,length:0}:i.oldRange,o="number"==typeof i?null:i.newRange,s=e.length,r=t.length;if(0===n.length&&(null===o||0===o.length)){var a=n.index,l=e.slice(0,a),c=e.slice(a),u=o?o.index:null,d=a+r-s;if((null===u||u===d)&&!(d<0||d>r)){var p=t.slice(0,d);if((m=t.slice(d))===c){var h=Math.min(a,d);if((v=l.slice(0,h))===(b=p.slice(0,h)))return make_edit_splice(v,l.slice(h),p.slice(h),c)}}if(null===u||u===a){var _=a,m=(p=t.slice(0,_),t.slice(_));if(p===l){var g=Math.min(s-_,r-_);if((f=c.slice(c.length-g))===(y=m.slice(m.length-g)))return make_edit_splice(l,c.slice(0,c.length-g),m.slice(0,m.length-g),f)}}}if(n.length>0&&o&&0===o.length){var v=e.slice(0,n.index),f=e.slice(n.index+n.length);if(!(r<(h=v.length)+(g=f.length))){var b=t.slice(0,h),y=t.slice(r-g);if(v===b&&f===y)return make_edit_splice(v,e.slice(h,s-g),t.slice(h,r-g),f)}}return null}function diff(e,t,i,n){return diff_main(e,t,i,n,!0)}diff.INSERT=DIFF_INSERT,diff.DELETE=DIFF_DELETE,diff.EQUAL=DIFF_EQUAL;var diff_1=diff,lodash_clonedeep=createCommonjsModule((function(e,t){var i="__lodash_hash_undefined__",n=9007199254740991,o="[object Arguments]",s="[object Boolean]",r="[object Date]",a="[object Function]",l="[object GeneratorFunction]",c="[object Map]",u="[object Number]",d="[object Object]",p="[object Promise]",h="[object RegExp]",_="[object Set]",m="[object String]",g="[object Symbol]",v="[object WeakMap]",f="[object ArrayBuffer]",b="[object DataView]",y="[object Float32Array]",q="[object Float64Array]",x="[object Int8Array]",T="[object Int16Array]",w="[object Int32Array]",I="[object Uint8Array]",C="[object Uint8ClampedArray]",E="[object Uint16Array]",$="[object Uint32Array]",S=/\w*$/,A=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,M={};M[o]=M["[object Array]"]=M[f]=M[b]=M[s]=M[r]=M[y]=M[q]=M[x]=M[T]=M[w]=M[c]=M[u]=M[d]=M[h]=M[_]=M[m]=M[g]=M[I]=M[C]=M[E]=M[$]=!0,M["[object Error]"]=M[a]=M[v]=!1;var k="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,L="object"==typeof self&&self&&self.Object===Object&&self,j=k||L||Function("return this")(),R=t&&!t.nodeType&&t,O=R&&e&&!e.nodeType&&e,D=O&&O.exports===R;function Q(e,t){return e.set(t[0],t[1]),e}function B(e,t){return e.add(t),e}function F(e,t,i,n){var o=-1,s=e?e.length:0;for(n&&s&&(i=e[++o]);++o<s;)i=t(i,e[o],o,e);return i}function z(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function P(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function U(e,t){return function(i){return e(t(i))}}function V(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}var H,G=Array.prototype,Y=Function.prototype,Z=Object.prototype,W=j["__core-js_shared__"],K=(H=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"",J=Y.toString,X=Z.hasOwnProperty,ee=Z.toString,te=RegExp("^"+J.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ie=D?j.Buffer:void 0,ne=j.Symbol,oe=j.Uint8Array,se=U(Object.getPrototypeOf,Object),re=Object.create,ae=Z.propertyIsEnumerable,le=G.splice,ce=Object.getOwnPropertySymbols,ue=ie?ie.isBuffer:void 0,de=U(Object.keys,Object),pe=Oe(j,"DataView"),he=Oe(j,"Map"),_e=Oe(j,"Promise"),me=Oe(j,"Set"),ge=Oe(j,"WeakMap"),ve=Oe(Object,"create"),fe=ze(pe),be=ze(he),ye=ze(_e),qe=ze(me),xe=ze(ge),Te=ne?ne.prototype:void 0,we=Te?Te.valueOf:void 0;function Ie(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function Ce(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function Ee(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function $e(e){this.__data__=new Ce(e)}function Se(e,t){var i=Ue(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ve(e)}(e)&&X.call(e,"callee")&&(!ae.call(e,"callee")||ee.call(e)==o)}(e)?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],n=i.length,s=!!n;for(var r in e)!t&&!X.call(e,r)||s&&("length"==r||Be(r,n))||i.push(r);return i}function Ae(e,t,i){var n=e[t];X.call(e,t)&&Pe(n,i)&&(void 0!==i||t in e)||(e[t]=i)}function Ne(e,t){for(var i=e.length;i--;)if(Pe(e[i][0],t))return i;return-1}function Me(e,t,i,n,p,v,A){var N;if(n&&(N=v?n(e,p,v,A):n(e)),void 0!==N)return N;if(!Ye(e))return e;var k=Ue(e);if(k){if(N=function(e){var t=e.length,i=e.constructor(t);t&&"string"==typeof e[0]&&X.call(e,"index")&&(i.index=e.index,i.input=e.input);return i}(e),!t)return function(e,t){var i=-1,n=e.length;t||(t=Array(n));for(;++i<n;)t[i]=e[i];return t}(e,N)}else{var L=Qe(e),j=L==a||L==l;if(He(e))return function(e,t){if(t)return e.slice();var i=new e.constructor(e.length);return e.copy(i),i}(e,t);if(L==d||L==o||j&&!v){if(z(e))return v?e:{};if(N=function(e){return"function"!=typeof e.constructor||Fe(e)?{}:(t=se(e),Ye(t)?re(t):{});var t}(j?{}:e),!t)return function(e,t){return je(e,De(e),t)}(e,function(e,t){return e&&je(t,Ze(t),e)}(N,e))}else{if(!M[L])return v?e:{};N=function(e,t,i,n){var o=e.constructor;switch(t){case f:return Le(e);case s:case r:return new o(+e);case b:return function(e,t){var i=t?Le(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,n);case y:case q:case x:case T:case w:case I:case C:case E:case $:return function(e,t){var i=t?Le(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}(e,n);case c:return function(e,t,i){var n=t?i(P(e),!0):P(e);return F(n,Q,new e.constructor)}(e,n,i);case u:case m:return new o(e);case h:return function(e){var t=new e.constructor(e.source,S.exec(e));return t.lastIndex=e.lastIndex,t}(e);case _:return function(e,t,i){var n=t?i(V(e),!0):V(e);return F(n,B,new e.constructor)}(e,n,i);case g:return a=e,we?Object(we.call(a)):{}}var a}(e,L,Me,t)}}A||(A=new $e);var R=A.get(e);if(R)return R;if(A.set(e,N),!k)var O=i?function(e){return function(e,t,i){var n=t(e);return Ue(e)?n:function(e,t){for(var i=-1,n=t.length,o=e.length;++i<n;)e[o+i]=t[i];return e}(n,i(e))}(e,Ze,De)}(e):Ze(e);return function(e,t){for(var i=-1,n=e?e.length:0;++i<n&&!1!==t(e[i],i,e););}(O||e,(function(o,s){O&&(o=e[s=o]),Ae(N,s,Me(o,t,i,n,s,e,A))})),N}function ke(e){return!(!Ye(e)||(t=e,K&&K in t))&&(Ge(e)||z(e)?te:A).test(ze(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function je(e,t,i,n){i||(i={});for(var o=-1,s=t.length;++o<s;){var r=t[o],a=n?n(i[r],e[r],r,i,e):void 0;Ae(i,r,void 0===a?e[r]:a)}return i}function Re(e,t){var i,n,o=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?o["string"==typeof t?"string":"hash"]:o.map}function Oe(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return ke(i)?i:void 0}Ie.prototype.clear=function(){this.__data__=ve?ve(null):{}},Ie.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ie.prototype.get=function(e){var t=this.__data__;if(ve){var n=t[e];return n===i?void 0:n}return X.call(t,e)?t[e]:void 0},Ie.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:X.call(t,e)},Ie.prototype.set=function(e,t){return this.__data__[e]=ve&&void 0===t?i:t,this},Ce.prototype.clear=function(){this.__data__=[]},Ce.prototype.delete=function(e){var t=this.__data__,i=Ne(t,e);return!(i<0)&&(i==t.length-1?t.pop():le.call(t,i,1),!0)},Ce.prototype.get=function(e){var t=this.__data__,i=Ne(t,e);return i<0?void 0:t[i][1]},Ce.prototype.has=function(e){return Ne(this.__data__,e)>-1},Ce.prototype.set=function(e,t){var i=this.__data__,n=Ne(i,e);return n<0?i.push([e,t]):i[n][1]=t,this},Ee.prototype.clear=function(){this.__data__={hash:new Ie,map:new(he||Ce),string:new Ie}},Ee.prototype.delete=function(e){return Re(this,e).delete(e)},Ee.prototype.get=function(e){return Re(this,e).get(e)},Ee.prototype.has=function(e){return Re(this,e).has(e)},Ee.prototype.set=function(e,t){return Re(this,e).set(e,t),this},$e.prototype.clear=function(){this.__data__=new Ce},$e.prototype.delete=function(e){return this.__data__.delete(e)},$e.prototype.get=function(e){return this.__data__.get(e)},$e.prototype.has=function(e){return this.__data__.has(e)},$e.prototype.set=function(e,t){var i=this.__data__;if(i instanceof Ce){var n=i.__data__;if(!he||n.length<199)return n.push([e,t]),this;i=this.__data__=new Ee(n)}return i.set(e,t),this};var De=ce?U(ce,Object):function(){return[]},Qe=function(e){return ee.call(e)};function Be(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||N.test(e))&&e>-1&&e%1==0&&e<t}function Fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Z)}function ze(e){if(null!=e){try{return J.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Pe(e,t){return e===t||e!=e&&t!=t}(pe&&Qe(new pe(new ArrayBuffer(1)))!=b||he&&Qe(new he)!=c||_e&&Qe(_e.resolve())!=p||me&&Qe(new me)!=_||ge&&Qe(new ge)!=v)&&(Qe=function(e){var t=ee.call(e),i=t==d?e.constructor:void 0,n=i?ze(i):void 0;if(n)switch(n){case fe:return b;case be:return c;case ye:return p;case qe:return _;case xe:return v}return t});var Ue=Array.isArray;function Ve(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!Ge(e)}var He=ue||function(){return!1};function Ge(e){var t=Ye(e)?ee.call(e):"";return t==a||t==l}function Ye(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ze(e){return Ve(e)?Se(e):function(e){if(!Fe(e))return de(e);var t=[];for(var i in Object(e))X.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}e.exports=function(e){return Me(e,!0,!0)}})),lodash_isequal=createCommonjsModule((function(e,t){var i="__lodash_hash_undefined__",n=9007199254740991,o="[object Arguments]",s="[object Array]",r="[object Boolean]",a="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",p="[object Object]",h="[object Promise]",_="[object RegExp]",m="[object Set]",g="[object String]",v="[object Symbol]",f="[object WeakMap]",b="[object ArrayBuffer]",y="[object DataView]",q=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,T={};T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T[o]=T[s]=T[b]=T[r]=T[y]=T[a]=T[l]=T[c]=T[u]=T[d]=T[p]=T[_]=T[m]=T[g]=T[f]=!1;var w="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,I="object"==typeof self&&self&&self.Object===Object&&self,C=w||I||Function("return this")(),E=t&&!t.nodeType&&t,$=E&&e&&!e.nodeType&&e,S=$&&$.exports===E,A=S&&w.process,N=function(){try{return A&&A.binding&&A.binding("util")}catch(e){}}(),M=N&&N.isTypedArray;function k(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function L(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function j(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}var R,O,D,Q=Array.prototype,B=Function.prototype,F=Object.prototype,z=C["__core-js_shared__"],P=B.toString,U=F.hasOwnProperty,V=(R=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"",H=F.toString,G=RegExp("^"+P.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=S?C.Buffer:void 0,Z=C.Symbol,W=C.Uint8Array,K=F.propertyIsEnumerable,J=Q.splice,X=Z?Z.toStringTag:void 0,ee=Object.getOwnPropertySymbols,te=Y?Y.isBuffer:void 0,ie=(O=Object.keys,D=Object,function(e){return O(D(e))}),ne=Ne(C,"DataView"),oe=Ne(C,"Map"),se=Ne(C,"Promise"),re=Ne(C,"Set"),ae=Ne(C,"WeakMap"),le=Ne(Object,"create"),ce=je(ne),ue=je(oe),de=je(se),pe=je(re),he=je(ae),_e=Z?Z.prototype:void 0,me=_e?_e.valueOf:void 0;function ge(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function ve(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function fe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function be(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new fe;++t<i;)this.add(e[t])}function ye(e){var t=this.__data__=new ve(e);this.size=t.size}function qe(e,t){var i=De(e),n=!i&&Oe(e),o=!i&&!n&&Qe(e),s=!i&&!n&&!o&&Ue(e),r=i||n||o||s,a=r?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],l=a.length;for(var c in e)!t&&!U.call(e,c)||r&&("length"==c||o&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Le(c,l))||a.push(c);return a}function xe(e,t){for(var i=e.length;i--;)if(Re(e[i][0],t))return i;return-1}function Te(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":X&&X in Object(e)?function(e){var t=U.call(e,X),i=e[X];try{e[X]=void 0;var n=!0}catch(e){}var o=H.call(e);n&&(t?e[X]=i:delete e[X]);return o}(e):function(e){return H.call(e)}(e)}function we(e){return Pe(e)&&Te(e)==o}function Ie(e,t,i,n,c){return e===t||(null==e||null==t||!Pe(e)&&!Pe(t)?e!=e&&t!=t:function(e,t,i,n,c,h){var f=De(e),q=De(t),x=f?s:ke(e),T=q?s:ke(t),w=(x=x==o?p:x)==p,I=(T=T==o?p:T)==p,C=x==T;if(C&&Qe(e)){if(!Qe(t))return!1;f=!0,w=!1}if(C&&!w)return h||(h=new ye),f||Ue(e)?$e(e,t,i,n,c,h):function(e,t,i,n,o,s,c){switch(i){case y:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!s(new W(e),new W(t)));case r:case a:case d:return Re(+e,+t);case l:return e.name==t.name&&e.message==t.message;case _:case g:return e==t+"";case u:var p=L;case m:var h=1&n;if(p||(p=j),e.size!=t.size&&!h)return!1;var f=c.get(e);if(f)return f==t;n|=2,c.set(e,t);var q=$e(p(e),p(t),n,o,s,c);return c.delete(e),q;case v:if(me)return me.call(e)==me.call(t)}return!1}(e,t,x,i,n,c,h);if(!(1&i)){var E=w&&U.call(e,"__wrapped__"),$=I&&U.call(t,"__wrapped__");if(E||$){var S=E?e.value():e,A=$?t.value():t;return h||(h=new ye),c(S,A,i,n,h)}}if(!C)return!1;return h||(h=new ye),function(e,t,i,n,o,s){var r=1&i,a=Se(e),l=a.length,c=Se(t),u=c.length;if(l!=u&&!r)return!1;var d=l;for(;d--;){var p=a[d];if(!(r?p in t:U.call(t,p)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var _=!0;s.set(e,t),s.set(t,e);var m=r;for(;++d<l;){var g=e[p=a[d]],v=t[p];if(n)var f=r?n(v,g,p,t,e,s):n(g,v,p,e,t,s);if(!(void 0===f?g===v||o(g,v,i,n,s):f)){_=!1;break}m||(m="constructor"==p)}if(_&&!m){var b=e.constructor,y=t.constructor;b==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(_=!1)}return s.delete(e),s.delete(t),_}(e,t,i,n,c,h)}(e,t,i,n,Ie,c))}function Ce(e){return!(!ze(e)||function(e){return!!V&&V in e}(e))&&(Be(e)?G:q).test(je(e))}function Ee(e){if(i=(t=e)&&t.constructor,n="function"==typeof i&&i.prototype||F,t!==n)return ie(e);var t,i,n,o=[];for(var s in Object(e))U.call(e,s)&&"constructor"!=s&&o.push(s);return o}function $e(e,t,i,n,o,s){var r=1&i,a=e.length,l=t.length;if(a!=l&&!(r&&l>a))return!1;var c=s.get(e);if(c&&s.get(t))return c==t;var u=-1,d=!0,p=2&i?new be:void 0;for(s.set(e,t),s.set(t,e);++u<a;){var h=e[u],_=t[u];if(n)var m=r?n(_,h,u,t,e,s):n(h,_,u,e,t,s);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!k(t,(function(e,t){if(r=t,!p.has(r)&&(h===e||o(h,e,i,n,s)))return p.push(t);var r}))){d=!1;break}}else if(h!==_&&!o(h,_,i,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function Se(e){return function(e,t,i){var n=t(e);return De(e)?n:function(e,t){for(var i=-1,n=t.length,o=e.length;++i<n;)e[o+i]=t[i];return e}(n,i(e))}(e,Ve,Me)}function Ae(e,t){var i,n,o=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?o["string"==typeof t?"string":"hash"]:o.map}function Ne(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return Ce(i)?i:void 0}ge.prototype.clear=function(){this.__data__=le?le(null):{},this.size=0},ge.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ge.prototype.get=function(e){var t=this.__data__;if(le){var n=t[e];return n===i?void 0:n}return U.call(t,e)?t[e]:void 0},ge.prototype.has=function(e){var t=this.__data__;return le?void 0!==t[e]:U.call(t,e)},ge.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=le&&void 0===t?i:t,this},ve.prototype.clear=function(){this.__data__=[],this.size=0},ve.prototype.delete=function(e){var t=this.__data__,i=xe(t,e);return!(i<0)&&(i==t.length-1?t.pop():J.call(t,i,1),--this.size,!0)},ve.prototype.get=function(e){var t=this.__data__,i=xe(t,e);return i<0?void 0:t[i][1]},ve.prototype.has=function(e){return xe(this.__data__,e)>-1},ve.prototype.set=function(e,t){var i=this.__data__,n=xe(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this},fe.prototype.clear=function(){this.size=0,this.__data__={hash:new ge,map:new(oe||ve),string:new ge}},fe.prototype.delete=function(e){var t=Ae(this,e).delete(e);return this.size-=t?1:0,t},fe.prototype.get=function(e){return Ae(this,e).get(e)},fe.prototype.has=function(e){return Ae(this,e).has(e)},fe.prototype.set=function(e,t){var i=Ae(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this},be.prototype.add=be.prototype.push=function(e){return this.__data__.set(e,i),this},be.prototype.has=function(e){return this.__data__.has(e)},ye.prototype.clear=function(){this.__data__=new ve,this.size=0},ye.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},ye.prototype.get=function(e){return this.__data__.get(e)},ye.prototype.has=function(e){return this.__data__.has(e)},ye.prototype.set=function(e,t){var i=this.__data__;if(i instanceof ve){var n=i.__data__;if(!oe||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new fe(n)}return i.set(e,t),this.size=i.size,this};var Me=ee?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var i=-1,n=null==e?0:e.length,o=0,s=[];++i<n;){var r=e[i];t(r,i,e)&&(s[o++]=r)}return s}(ee(e),(function(t){return K.call(e,t)})))}:function(){return[]},ke=Te;function Le(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||x.test(e))&&e>-1&&e%1==0&&e<t}function je(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Re(e,t){return e===t||e!=e&&t!=t}(ne&&ke(new ne(new ArrayBuffer(1)))!=y||oe&&ke(new oe)!=u||se&&ke(se.resolve())!=h||re&&ke(new re)!=m||ae&&ke(new ae)!=f)&&(ke=function(e){var t=Te(e),i=t==p?e.constructor:void 0,n=i?je(i):"";if(n)switch(n){case ce:return y;case ue:return u;case de:return h;case pe:return m;case he:return f}return t});var Oe=we(function(){return arguments}())?we:function(e){return Pe(e)&&U.call(e,"callee")&&!K.call(e,"callee")},De=Array.isArray;var Qe=te||function(){return!1};function Be(e){if(!ze(e))return!1;var t=Te(e);return t==c||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Fe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function ze(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Pe(e){return null!=e&&"object"==typeof e}var Ue=M?function(e){return function(t){return e(t)}}(M):function(e){return Pe(e)&&Fe(e.length)&&!!T[Te(e)]};function Ve(e){return null!=(t=e)&&Fe(t.length)&&!Be(t)?qe(e):Ee(e);var t}e.exports=function(e,t){return Ie(e,t)}})),AttributeMap_1=createCommonjsModule((function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.compose=function(e={},t={},i=!1){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});let n=lodash_clonedeep(t);i||(n=Object.keys(n).reduce(((e,t)=>(null!=n[t]&&(e[t]=n[t]),e)),{}));for(const i in e)void 0!==e[i]&&void 0===t[i]&&(n[i]=e[i]);return Object.keys(n).length>0?n:void 0},e.diff=function(e={},t={}){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});const i=Object.keys(e).concat(Object.keys(t)).reduce(((i,n)=>(lodash_isequal(e[n],t[n])||(i[n]=void 0===t[n]?null:t[n]),i)),{});return Object.keys(i).length>0?i:void 0},e.invert=function(e={},t={}){e=e||{};const i=Object.keys(t).reduce(((i,n)=>(t[n]!==e[n]&&void 0!==e[n]&&(i[n]=t[n]),i)),{});return Object.keys(e).reduce(((i,n)=>(e[n]!==t[n]&&void 0===t[n]&&(i[n]=null),i)),i)},e.transform=function(e,t,i=!1){if("object"!=typeof e)return t;if("object"!=typeof t)return;if(!i)return t;const n=Object.keys(t).reduce(((i,n)=>(void 0===e[n]&&(i[n]=t[n]),i)),{});return Object.keys(n).length>0?n:void 0}}(i||(i={})),t.default=i})),Op_1=createCommonjsModule((function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.length=function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"object"==typeof e.retain&&null!==e.retain?1:"string"==typeof e.insert?e.insert.length:1}}(i||(i={})),t.default=i})),OpIterator=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const i=this.offset,n=Op_1.default.length(t);if(e>=n-i?(e=n-i,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};{const n={};return t.attributes&&(n.attributes=t.attributes),"number"==typeof t.retain?n.retain=e:"object"==typeof t.retain&&null!==t.retain?n.retain=t.retain:"string"==typeof t.insert?n.insert=t.insert.substr(i,e):n.insert=t.insert,n}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?Op_1.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?"number"==typeof e.delete?"delete":"number"==typeof e.retain||"object"==typeof e.retain&&null!==e.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const e=this.offset,t=this.index,i=this.next(),n=this.ops.slice(this.index);return this.offset=e,this.index=t,[i].concat(n)}}return[]}}})),Delta_1=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0,t.AttributeMap=AttributeMap_1.default,t.Op=Op_1.default,t.OpIterator=OpIterator.default;const i=String.fromCharCode(0),n=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const i=Object.keys(e)[0];if(!i||i!==Object.keys(t)[0])throw new Error(`embed types not matched: ${i} != ${Object.keys(t)[0]}`);return[i,e[i],t[i]]};class o{constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const i={};return"string"==typeof e&&0===e.length?this:(i.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(i.attributes=t),this.push(i))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const i={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(i.attributes=t),this.push(i)}push(e){let t=this.ops.length,i=this.ops[t-1];if(e=lodash_clonedeep(e),"object"==typeof i){if("number"==typeof e.delete&&"number"==typeof i.delete)return this.ops[t-1]={delete:i.delete+e.delete},this;if("number"==typeof i.delete&&null!=e.insert&&(t-=1,i=this.ops[t-1],"object"!=typeof i))return this.ops.unshift(e),this;if(lodash_isequal(e.attributes,i.attributes)){if("string"==typeof e.insert&&"string"==typeof i.insert)return this.ops[t-1]={insert:i.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof i.retain)return this.ops[t-1]={retain:i.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],i=[];return this.forEach((n=>{(e(n)?t:i).push(n)})),[t,i]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce(((e,t)=>t.insert?e+Op_1.default.length(t):t.delete?e-t.delete:e),0)}length(){return this.reduce(((e,t)=>e+Op_1.default.length(t)),0)}slice(e=0,t=1/0){const i=[],n=new OpIterator.default(this.ops);let s=0;for(;s<t&&n.hasNext();){let o;s<e?o=n.next(e-s):(o=n.next(t-s),i.push(o)),s+=Op_1.default.length(o)}return new o(i)}compose(e){const t=new OpIterator.default(this.ops),i=new OpIterator.default(e.ops),s=[],r=i.peek();if(null!=r&&"number"==typeof r.retain&&null==r.attributes){let e=r.retain;for(;"insert"===t.peekType()&&t.peekLength()<=e;)e-=t.peekLength(),s.push(t.next());r.retain-e>0&&i.next(r.retain-e)}const a=new o(s);for(;t.hasNext()||i.hasNext();)if("insert"===i.peekType())a.push(i.next());else if("delete"===t.peekType())a.push(t.next());else{const e=Math.min(t.peekLength(),i.peekLength()),s=t.next(e),r=i.next(e);if(r.retain){const l={};if("number"==typeof s.retain)l.retain="number"==typeof r.retain?e:r.retain;else if("number"==typeof r.retain)null==s.retain?l.insert=s.insert:l.retain=s.retain;else{const e=null==s.retain?"insert":"retain",[t,i,a]=n(s[e],r.retain),c=o.getHandler(t);l[e]={[t]:c.compose(i,a,"retain"===e)}}const c=AttributeMap_1.default.compose(s.attributes,r.attributes,"number"==typeof s.retain);if(c&&(l.attributes=c),a.push(l),!i.hasNext()&&lodash_isequal(a.ops[a.ops.length-1],l)){const e=new o(t.rest());return a.concat(e).chop()}}else"number"==typeof r.delete&&("number"==typeof s.retain||"object"==typeof s.retain&&null!==s.retain)&&a.push(r)}return a.chop()}concat(e){const t=new o(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new o;const n=[this,e].map((t=>t.map((n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:i;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join(""))),s=new o,r=diff_1(n[0],n[1],t,!0),a=new OpIterator.default(this.ops),l=new OpIterator.default(e.ops);return r.forEach((e=>{let t=e[1].length;for(;t>0;){let i=0;switch(e[0]){case diff_1.INSERT:i=Math.min(l.peekLength(),t),s.push(l.next(i));break;case diff_1.DELETE:i=Math.min(t,a.peekLength()),a.next(i),s.delete(i);break;case diff_1.EQUAL:i=Math.min(a.peekLength(),l.peekLength(),t);const e=a.next(i),n=l.next(i);lodash_isequal(e.insert,n.insert)?s.retain(i,AttributeMap_1.default.diff(e.attributes,n.attributes)):s.push(n).delete(i)}t-=i}})),s.chop()}eachLine(e,t="\n"){const i=new OpIterator.default(this.ops);let n=new o,s=0;for(;i.hasNext();){if("insert"!==i.peekType())return;const r=i.peek(),a=Op_1.default.length(r)-i.peekLength(),l="string"==typeof r.insert?r.insert.indexOf(t,a)-a:-1;if(l<0)n.push(i.next());else if(l>0)n.push(i.next(l));else{if(!1===e(n,i.next(1).attributes||{},s))return;s+=1,n=new o}}n.length()>0&&e(n,{},s)}invert(e){const t=new o;return this.reduce(((i,s)=>{if(s.insert)t.delete(Op_1.default.length(s));else{if("number"==typeof s.retain&&null==s.attributes)return t.retain(s.retain),i+s.retain;if(s.delete||"number"==typeof s.retain){const n=s.delete||s.retain;return e.slice(i,i+n).forEach((e=>{s.delete?t.push(e):s.retain&&s.attributes&&t.retain(Op_1.default.length(e),AttributeMap_1.default.invert(s.attributes,e.attributes))})),i+n}if("object"==typeof s.retain&&null!==s.retain){const r=e.slice(i,i+1),a=new OpIterator.default(r.ops).next(),[l,c,u]=n(s.retain,a.insert),d=o.getHandler(l);return t.retain({[l]:d.invert(c,u)},AttributeMap_1.default.invert(s.attributes,a.attributes)),i+1}}return i}),0),t.chop()}transform(e,t=!1){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);const i=e,n=new OpIterator.default(this.ops),s=new OpIterator.default(i.ops),r=new o;for(;n.hasNext()||s.hasNext();)if("insert"!==n.peekType()||!t&&"insert"===s.peekType())if("insert"===s.peekType())r.push(s.next());else{const e=Math.min(n.peekLength(),s.peekLength()),i=n.next(e),a=s.next(e);if(i.delete)continue;if(a.delete)r.push(a);else{const n=i.retain,s=a.retain;let l="object"==typeof s&&null!==s?s:e;if("object"==typeof n&&null!==n&&"object"==typeof s&&null!==s){const e=Object.keys(n)[0];if(e===Object.keys(s)[0]){const i=o.getHandler(e);i&&(l={[e]:i.transform(n[e],s[e],t)})}}r.retain(l,AttributeMap_1.default.transform(i.attributes,a.attributes,t))}}else r.retain(Op_1.default.length(n.next()));return r.chop()}transformPosition(e,t=!1){t=!!t;const i=new OpIterator.default(this.ops);let n=0;for(;i.hasNext()&&n<=e;){const o=i.peekLength(),s=i.peekType();i.next(),"delete"!==s?("insert"===s&&(n<e||!t)&&(e+=o),n+=o):e-=Math.min(o,e-n)}return e}}o.Op=Op_1.default,o.OpIterator=OpIterator.default,o.AttributeMap=AttributeMap_1.default,o.handlers={},t.default=o,e.exports=o,e.exports.default=o})),Delta=unwrapExports(Delta_1);class Break extends EmbedBlot$1{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Break.blotName="break",Break.tagName="BR";class Text$1 extends TextBlot$1{}const entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function escapeText(e){return e.replace(/[&<>"']/g,(e=>entityMap[e]))}class Inline extends InlineBlot$1{static allowedChildren=[Inline,Break,EmbedBlot$1,Text$1];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const i=Inline.order.indexOf(e),n=Inline.order.indexOf(t);return i>=0||n>=0?i-n:e===t?0:e<t?-1:1}formatAt(e,t,i,n){if(Inline.compare(this.statics.blotName,i)<0&&this.scroll.query(i,Scope.BLOT)){const o=this.isolate(e,t);n&&o.wrap(i,n)}else super.formatAt(e,t,i,n)}optimize(e){if(super.optimize(e),this.parent instanceof Inline&&Inline.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}}const NEWLINE_LENGTH=1;class Block extends BlockBlot$1{cache={};delta(){return null==this.cache.delta&&(this.cache.delta=blockDelta(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,i,n){t<=0||(this.scroll.query(i,Scope.BLOCK)?e+t===this.length()&&this.format(i,n):super.formatAt(e,Math.min(t,this.length()-e-1),i,n),this.cache={})}insertAt(e,t,i){if(null!=i)return super.insertAt(e,t,i),void(this.cache={});if(0===t.length)return;const n=t.split("\n"),o=n.shift();o.length>0&&(e<this.length()-1||null==this.children.tail?super.insertAt(Math.min(e,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});let s=this;n.reduce(((e,t)=>(s=s.split(e,!0),s.insertAt(0,t),t.length)),e+o.length)}insertBefore(e,t){const{head:i}=this.children;super.insertBefore(e,t),i instanceof Break&&i.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t&&(0===e||e>=this.length()-1)){const t=this.clone();return 0===e?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}const i=super.split(e,t);return this.cache={},i}}Block.blotName="block",Block.tagName="P",Block.defaultChild=Break,Block.allowedChildren=[Break,Inline,EmbedBlot$1,Text$1];class BlockEmbed extends EmbedBlot$1{attach(){super.attach(),this.attributes=new AttributorStore$1(this.domNode)}delta(){return(new Delta).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const i=this.scroll.query(e,Scope.BLOCK_ATTRIBUTE);null!=i&&this.attributes.attribute(i,t)}formatAt(e,t,i,n){this.format(i,n)}insertAt(e,t,i){if(null!=i)return void super.insertAt(e,t,i);const n=t.split("\n"),o=n.pop(),s=n.map((e=>{const t=this.scroll.create(Block.blotName);return t.insertAt(0,e),t})),r=this.split(e);s.forEach((e=>{this.parent.insertBefore(e,r)})),o&&this.parent.insertBefore(this.scroll.create("text",o),r)}}function blockDelta(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.descendants(LeafBlot$1).reduce(((e,i)=>0===i.length()?e:e.insert(i.value(),bubbleFormats(i,{},t))),new Delta).insert("\n",bubbleFormats(e))}function bubbleFormats(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==e?t:("formats"in e&&"function"==typeof e.formats&&(t={...t,...e.formats()},i&&delete t["code-token"]),null==e.parent||"scroll"===e.parent.statics.blotName||e.parent.statics.scope!==e.statics.scope?t:bubbleFormats(e.parent,t,i))}BlockEmbed.scope=Scope.BLOCK_BLOT;class Cursor extends EmbedBlot$1{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,i){super(e,t),this.selection=i,this.textNode=document.createTextNode(Cursor.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(e,t){if(0!==this.savedLength)return void super.format(e,t);let i=this,n=0;for(;null!=i&&i.statics.scope!==Scope.BLOCK_BLOT;)n+=i.offset(i.parent),i=i.parent;null!=i&&(this.savedLength=Cursor.CONTENTS.length,i.optimize(),i.formatAt(n,Cursor.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return null;const e=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof Text$1?this.prev:null,i=t?t.length():0,n=this.next instanceof Text$1?this.next:null,o=n?n.text:"",{textNode:s}=this,r=s.data.split(Cursor.CONTENTS).join("");let a;if(s.data=Cursor.CONTENTS,t)a=t,(r||n)&&(t.insertAt(t.length(),r+o),n&&n.remove());else if(n)a=n,n.insertAt(0,r);else{const e=document.createTextNode(r);a=this.scroll.create(e),this.parent.insertBefore(a,this)}if(this.remove(),e){const o=(e,o)=>t&&e===t.domNode?o:e===s?i+o-1:n&&e===n.domNode?i+r.length+o:null,l=o(e.start.node,e.start.offset),c=o(e.end.node,e.end.offset);if(null!==l&&null!==c)return{startNode:a.domNode,startOffset:l,endNode:a.domNode,endOffset:c}}return null}update(e,t){if(e.some((e=>"characterData"===e.type&&e.target===this.textNode))){const e=this.restore();e&&(t.range=e)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if("A"===t.domNode.tagName){this.savedLength=Cursor.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var eventemitter3=createCommonjsModule((function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,r){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new o(n,s||e,r),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,s=n.length,r=new Array(s);o<s;o++)r[o]=n[o].fn;return r},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,o,s,r){var a=i?i+e:e;if(!this._events[a])return!1;var l,c,u=this._events[a],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,s),!0;case 6:return u.fn.call(u.context,t,n,o,s,r),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,o);break;default:if(!l)for(p=1,l=new Array(d-1);p<d;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,o){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return r(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||o&&!a.once||n&&a.context!==n||r(this,s);else{for(var l=0,c=[],u=a.length;l<u;l++)(a[l].fn!==t||o&&!a[l].once||n&&a[l].context!==n)&&c.push(a[l]);c.length?this._events[s]=1===c.length?c[0]:c:r(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&r(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a})),instances=new WeakMap;const levels=["error","warn","log","info"];let level="warn";function debug(e){if(level&&levels.indexOf(e)<=levels.indexOf(level)){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];console[e](...i)}}function namespace(e){return levels.reduce(((t,i)=>(t[i]=debug.bind(console,i,e),t)),{})}namespace.level=e=>{level=e},debug.level=namespace.level;const debug$1=namespace("quill:events"),EVENTS=["selectionchange","mousedown","mouseup","click"];EVENTS.forEach((e=>{document.addEventListener(e,(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];Array.from(document.querySelectorAll(".ql-container")).forEach((e=>{const i=instances.get(e);i&&i.emitter&&i.emitter.handleDOM(...t)}))}))}));class Emitter extends eventemitter3.EventEmitter{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",debug$1.error)}emit(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return debug$1.log.call(debug$1,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];(this.domListeners[e.type]||[]).forEach((t=>{let{node:n,handler:o}=t;(e.target===n||n.contains(e.target))&&o(e,...i)}))}listenDOM(e,t,i){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:i})}}const debug$2=namespace("quill:selection");class Range{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=e,this.length=t}}class Selection{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Range(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,Emitter.sources.USER),1)})),this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const e=this.getNativeRange();null!=e&&e.start.node!==this.cursor.textNode&&this.emitter.once(Emitter.events.SCROLL_UPDATE,((t,i)=>{try{this.root.contains(e.start.node)&&this.root.contains(e.end.node)&&this.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset);const n=i.some((e=>"characterData"===e.type||"childList"===e.type||"attributes"===e.type&&e.target===this.root));this.update(n?Emitter.sources.SILENT:t)}catch(e){}}))})),this.emitter.on(Emitter.events.SCROLL_OPTIMIZE,((e,t)=>{if(t.range){const{startNode:e,startOffset:i,endNode:n,endOffset:o}=t.range;this.setNativeRange(e,i,n,o),this.update(Emitter.sources.SILENT)}})),this.update(Emitter.sources.SILENT)}handleComposition(){this.emitter.on(Emitter.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(Emitter.events.COMPOSITION_END,(()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout((()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(Emitter.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const i=this.getNativeRange();if(null!=i&&i.native.collapsed&&!this.scroll.query(e,Scope.BLOCK)){if(i.start.node!==this.cursor.textNode){const e=this.scroll.find(i.start.node,!1);if(null==e)return;if(e instanceof LeafBlot$1){const t=e.split(i.start.offset);e.parent.insertBefore(this.cursor,t)}else e.insertBefore(this.cursor,i.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=this.scroll.length();let n;e=Math.min(e,i-1),t=Math.min(e+t,i-1)-e;let[o,s]=this.scroll.leaf(e);if(null==o)return null;if(t>0&&s===o.length()){const[t]=this.scroll.leaf(e+1);if(t){const[i]=this.scroll.line(e),[n]=this.scroll.line(e+1);i===n&&(o=t,s=0)}}[n,s]=o.position(s,!0);const r=document.createRange();if(t>0)return r.setStart(n,s),[o,s]=this.scroll.leaf(e+t),null==o?null:([n,s]=o.position(s,!0),r.setEnd(n,s),r.getBoundingClientRect());let a,l="left";if(n instanceof Text){if(!n.data.length)return null;s<n.data.length?(r.setStart(n,s),r.setEnd(n,s+1)):(r.setStart(n,s-1),r.setEnd(n,s),l="right"),a=r.getBoundingClientRect()}else{if(!(o.domNode instanceof Element))return null;a=o.domNode.getBoundingClientRect(),s>0&&(l="right")}return{bottom:a.top+a.height,height:a.height,left:a[l],right:a[l],top:a.top,width:0}}getNativeRange(){const e=document.getSelection();if(null==e||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(null==t)return null;const i=this.normalizeNative(t);return debug$2.info("getNativeRange",i),i}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();if(null==t)return[null,null];return[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&contains(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const i=t.map((e=>{const[t,i]=e,n=this.scroll.find(t,!0),o=n.offset(this.scroll);return 0===i?o:n instanceof LeafBlot$1?o+n.index(t,i):o+n.length()})),n=Math.min(Math.max(...i),this.scroll.length()-1),o=Math.min(n,...i);return new Range(o,n-o)}normalizeNative(e){if(!contains(this.root,e.startContainer)||!e.collapsed&&!contains(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((e=>{let{node:t,offset:i}=e;for(;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>i)t=t.childNodes[i],i=0;else{if(t.childNodes.length!==i)break;t=t.lastChild,i=t instanceof Text?t.data.length:t.childNodes.length>0?t.childNodes.length:t.childNodes.length+1}e.node=t,e.offset=i})),t}rangeToNative(e){const t=this.scroll.length(),i=(e,i)=>{e=Math.min(t-1,e);const[n,o]=this.scroll.leaf(e);return n?n.position(o,i):[null,-1]};return[...i(e.index,!1),...i(e.index+e.length,!0)]}setNativeRange(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(debug$2.info("setNativeRange",e,t,i,n),null!=e&&(null==this.root.parentNode||null==e.parentNode||null==i.parentNode))return;const s=document.getSelection();if(null!=s)if(null!=e){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:r}=this.getNativeRange()||{};if(null==r||o||e!==r.startContainer||t!==r.startOffset||i!==r.endContainer||n!==r.endOffset){e instanceof Element&&"BR"===e.tagName&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),i instanceof Element&&"BR"===i.tagName&&(n=Array.from(i.parentNode.childNodes).indexOf(i),i=i.parentNode);const o=document.createRange();o.setStart(e,t),o.setEnd(i,n),s.removeAllRanges(),s.addRange(o)}}else s.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Emitter.sources.API;if("string"==typeof t&&(i=t,t=!1),debug$2.info("setRange",e),null!=e){const i=this.rangeToNative(e);this.setNativeRange(...i,t)}else this.setNativeRange(null);this.update(i)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Emitter.sources.USER;const t=this.lastRange,[i,n]=this.getRange();if(this.lastRange=i,this.lastNative=n,null!=this.lastRange&&(this.savedRange=this.lastRange),!isEqual(t,this.lastRange)){if(!this.composing&&null!=n&&n.native.collapsed&&n.start.node!==this.cursor.textNode){const e=this.cursor.restore();e&&this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}const i=[Emitter.events.SELECTION_CHANGE,cloneDeep(this.lastRange),cloneDeep(t),e];this.emitter.emit(Emitter.events.EDITOR_CHANGE,...i),e!==Emitter.sources.SILENT&&this.emitter.emit(...i)}}}function contains(e,t){try{t.parentNode}catch(e){return!1}return e.contains(t)}const ASCII=/^[ -~]*$/;class Editor{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const i=normalizeDelta(e),n=new Delta;return splitOpLines(i.ops.slice()).reduce(((e,i)=>{const o=Delta.Op.length(i);let s=i.attributes||{},r=!1,a=!1;if(null!=i.insert){if(n.retain(o),"string"==typeof i.insert){const n=i.insert;a=!n.endsWith("\n")&&(t<=e||!!this.scroll.descendant(BlockEmbed,e)[0]),this.scroll.insertAt(e,n);const[o,r]=this.scroll.line(e);let l=merge({},bubbleFormats(o));if(o instanceof Block){const[e]=o.descendant(LeafBlot$1,r);e&&(l=merge(l,bubbleFormats(e)))}s=Delta.AttributeMap.diff(l,s)||{}}else if("object"==typeof i.insert){const n=Object.keys(i.insert)[0];if(null==n)return e;const o=null!=this.scroll.query(n,Scope.INLINE);if(o)(t<=e||this.scroll.descendant(BlockEmbed,e)[0])&&(a=!0);else if(e>0){const[t,i]=this.scroll.descendant(LeafBlot$1,e-1);if(t instanceof Text$1){"\n"!==t.value()[i]&&(r=!0)}else t instanceof EmbedBlot$1&&t.statics.scope===Scope.INLINE_BLOT&&(r=!0)}if(this.scroll.insertAt(e,n,i.insert[n]),o){const[t]=this.scroll.descendant(LeafBlot$1,e);if(t){const e=merge({},bubbleFormats(t));s=Delta.AttributeMap.diff(e,s)||{}}}}t+=o}else if(n.push(i),null!==i.retain&&"object"==typeof i.retain){const t=Object.keys(i.retain)[0];if(null==t)return e;this.scroll.updateEmbedAt(e,t,i.retain[t])}Object.keys(s).forEach((t=>{this.scroll.formatAt(e,o,t,s[t])}));const l=r?1:0,c=a?1:0;return t+=l+c,n.retain(l),n.delete(c),e+o+l+c}),0),n.reduce(((e,t)=>"number"==typeof t.delete?(this.scroll.deleteAt(e,t.delete),e):e+Delta.Op.length(t)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(i)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new Delta).retain(e).delete(t))}formatLine(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(i).forEach((n=>{this.scroll.lines(e,Math.max(t,1)).forEach((e=>{e.format(n,i[n])}))})),this.scroll.optimize();const n=(new Delta).retain(e).retain(t,cloneDeep(i));return this.update(n)}formatText(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(i).forEach((n=>{this.scroll.formatAt(e,t,n,i[n])}));const n=(new Delta).retain(e).retain(t,cloneDeep(i));return this.update(n)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce(((e,t)=>e.concat(t.delta())),new Delta)}getFormat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=[],n=[];0===t?this.scroll.path(e).forEach((e=>{const[t]=e;t instanceof Block?i.push(t):t instanceof LeafBlot$1&&n.push(t)})):(i=this.scroll.lines(e,t),n=this.scroll.descendants(LeafBlot$1,e,t));const[o,s]=[i,n].map((e=>{const t=e.shift();if(null==t)return{};let i=bubbleFormats(t);for(;Object.keys(i).length>0;){const t=e.shift();if(null==t)return i;i=combineFormats(bubbleFormats(t),i)}return i}));return{...o,...s}}getHTML(e,t){const[i,n]=this.scroll.line(e);if(i){const o=i.length();return!(i.length()>=n+t)||0===n&&t===o?convertHTML(this.scroll,e,t,!0):convertHTML(i,n,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter((e=>"string"==typeof e.insert)).map((e=>e.insert)).join("")}insertContents(e,t){const i=normalizeDelta(t),n=(new Delta).retain(e).concat(i);return this.scroll.insertContents(e,i),this.update(n)}insertEmbed(e,t,i){return this.scroll.insertAt(e,t,i),this.update((new Delta).retain(e).insert({[t]:i}))}insertText(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(i).forEach((n=>{this.scroll.formatAt(e,t.length,n,i[n])})),this.update((new Delta).retain(e).insert(t,cloneDeep(i)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==Block.blotName)return!1;const t=e;return!(t.children.length>1)&&t.children.head instanceof Break}removeFormat(e,t){const i=this.getText(e,t),[n,o]=this.scroll.line(e+t);let s=0,r=new Delta;null!=n&&(s=n.length()-o,r=n.delta().slice(o,o+s-1).insert("\n"));const a=this.getContents(e,t+s).diff((new Delta).insert(i).concat(r)),l=(new Delta).retain(e).concat(a);return this.applyDelta(l)}update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const n=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(ASCII)&&this.scroll.find(t[0].target)){const o=this.scroll.find(t[0].target),s=bubbleFormats(o),r=o.offset(this.scroll),a=t[0].oldValue.replace(Cursor.CONTENTS,""),l=(new Delta).insert(a),c=(new Delta).insert(o.value()),u=i&&{oldRange:shiftRange(i.oldRange,-r),newRange:shiftRange(i.newRange,-r)};e=(new Delta).retain(r).concat(l.diff(c,u)).reduce(((e,t)=>t.insert?e.insert(t.insert,s):e.push(t)),new Delta),this.delta=n.compose(e)}else this.delta=this.getDelta(),e&&isEqual(n.compose(e),this.delta)||(e=n.diff(this.delta,i));return e}}function convertListHTML(e,t,i){if(0===e.length){const[e]=getListType(i.pop());return t<=0?`</li></${e}>`:`</li></${e}>${convertListHTML([],t-1,i)}`}const[{child:n,offset:o,length:s,indent:r,type:a},...l]=e,[c,u]=getListType(a);if(r>t)return i.push(a),r===t+1?`<${c}><li${u}>${convertHTML(n,o,s)}${convertListHTML(l,r,i)}`:`<${c}><li>${convertListHTML(e,t+1,i)}`;const d=i[i.length-1];if(r===t&&a===d)return`</li><li${u}>${convertHTML(n,o,s)}${convertListHTML(l,r,i)}`;const[p]=getListType(i.pop());return`</li></${p}>${convertListHTML(e,t-1,i)}`}function convertHTML(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in e&&"function"==typeof e.html)return e.html(t,i);if(e instanceof Text$1){return escapeText(e.value().slice(t,t+i)).replaceAll(" ","&nbsp;")}if(e instanceof ParentBlot$1){if("list-container"===e.statics.blotName){const n=[];return e.children.forEachAt(t,i,((e,t,i)=>{const o="formats"in e&&"function"==typeof e.formats?e.formats():{};n.push({child:e,offset:t,length:i,indent:o.indent||0,type:o.list})})),convertListHTML(n,-1,[])}const o=[];if(e.children.forEachAt(t,i,((e,t,i)=>{o.push(convertHTML(e,t,i))})),n||"list"===e.statics.blotName)return o.join("");const{outerHTML:s,innerHTML:r}=e.domNode,[a,l]=s.split(`>${r}<`);return"<table"===a?`<table style="border: 1px solid #000;">${o.join("")}<${l}`:`${a}>${o.join("")}<${l}`}return e.domNode instanceof Element?e.domNode.outerHTML:""}function combineFormats(e,t){return Object.keys(t).reduce(((i,n)=>{if(null==e[n])return i;const o=t[n];return o===e[n]?i[n]=o:Array.isArray(o)?o.indexOf(e[n])<0?i[n]=o.concat([e[n]]):i[n]=o:i[n]=[o,e[n]],i}),{})}function getListType(e){const t="ordered"===e?"ol":"ul";switch(e){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function normalizeDelta(e){return e.reduce(((e,t)=>{if("string"==typeof t.insert){const i=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(i,t.attributes)}return e.push(t)}),new Delta)}function shiftRange(e,t){let{index:i,length:n}=e;return new Range(i+t,n)}function splitOpLines(e){const t=[];return e.forEach((e=>{if("string"==typeof e.insert){e.insert.split("\n").forEach(((i,n)=>{n&&t.push({insert:"\n",attributes:e.attributes}),i&&t.push({insert:i,attributes:e.attributes})}))}else t.push(e)})),t}class Module{static DEFAULTS={};constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=e,this.options=t}}const GUARD_TEXT="\ufeff";class Embed extends EmbedBlot$1{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((e=>{this.contentNode.appendChild(e)})),this.leftGuard=document.createTextNode("\ufeff"),this.rightGuard=document.createTextNode("\ufeff"),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t,i=null;const n=e.data.split("\ufeff").join("");if(e===this.leftGuard)if(this.prev instanceof Text$1){const e=this.prev.length();this.prev.insertAt(e,n),i={startNode:this.prev.domNode,startOffset:e+n.length}}else t=document.createTextNode(n),this.parent.insertBefore(this.scroll.create(t),this),i={startNode:t,startOffset:n.length};else e===this.rightGuard&&(this.next instanceof Text$1?(this.next.insertAt(0,n),i={startNode:this.next.domNode,startOffset:n.length}):(t=document.createTextNode(n),this.parent.insertBefore(this.scroll.create(t),this.next),i={startNode:t,startOffset:n.length}));return e.data="\ufeff",i}update(e,t){e.forEach((e=>{if("characterData"===e.type&&(e.target===this.leftGuard||e.target===this.rightGuard)){const i=this.restore(e.target);i&&(t.range=i)}}))}}class Composition{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(e=>{this.isComposing||this.handleCompositionStart(e)})),this.scroll.domNode.addEventListener("compositionend",(e=>{this.isComposing&&queueMicrotask((()=>{this.handleCompositionEnd(e)}))}))}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;!t||t instanceof Embed||(this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Emitter.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Emitter.events.COMPOSITION_END,e),this.isComposing=!1}}class Theme{static DEFAULTS={modules:{}};static themes={default:Theme};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach((e=>{null==this.modules[e]&&this.addModule(e)}))}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const getParentElement=e=>e.parentElement||e.getRootNode().host||null,getElementRect=e=>{const t=e.getBoundingClientRect(),i="offsetWidth"in e&&Math.abs(t.width)/e.offsetWidth||1,n="offsetHeight"in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*i,bottom:t.top+e.clientHeight*n,left:t.left}},paddingValueToInt=e=>{const t=parseInt(e,10);return Number.isNaN(t)?0:t},getScrollDistance=(e,t,i,n,o,s)=>e<i&&t>n?0:e<i?-(i-e+o):t>n?t-e>n-i?e+o-i:t-n+s:0,scrollRectIntoView=(e,t)=>{const i=e.ownerDocument;let n=t,o=e;for(;o;){const e=o===i.body,t=e?{top:0,right:window.visualViewport?.width??i.documentElement.clientWidth,bottom:window.visualViewport?.height??i.documentElement.clientHeight,left:0}:getElementRect(o),s=getComputedStyle(o),r=getScrollDistance(n.left,n.right,t.left,t.right,paddingValueToInt(s.scrollPaddingLeft),paddingValueToInt(s.scrollPaddingRight)),a=getScrollDistance(n.top,n.bottom,t.top,t.bottom,paddingValueToInt(s.scrollPaddingTop),paddingValueToInt(s.scrollPaddingBottom));if(r||a)if(e)i.defaultView?.scrollBy(r,a);else{const{scrollLeft:e,scrollTop:t}=o;a&&(o.scrollTop+=a),r&&(o.scrollLeft+=r);const i=o.scrollLeft-e,s=o.scrollTop-t;n={left:n.left-i,top:n.top-s,right:n.right-i,bottom:n.bottom-s}}o=e||"fixed"===s.position?null:getParentElement(o)}},MAX_REGISTER_ITERATIONS=100,CORE_FORMATS=["block","break","cursor","inline","scroll","text"],createRegistryWithFormats=(e,t,i)=>{const n=new Registry;return CORE_FORMATS.forEach((e=>{const i=t.query(e);i&&n.register(i)})),e.forEach((e=>{let o=t.query(e);o||i.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let s=0;for(;o;)if(n.register(o),o="blotName"in o?o.requiredContainer??null:null,s+=1,s>100){i.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}})),n},debug$3=namespace("quill"),globalRegistry=new Registry;ParentBlot$1.uiClass="ql-ui";class Quill{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:globalRegistry,theme:"default"};static events=Emitter.events;static sources=Emitter.sources;static version="2.0.3";static imports={delta:Delta,parchment:Parchment,"core/module":Module,"core/theme":Theme};static debug(e){!0===e&&(e="log"),namespace.level(e)}static find(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return instances.get(e)||globalRegistry.find(e,t)}static import(e){return null==this.imports[e]&&debug$3.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if("string"!=typeof(arguments.length<=0?void 0:arguments[0])){const e=arguments.length<=0?void 0:arguments[0],t=!!(arguments.length<=1?void 0:arguments[1]),i="attrName"in e?e.attrName:e.blotName;"string"==typeof i?this.register(`formats/${i}`,e,t):Object.keys(e).forEach((i=>{this.register(i,e[i],t)}))}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],i=!!(arguments.length<=2?void 0:arguments[2]);null==this.imports[e]||i||debug$3.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&"boolean"!=typeof t&&"abstract"!==t.blotName&&globalRegistry.register(t),"function"==typeof t.register&&t.register(globalRegistry)}}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=expandConfig(e,t),this.container=this.options.container,null==this.container)return void debug$3.error("Invalid Quill container",e);this.options.debug&&Quill.debug(this.options.debug);const i=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",instances.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Emitter;const n=ScrollBlot$1.blotName,o=this.options.registry.query(n);if(!o||!("blotName"in o))throw new Error(`Cannot initialize Quill without "${n}" blot`);if(this.scroll=new o(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Editor(this.scroll),this.selection=new Selection(this.scroll,this.emitter),this.composition=new Composition(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Emitter.events.EDITOR_CHANGE,(e=>{e===Emitter.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(Emitter.events.SCROLL_UPDATE,((e,t)=>{const i=this.selection.lastRange,[n]=this.selection.getRange(),o=i&&n?{oldRange:i,newRange:n}:void 0;modify.call(this,(()=>this.editor.update(null,t,o)),e)})),this.emitter.on(Emitter.events.SCROLL_EMBED_UPDATE,((e,t)=>{const i=this.selection.lastRange,[n]=this.selection.getRange(),o=i&&n?{oldRange:i,newRange:n}:void 0;modify.call(this,(()=>{const i=(new Delta).retain(e.offset(this)).retain({[e.statics.blotName]:t});return this.editor.update(i,[],o)}),Quill.sources.USER)})),i){const e=this.clipboard.convert({html:`${i}<p><br></p>`,text:"\n"});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){const t=e;(e=document.createElement("div")).classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,i){return[e,t,,i]=overload(e,t,i),modify.call(this,(()=>this.editor.deleteText(e,t)),i,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Emitter.sources.API;return modify.call(this,(()=>{const i=this.getSelection(!0);let n=new Delta;if(null==i)return n;if(this.scroll.query(e,Scope.BLOCK))n=this.editor.formatLine(i.index,i.length,{[e]:t});else{if(0===i.length)return this.selection.format(e,t),n;n=this.editor.formatText(i.index,i.length,{[e]:t})}return this.setSelection(i,Emitter.sources.SILENT),n}),i)}formatLine(e,t,i,n,o){let s;return[e,t,s,o]=overload(e,t,i,n,o),modify.call(this,(()=>this.editor.formatLine(e,t,s)),o,e,0)}formatText(e,t,i,n,o){let s;return[e,t,s,o]=overload(e,t,i,n,o),modify.call(this,(()=>this.editor.formatText(e,t,s)),o,e,0)}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=null;if(i="number"==typeof e?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!i)return null;const n=this.container.getBoundingClientRect();return{bottom:i.bottom-n.top,height:i.height,left:i.left-n.left,right:i.right-n.left,top:i.top-n.top,width:i.width}}getContents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e;return[e,t]=overload(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=overload(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=overload(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Quill.sources.API;return modify.call(this,(()=>this.editor.insertEmbed(e,t,i)),n,e)}insertText(e,t,i,n,o){let s;return[e,,s,o]=overload(e,0,i,n,o),modify.call(this,(()=>this.editor.insertText(e,t,s)),o,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,i){return[e,t,,i]=overload(e,t,i),modify.call(this,(()=>this.editor.removeFormat(e,t)),i,e)}scrollRectIntoView(e){scrollRectIntoView(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Emitter.sources.API;return modify.call(this,(()=>{e=new Delta(e);const t=this.getLength(),i=this.editor.deleteText(0,t),n=this.editor.insertContents(0,e),o=this.editor.deleteText(this.getLength()-1,1);return i.compose(n).compose(o)}),t)}setSelection(e,t,i){null==e?this.selection.setRange(null,t||Quill.sources.API):([e,t,,i]=overload(e,t,i),this.selection.setRange(new Range(Math.max(0,e),t),i),i!==Emitter.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Emitter.sources.API;const i=(new Delta).insert(e);return this.setContents(i,t)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Emitter.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Emitter.sources.API;return modify.call(this,(()=>(e=new Delta(e),this.editor.applyDelta(e))),t,!0)}}function resolveSelector(e){return"string"==typeof e?document.querySelector(e):e}function expandModuleConfig(e){return Object.entries(e??{}).reduce(((e,t)=>{let[i,n]=t;return{...e,[i]:!0===n?{}:n}}),{})}function omitUndefinedValuesFromOptions(e){return Object.fromEntries(Object.entries(e).filter((e=>void 0!==e[1])))}function expandConfig(e,t){const i=resolveSelector(e);if(!i)throw new Error("Invalid Quill container");const n=!t.theme||t.theme===Quill.DEFAULTS.theme?Theme:Quill.import(`themes/${t.theme}`);if(!n)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:o,...s}=Quill.DEFAULTS,{modules:r,...a}=n.DEFAULTS;let l=expandModuleConfig(t.modules);null!=l&&l.toolbar&&l.toolbar.constructor!==Object&&(l={...l,toolbar:{container:l.toolbar}});const c=merge({},expandModuleConfig(o),expandModuleConfig(r),l),u={...s,...omitUndefinedValuesFromOptions(a),...omitUndefinedValuesFromOptions(t)};let d=t.registry;return d?t.formats&&debug$3.warn('Ignoring "formats" option because "registry" is specified'):d=t.formats?createRegistryWithFormats(t.formats,u.registry,debug$3):u.registry,{...u,registry:d,container:i,theme:n,modules:Object.entries(c).reduce(((e,t)=>{let[i,n]=t;if(!n)return e;const o=Quill.import(`modules/${i}`);return null==o?(debug$3.error(`Cannot load ${i} module. Are you sure you registered it?`),e):{...e,[i]:merge({},o.DEFAULTS||{},n)}}),{}),bounds:resolveSelector(u.bounds)}}function modify(e,t,i,n){if(!this.isEnabled()&&t===Emitter.sources.USER&&!this.allowReadOnlyEdits)return new Delta;let o=null==i?null:this.getSelection();const s=this.editor.delta,r=e();if(null!=o&&(!0===i&&(i=o.index),null==n?o=shiftRange$1(o,r,t):0!==n&&(o=shiftRange$1(o,i,n,t)),this.setSelection(o,Emitter.sources.SILENT)),r.length()>0){const e=[Emitter.events.TEXT_CHANGE,r,s,t];this.emitter.emit(Emitter.events.EDITOR_CHANGE,...e),t!==Emitter.sources.SILENT&&this.emitter.emit(...e)}return r}function overload(e,t,i,n,o){let s={};return"number"==typeof e.index&&"number"==typeof e.length?"number"!=typeof t?(o=n,n=i,i=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!=typeof t&&(o=n,n=i,i=t,t=0),"object"==typeof i?(s=i,o=n):"string"==typeof i&&(null!=n?s[i]=n:o=i),[e,t,s,o=o||Emitter.sources.API]}function shiftRange$1(e,t,i,n){const o="number"==typeof i?i:0;if(null==e)return null;let s,r;return t&&"function"==typeof t.transformPosition?[s,r]=[e.index,e.index+e.length].map((e=>t.transformPosition(e,n!==Emitter.sources.USER))):[s,r]=[e.index,e.index+e.length].map((e=>e<t||e===t&&n===Emitter.sources.USER?e:o>=0?e+o:Math.max(t,e+o))),new Range(s,r-s)}class Container extends ContainerBlot$1{}function isLine(e){return e instanceof Block||e instanceof BlockEmbed}function isUpdatable(e){return"function"==typeof e.updateContent}class Scroll extends ScrollBlot$1{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Block;static allowedChildren=[Block,BlockEmbed,Container];constructor(e,t,i){let{emitter:n}=i;super(e,t),this.emitter=n,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",(e=>this.handleDragStart(e)))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Emitter.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Emitter.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(Emitter.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[i,n]=this.line(e),[o]=this.line(e+t);if(super.deleteAt(e,t),null!=o&&i!==o&&n>0){if(i instanceof BlockEmbed||o instanceof BlockEmbed)return void this.optimize();const e=o.children.head instanceof Break?null:o.children.head;i.moveChildren(o,e),i.remove()}this.optimize()}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,i,n){super.formatAt(e,t,i,n),this.optimize()}insertAt(e,t,i){if(e>=this.length())if(null==i||null==this.scroll.query(t,Scope.BLOCK)){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e),null==i&&t.endsWith("\n")?e.insertAt(0,t.slice(0,-1),i):e.insertAt(0,t,i)}else{const e=this.scroll.create(t,i);this.appendChild(e)}else super.insertAt(e,t,i);this.optimize()}insertBefore(e,t){if(e.statics.scope===Scope.INLINE_BLOT){const i=this.scroll.create(this.statics.defaultChild.blotName);i.appendChild(e),super.insertBefore(i,t)}else super.insertBefore(e,t)}insertContents(e,t){const i=this.deltaToRenderBlocks(t.concat((new Delta).insert("\n"))),n=i.pop();if(null==n)return;this.batchStart();const o=i.shift();if(o){const t="block"===o.type&&(0===o.delta.length()||!this.descendant(BlockEmbed,e)[0]&&e<this.length()),i="block"===o.type?o.delta:(new Delta).insert({[o.key]:o.value});insertInlineContents(this,e,i);const n="block"===o.type?1:0,s=e+i.length()+n;t&&this.insertAt(s-1,"\n");const r=bubbleFormats(this.line(e)[0]),a=Delta.AttributeMap.diff(r,o.attributes)||{};Object.keys(a).forEach((e=>{this.formatAt(s-1,1,e,a[e])})),e=s}let[s,r]=this.children.find(e);if(i.length&&(s&&(s=s.split(r),r=0),i.forEach((e=>{if("block"===e.type){insertInlineContents(this.createBlock(e.attributes,s||void 0),0,e.delta)}else{const t=this.create(e.key,e.value);this.insertBefore(t,s||void 0),Object.keys(e.attributes).forEach((i=>{t.format(i,e.attributes[i])}))}}))),"block"===n.type&&n.delta.length()){insertInlineContents(this,s?s.offset(s.scroll)+r:this.length(),n.delta)}this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[i,n]=t;return i instanceof LeafBlot$1?[i,n]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(isLine,e)}lines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const i=(e,t,n)=>{let o=[],s=n;return e.children.forEachAt(t,n,((e,t,n)=>{isLine(e)?o.push(e):e instanceof ContainerBlot$1&&(o=o.concat(i(e,t,s))),s-=n})),o};return i(this,e,t)}optimize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch)return void(Array.isArray(e)&&(this.batch=this.batch.concat(e)));let t=Emitter.sources.USER;"string"==typeof e&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),(e=e.filter((e=>{let{target:t}=e;const i=this.find(t,!0);return i&&!isUpdatable(i)}))).length>0&&this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Emitter.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,i){const[n]=this.descendant((e=>e instanceof BlockEmbed),e);n&&n.statics.blotName===t&&isUpdatable(n)&&n.updateContent(i)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let i=new Delta;return e.forEach((e=>{const n=e?.insert;if(n)if("string"==typeof n){const o=n.split("\n");o.slice(0,-1).forEach((n=>{i.insert(n,e.attributes),t.push({type:"block",delta:i,attributes:e.attributes??{}}),i=new Delta}));const s=o[o.length-1];s&&i.insert(s,e.attributes)}else{const o=Object.keys(n)[0];if(!o)return;this.query(o,Scope.INLINE)?i.push(e):(i.length()&&t.push({type:"block",delta:i,attributes:{}}),i=new Delta,t.push({type:"blockEmbed",key:o,value:n[o],attributes:e.attributes??{}}))}})),i.length()&&t.push({type:"block",delta:i,attributes:{}}),t}createBlock(e,t){let i;const n={};Object.entries(e).forEach((e=>{let[t,o]=e;null!=this.query(t,Scope.BLOCK&Scope.BLOT)?i=t:n[t]=o}));const o=this.create(i||this.statics.defaultChild.blotName,i?e[i]:void 0);this.insertBefore(o,t||void 0);const s=o.length();return Object.entries(n).forEach((e=>{let[t,i]=e;o.formatAt(0,s,t,i)})),o}}function insertInlineContents(e,t,i){i.reduce(((t,i)=>{const n=Delta.Op.length(i);let o=i.attributes||{};if(null!=i.insert)if("string"==typeof i.insert){const n=i.insert;e.insertAt(t,n);const[s]=e.descendant(LeafBlot$1,t),r=bubbleFormats(s);o=Delta.AttributeMap.diff(r,o)||{}}else if("object"==typeof i.insert){const n=Object.keys(i.insert)[0];if(null==n)return t;e.insertAt(t,n,i.insert[n]);if(null!=e.scroll.query(n,Scope.INLINE)){const[i]=e.descendant(LeafBlot$1,t),n=bubbleFormats(i);o=Delta.AttributeMap.diff(n,o)||{}}}return Object.keys(o).forEach((i=>{e.formatAt(t,n,i,o[i])})),t+n}),t)}const config={scope:Scope.BLOCK,whitelist:["right","center","justify"]},AlignAttribute=new Attributor("align","align",config),AlignClass=new ClassAttributor$1("align","ql-align",config),AlignStyle=new StyleAttributor$1("align","text-align",config);class ColorAttributor extends StyleAttributor$1{value(e){let t=super.value(e);if(!t.startsWith("rgb("))return t;t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");return`#${t.split(",").map((e=>`00${parseInt(e,10).toString(16)}`.slice(-2))).join("")}`}}const ColorClass=new ClassAttributor$1("color","ql-color",{scope:Scope.INLINE}),ColorStyle=new ColorAttributor("color","color",{scope:Scope.INLINE}),BackgroundClass=new ClassAttributor$1("background","ql-bg",{scope:Scope.INLINE}),BackgroundStyle=new ColorAttributor("background","background-color",{scope:Scope.INLINE});class CodeBlockContainer extends Container{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map((e=>e.length()<=1?"":e.domNode.innerText)).join("\n").slice(e,e+t)}html(e,t){return`<pre>\n${escapeText(this.code(e,t))}\n</pre>`}}class CodeBlock extends Block{static TAB="  ";static register(){Quill.register(CodeBlockContainer)}}class Code extends Inline{}Code.blotName="code",Code.tagName="CODE",CodeBlock.blotName="code-block",CodeBlock.className="ql-code-block",CodeBlock.tagName="DIV",CodeBlockContainer.blotName="code-block-container",CodeBlockContainer.className="ql-code-block-container",CodeBlockContainer.tagName="DIV",CodeBlockContainer.allowedChildren=[CodeBlock],CodeBlock.allowedChildren=[Text$1,Break,Cursor],CodeBlock.requiredContainer=CodeBlockContainer;const config$1={scope:Scope.BLOCK,whitelist:["rtl"]},DirectionAttribute=new Attributor("direction","dir",config$1),DirectionClass=new ClassAttributor$1("direction","ql-direction",config$1),DirectionStyle=new StyleAttributor$1("direction","direction",config$1),config$2={scope:Scope.INLINE,whitelist:["serif","monospace"]},FontClass=new ClassAttributor$1("font","ql-font",config$2);class FontStyleAttributor extends StyleAttributor$1{value(e){return super.value(e).replace(/["']/g,"")}}const FontStyle=new FontStyleAttributor("font","font-family",config$2),SizeClass=new ClassAttributor$1("size","ql-size",{scope:Scope.INLINE,whitelist:["small","large","huge"]}),SizeStyle=new StyleAttributor$1("size","font-size",{scope:Scope.INLINE,whitelist:["10px","18px","32px"]}),debug$4=namespace("quill:keyboard"),SHORTKEY=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Keyboard extends Module{static match(e,t){return!["altKey","ctrlKey","metaKey","shiftKey"].some((i=>!!t[i]!==e[i]&&null!==t[i]))&&(t.key===e.key||t.key===e.which)}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach((e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])})),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=normalize(e);if(null==n)return void debug$4.warn("Attempted to add invalid keyboard binding",n);"function"==typeof t&&(t={handler:t}),"function"==typeof i&&(i={handler:i});(Array.isArray(n.key)?n.key:[n.key]).forEach((e=>{const o={...n,key:e,...t,...i};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)}))}listen(){this.quill.root.addEventListener("keydown",(e=>{if(e.defaultPrevented||e.isComposing)return;if(229===e.keyCode&&("Enter"===e.key||"Backspace"===e.key))return;const t=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter((t=>Keyboard.match(e,t)));if(0===t.length)return;const i=Quill.find(e.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const n=this.quill.getSelection();if(null==n||!this.quill.hasFocus())return;const[o,s]=this.quill.getLine(n.index),[r,a]=this.quill.getLeaf(n.index),[l,c]=0===n.length?[r,a]:this.quill.getLeaf(n.index+n.length),u=r instanceof TextBlot$1?r.value().slice(0,a):"",d=l instanceof TextBlot$1?l.value().slice(c):"",p={collapsed:0===n.length,empty:0===n.length&&o.length()<=1,format:this.quill.getFormat(n),line:o,offset:s,prefix:u,suffix:d,event:e};t.some((e=>{if(null!=e.collapsed&&e.collapsed!==p.collapsed)return!1;if(null!=e.empty&&e.empty!==p.empty)return!1;if(null!=e.offset&&e.offset!==p.offset)return!1;if(Array.isArray(e.format)){if(e.format.every((e=>null==p.format[e])))return!1}else if("object"==typeof e.format&&!Object.keys(e.format).every((t=>!0===e.format[t]?null!=p.format[t]:!1===e.format[t]?null==p.format[t]:isEqual(e.format[t],p.format[t]))))return!1;return!(null!=e.prefix&&!e.prefix.test(p.prefix))&&(!(null!=e.suffix&&!e.suffix.test(p.suffix))&&!0!==e.handler.call(this,n,p,e))}))&&e.preventDefault()}))}handleBackspace(e,t){const i=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(0===e.index||this.quill.getLength()<=1)return;let n={};const[o]=this.quill.getLine(e.index);let s=(new Delta).retain(e.index-i).delete(i);if(0===t.offset){const[t]=this.quill.getLine(e.index-1);if(t){if(!("block"===t.statics.blotName&&t.length()<=1)){const t=o.formats(),i=this.quill.getFormat(e.index-1,1);if(n=Delta.AttributeMap.diff(t,i)||{},Object.keys(n).length>0){const t=(new Delta).retain(e.index+o.length()-2).retain(1,n);s=s.compose(t)}}}}this.quill.updateContents(s,Quill.sources.USER),this.quill.focus()}handleDelete(e,t){const i=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-i)return;let n={};const[o]=this.quill.getLine(e.index);let s=(new Delta).retain(e.index).delete(i);if(t.offset>=o.length()-1){const[t]=this.quill.getLine(e.index+1);if(t){const i=o.formats(),r=this.quill.getFormat(e.index,1);n=Delta.AttributeMap.diff(i,r)||{},Object.keys(n).length>0&&(s=s.retain(t.length()-1).retain(1,n))}}this.quill.updateContents(s,Quill.sources.USER),this.quill.focus()}handleDeleteRange(e){deleteRange({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const i=Object.keys(t.format).reduce(((e,i)=>(this.quill.scroll.query(i,Scope.BLOCK)&&!Array.isArray(t.format[i])&&(e[i]=t.format[i]),e)),{}),n=(new Delta).retain(e.index).delete(e.length).insert("\n",i);this.quill.updateContents(n,Quill.sources.USER),this.quill.setSelection(e.index+1,Quill.sources.SILENT),this.quill.focus()}}const defaultOptions={bindings:{bold:makeFormatHandler("bold"),italic:makeFormatHandler("italic"),underline:makeFormatHandler("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","+1",Quill.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","-1",Quill.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(e,t){null!=t.format.indent?this.quill.format("indent","-1",Quill.sources.USER):null!=t.format.list&&this.quill.format("list",!1,Quill.sources.USER)}},"indent code-block":makeCodeBlockHandler(!0),"outdent code-block":makeCodeBlockHandler(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,Quill.sources.USER)}},tab:{key:"Tab",handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();const i=(new Delta).retain(e.index).delete(e.length).insert("\t");return this.quill.updateContents(i,Quill.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,Quill.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,Quill.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(e,t){const i={list:!1};t.format.indent&&(i.indent=!1),this.quill.formatLine(e.index,e.length,i,Quill.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(e){const[t,i]=this.quill.getLine(e.index),n={...t.formats(),list:"checked"},o=(new Delta).retain(e.index).insert("\n",n).retain(t.length()-i-1).retain(1,{list:"unchecked"});this.quill.updateContents(o,Quill.sources.USER),this.quill.setSelection(e.index+1,Quill.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(e,t){const[i,n]=this.quill.getLine(e.index),o=(new Delta).retain(e.index).insert("\n",t.format).retain(i.length()-n-1).retain(1,{header:null});this.quill.updateContents(o,Quill.sources.USER),this.quill.setSelection(e.index+1,Quill.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(e){const t=this.quill.getModule("table");if(t){const[i,n,o,s]=t.getTable(e),r=tableSide(i,n,o,s);if(null==r)return;let a=i.offset();if(r<0){const t=(new Delta).retain(a).insert("\n");this.quill.updateContents(t,Quill.sources.USER),this.quill.setSelection(e.index+1,e.length,Quill.sources.SILENT)}else if(r>0){a+=i.length();const e=(new Delta).retain(a).insert("\n");this.quill.updateContents(e,Quill.sources.USER),this.quill.setSelection(a,Quill.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(e,t){const{event:i,line:n}=t,o=n.offset(this.quill.scroll);i.shiftKey?this.quill.setSelection(o-1,Quill.sources.USER):this.quill.setSelection(o+n.length(),Quill.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(null==this.quill.scroll.query("list"))return!0;const{length:i}=t.prefix,[n,o]=this.quill.getLine(e.index);if(o>i)return!0;let s;switch(t.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(e.index," ",Quill.sources.USER),this.quill.history.cutoff();const r=(new Delta).retain(e.index-o).delete(i+1).retain(n.length()-2-o).retain(1,{list:s});return this.quill.updateContents(r,Quill.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-i,Quill.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(e){const[t,i]=this.quill.getLine(e.index);let n=2,o=t;for(;null!=o&&o.length()<=1&&o.formats()["code-block"];)if(o=o.prev,n-=1,n<=0){const n=(new Delta).retain(e.index+t.length()-i-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(n,Quill.sources.USER),this.quill.setSelection(e.index-1,Quill.sources.SILENT),!1}return!0}},"embed left":makeEmbedArrowHandler("ArrowLeft",!1),"embed left shift":makeEmbedArrowHandler("ArrowLeft",!0),"embed right":makeEmbedArrowHandler("ArrowRight",!1),"embed right shift":makeEmbedArrowHandler("ArrowRight",!0),"table down":makeTableArrowHandler(!1),"table up":makeTableArrowHandler(!0)}};function makeCodeBlockHandler(e){return{key:"Tab",shiftKey:!e,format:{"code-block":!0},handler(t,i){let{event:n}=i;const o=this.quill.scroll.query("code-block"),{TAB:s}=o;if(0===t.length&&!n.shiftKey)return this.quill.insertText(t.index,s,Quill.sources.USER),void this.quill.setSelection(t.index+s.length,Quill.sources.SILENT);const r=0===t.length?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:a,length:l}=t;r.forEach(((t,i)=>{e?(t.insertAt(0,s),0===i?a+=s.length:l+=s.length):t.domNode.textContent.startsWith(s)&&(t.deleteAt(0,s.length),0===i?a-=s.length:l-=s.length)})),this.quill.update(Quill.sources.USER),this.quill.setSelection(a,l,Quill.sources.SILENT)}}}function makeEmbedArrowHandler(e,t){const i="ArrowLeft"===e?"prefix":"suffix";return{key:e,shiftKey:t,altKey:null,[i]:/^$/,handler(i){let{index:n}=i;"ArrowRight"===e&&(n+=i.length+1);const[o]=this.quill.getLeaf(n);return!(o instanceof EmbedBlot$1)||("ArrowLeft"===e?t?this.quill.setSelection(i.index-1,i.length+1,Quill.sources.USER):this.quill.setSelection(i.index-1,Quill.sources.USER):t?this.quill.setSelection(i.index,i.length+1,Quill.sources.USER):this.quill.setSelection(i.index+i.length+1,Quill.sources.USER),!1)}}}function makeFormatHandler(e){return{key:e[0],shortKey:!0,handler(t,i){this.quill.format(e,!i.format[e],Quill.sources.USER)}}}function makeTableArrowHandler(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,i){const n=e?"prev":"next",o=i.line,s=o.parent[n];if(null!=s){if("table-row"===s.statics.blotName){let e=s.children.head,t=o;for(;null!=t.prev;)t=t.prev,e=e.next;const n=e.offset(this.quill.scroll)+Math.min(i.offset,e.length()-1);this.quill.setSelection(n,0,Quill.sources.USER)}}else{const t=o.table()[n];null!=t&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,Quill.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,Quill.sources.USER))}return!1}}}function normalize(e){if("string"==typeof e||"number"==typeof e)e={key:e};else{if("object"!=typeof e)return null;e=cloneDeep(e)}return e.shortKey&&(e[SHORTKEY]=e.shortKey,delete e.shortKey),e}function deleteRange(e){let{quill:t,range:i}=e;const n=t.getLines(i);let o={};if(n.length>1){const e=n[0].formats(),t=n[n.length-1].formats();o=Delta.AttributeMap.diff(t,e)||{}}t.deleteText(i,Quill.sources.USER),Object.keys(o).length>0&&t.formatLine(i.index,1,o,Quill.sources.USER),t.setSelection(i.index,Quill.sources.SILENT)}function tableSide(e,t,i,n){return null==t.prev&&null==t.next?null==i.prev&&null==i.next?0===n?-1:1:null==i.prev?-1:1:null==t.prev?-1:null==t.next?1:null}Keyboard.DEFAULTS=defaultOptions;const normalWeightRegexp=/font-weight:\s*normal/,blockTagNames=["P","OL","UL"],isBlockElement=e=>e&&blockTagNames.includes(e.tagName),normalizeEmptyLines=e=>{Array.from(e.querySelectorAll("br")).filter((e=>isBlockElement(e.previousElementSibling)&&isBlockElement(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))},normalizeFontWeight=e=>{Array.from(e.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(normalWeightRegexp))).forEach((t=>{const i=e.createDocumentFragment();i.append(...t.childNodes),t.parentNode?.replaceChild(i,t)}))};function normalize$1(e){e.querySelector('[id^="docs-internal-guid-"]')&&(normalizeFontWeight(e),normalizeEmptyLines(e))}const ignoreRegexp=/\bmso-list:[^;]*ignore/i,idRegexp=/\bmso-list:[^;]*\bl(\d+)/i,indentRegexp=/\bmso-list:[^;]*\blevel(\d+)/i,parseListItem=(e,t)=>{const i=e.getAttribute("style"),n=i?.match(idRegexp);if(!n)return null;const o=Number(n[1]),s=i?.match(indentRegexp),r=s?Number(s[1]):1,a=new RegExp(`@list l${o}:level${r}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=t.match(a);return{id:o,indent:r,type:l&&"bullet"===l[1]?"bullet":"ordered",element:e}},normalizeListItem=e=>{const t=Array.from(e.querySelectorAll("[style*=mso-list]")),i=[],n=[];t.forEach((e=>{(e.getAttribute("style")||"").match(ignoreRegexp)?i.push(e):n.push(e)})),i.forEach((e=>e.parentNode?.removeChild(e)));const o=e.documentElement.innerHTML,s=n.map((e=>parseListItem(e,o))).filter((e=>e));for(;s.length;){const e=[];let t=s.shift();for(;t;)e.push(t),t=s.length&&s[0]?.element===t.element.nextElementSibling&&s[0].id===t.id?s.shift():null;const i=document.createElement("ul");e.forEach((e=>{const t=document.createElement("li");t.setAttribute("data-list",e.type),e.indent>1&&t.setAttribute("class","ql-indent-"+(e.indent-1)),t.innerHTML=e.element.innerHTML,i.appendChild(t)}));const n=e[0]?.element,{parentNode:o}=n??{};n&&o?.replaceChild(i,n),e.slice(1).forEach((e=>{let{element:t}=e;o?.removeChild(t)}))}};function normalize$2(e){"urn:schemas-microsoft-com:office:word"===e.documentElement.getAttribute("xmlns:w")&&normalizeListItem(e)}const NORMALIZERS=[normalize$2,normalize$1],normalizeExternalHTML=e=>{e.documentElement&&NORMALIZERS.forEach((t=>{t(e)}))},debug$5=namespace("quill:clipboard"),CLIPBOARD_CONFIG=[[Node.TEXT_NODE,matchText],[Node.TEXT_NODE,matchNewline],["br",matchBreak],[Node.ELEMENT_NODE,matchNewline],[Node.ELEMENT_NODE,matchBlot],[Node.ELEMENT_NODE,matchAttributor],[Node.ELEMENT_NODE,matchStyles],["li",matchIndent],["ol, ul",matchList],["pre",matchCodeBlock],["tr",matchTable],["b",createMatchAlias("bold")],["i",createMatchAlias("italic")],["strike",createMatchAlias("strike")],["style",matchIgnore]],ATTRIBUTE_ATTRIBUTORS=[AlignAttribute,DirectionAttribute].reduce(((e,t)=>(e[t.keyName]=t,e)),{}),STYLE_ATTRIBUTORS=[AlignStyle,BackgroundStyle,ColorStyle,DirectionStyle,FontStyle,SizeStyle].reduce(((e,t)=>(e[t.keyName]=t,e)),{});class Clipboard extends Module{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",(e=>this.onCaptureCopy(e,!1))),this.quill.root.addEventListener("cut",(e=>this.onCaptureCopy(e,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],CLIPBOARD_CONFIG.concat(this.options.matchers??[]).forEach((e=>{let[t,i]=e;this.addMatcher(t,i)}))}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:i}=e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n[CodeBlock.blotName])return(new Delta).insert(i||"",{[CodeBlock.blotName]:n[CodeBlock.blotName]});if(!t)return(new Delta).insert(i||"",n);const o=this.convertHTML(t);return deltaEndsWith(o,"\n")&&(null==o.ops[o.ops.length-1].attributes||n.table)?o.compose((new Delta).retain(o.length()-1).delete(1)):o}normalizeHTML(e){normalizeExternalHTML(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const i=t.body,n=new WeakMap,[o,s]=this.prepareMatching(i,n);return traverse(this.quill.scroll,i,o,s,n)}dangerouslyPasteHTML(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Quill.sources.API;if("string"==typeof e){const i=this.convert({html:e,text:""});this.quill.setContents(i,t),this.quill.setSelection(0,Quill.sources.SILENT)}else{const n=this.convert({html:t,text:""});this.quill.updateContents((new Delta).retain(e).concat(n),i),this.quill.setSelection(e+n.length(),Quill.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.defaultPrevented)return;e.preventDefault();const[i]=this.quill.selection.getRange();if(null==i)return;const{html:n,text:o}=this.onCopy(i,t);e.clipboardData?.setData("text/plain",o),e.clipboardData?.setData("text/html",n),t&&deleteRange({range:i,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter((e=>"#"!==e[0])).join("\n")}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(null==t)return;const i=e.clipboardData?.getData("text/html");let n=e.clipboardData?.getData("text/plain");if(!i&&!n){const t=e.clipboardData?.getData("text/uri-list");t&&(n=this.normalizeURIList(t))}const o=Array.from(e.clipboardData?.files||[]);if(!i&&o.length>0)this.quill.uploader.upload(t,o);else{if(i&&o.length>0){const e=(new DOMParser).parseFromString(i,"text/html");if(1===e.body.childElementCount&&"IMG"===e.body.firstElementChild?.tagName)return void this.quill.uploader.upload(t,o)}this.onPaste(t,{html:i,text:n})}}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:i,html:n}=t;const o=this.quill.getFormat(e.index),s=this.convert({text:i,html:n},o);debug$5.log("onPaste",s,{text:i,html:n});const r=(new Delta).retain(e.index).delete(e.length).concat(s);this.quill.updateContents(r,Quill.sources.USER),this.quill.setSelection(r.length()-e.length,Quill.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const i=[],n=[];return this.matchers.forEach((o=>{const[s,r]=o;switch(s){case Node.TEXT_NODE:n.push(r);break;case Node.ELEMENT_NODE:i.push(r);break;default:Array.from(e.querySelectorAll(s)).forEach((e=>{if(t.has(e)){const i=t.get(e);i?.push(r)}else t.set(e,[r])}))}})),[i,n]}}function applyFormat(e,t,i,n){return n.query(t)?e.reduce(((e,n)=>{if(!n.insert)return e;if(n.attributes&&n.attributes[t])return e.push(n);const o=i?{[t]:i}:{};return e.insert(n.insert,{...o,...n.attributes})}),new Delta):e}function deltaEndsWith(e,t){let i="";for(let n=e.ops.length-1;n>=0&&i.length<t.length;--n){const t=e.ops[n];if("string"!=typeof t.insert)break;i=t.insert+i}return i.slice(-1*t.length)===t}function isLine$1(e,t){if(!(e instanceof Element))return!1;const i=t.query(e);return!(i&&i.prototype instanceof EmbedBlot$1)&&["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(e.tagName.toLowerCase())}function isBetweenInlineElements(e,t){return e.previousElementSibling&&e.nextElementSibling&&!isLine$1(e.previousElementSibling,t)&&!isLine$1(e.nextElementSibling,t)}const preNodes=new WeakMap;function isPre(e){return null!=e&&(preNodes.has(e)||("PRE"===e.tagName?preNodes.set(e,!0):preNodes.set(e,isPre(e.parentNode))),preNodes.get(e))}function traverse(e,t,i,n,o){return t.nodeType===t.TEXT_NODE?n.reduce(((i,n)=>n(t,i,e)),new Delta):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce(((s,r)=>{let a=traverse(e,r,i,n,o);return r.nodeType===t.ELEMENT_NODE&&(a=i.reduce(((t,i)=>i(r,t,e)),a),a=(o.get(r)||[]).reduce(((t,i)=>i(r,t,e)),a)),s.concat(a)}),new Delta):new Delta}function createMatchAlias(e){return(t,i,n)=>applyFormat(i,e,!0,n)}function matchAttributor(e,t,i){const n=Attributor.keys(e),o=ClassAttributor$1.keys(e),s=StyleAttributor$1.keys(e),r={};return n.concat(o).concat(s).forEach((t=>{let n=i.query(t,Scope.ATTRIBUTE);null!=n&&(r[n.attrName]=n.value(e),r[n.attrName])||(n=ATTRIBUTE_ATTRIBUTORS[t],null==n||n.attrName!==t&&n.keyName!==t||(r[n.attrName]=n.value(e)||void 0),n=STYLE_ATTRIBUTORS[t],null==n||n.attrName!==t&&n.keyName!==t||(n=STYLE_ATTRIBUTORS[t],r[n.attrName]=n.value(e)||void 0))})),Object.entries(r).reduce(((e,t)=>{let[n,o]=t;return applyFormat(e,n,o,i)}),t)}function matchBlot(e,t,i){const n=i.query(e);if(null==n)return t;if(n.prototype instanceof EmbedBlot$1){const t={},o=n.value(e);if(null!=o)return t[n.blotName]=o,(new Delta).insert(t,n.formats(e,i))}else if(n.prototype instanceof BlockBlot$1&&!deltaEndsWith(t,"\n")&&t.insert("\n"),"blotName"in n&&"formats"in n&&"function"==typeof n.formats)return applyFormat(t,n.blotName,n.formats(e,i),i);return t}function matchBreak(e,t){return deltaEndsWith(t,"\n")||t.insert("\n"),t}function matchCodeBlock(e,t,i){const n=i.query("code-block");return applyFormat(t,"code-block",!n||!("formats"in n)||"function"!=typeof n.formats||n.formats(e,i),i)}function matchIgnore(){return new Delta}function matchIndent(e,t,i){const n=i.query(e);if(null==n||"list"!==n.blotName||!deltaEndsWith(t,"\n"))return t;let o=-1,s=e.parentNode;for(;null!=s;)["OL","UL"].includes(s.tagName)&&(o+=1),s=s.parentNode;return o<=0?t:t.reduce(((e,t)=>t.insert?t.attributes&&"number"==typeof t.attributes.indent?e.push(t):e.insert(t.insert,{indent:o,...t.attributes||{}}):e),new Delta)}function matchList(e,t,i){const n=e;let o="OL"===n.tagName?"ordered":"bullet";const s=n.getAttribute("data-checked");return s&&(o="true"===s?"checked":"unchecked"),applyFormat(t,"list",o,i)}function matchNewline(e,t,i){if(!deltaEndsWith(t,"\n")){if(isLine$1(e,i)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert("\n");if(t.length()>0&&e.nextSibling){let n=e.nextSibling;for(;null!=n;){if(isLine$1(n,i))return t.insert("\n");const e=i.query(n);if(e&&e.prototype instanceof BlockEmbed)return t.insert("\n");n=n.firstChild}}}return t}function matchStyles(e,t,i){const n={},o=e.style||{};return"italic"===o.fontStyle&&(n.italic=!0),"underline"===o.textDecoration&&(n.underline=!0),"line-through"===o.textDecoration&&(n.strike=!0),(o.fontWeight?.startsWith("bold")||parseInt(o.fontWeight,10)>=700)&&(n.bold=!0),t=Object.entries(n).reduce(((e,t)=>{let[n,o]=t;return applyFormat(e,n,o,i)}),t),parseFloat(o.textIndent||0)>0?(new Delta).insert("\t").concat(t):t}function matchTable(e,t,i){const n="TABLE"===e.parentElement?.tagName?e.parentElement:e.parentElement?.parentElement;if(null!=n){return applyFormat(t,"table",Array.from(n.querySelectorAll("tr")).indexOf(e)+1,i)}return t}function matchText(e,t,i){let n=e.data;if("O:P"===e.parentElement?.tagName)return t.insert(n.trim());if(!isPre(e)){if(0===n.trim().length&&n.includes("\n")&&!isBetweenInlineElements(e,i))return t;n=n.replace(/[^\S\u00a0]/g," "),n=n.replace(/ {2,}/g," "),(null==e.previousSibling&&null!=e.parentElement&&isLine$1(e.parentElement,i)||e.previousSibling instanceof Element&&isLine$1(e.previousSibling,i))&&(n=n.replace(/^ /,"")),(null==e.nextSibling&&null!=e.parentElement&&isLine$1(e.parentElement,i)||e.nextSibling instanceof Element&&isLine$1(e.nextSibling,i))&&(n=n.replace(/ $/,"")),n=n.replaceAll(" "," ")}return t.insert(n)}class History extends Module{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(Quill.events.EDITOR_CHANGE,((e,t,i,n)=>{e===Quill.events.SELECTION_CHANGE?t&&n!==Quill.sources.SILENT&&(this.currentRange=t):e===Quill.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&n!==Quill.sources.USER?this.transform(t):this.record(t,i)),this.currentRange=transformRange(this.currentRange,t))})),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",(e=>{"historyUndo"===e.inputType?(this.undo(),e.preventDefault()):"historyRedo"===e.inputType&&(this.redo(),e.preventDefault())}))}change(e,t){if(0===this.stack[e].length)return;const i=this.stack[e].pop();if(!i)return;const n=this.quill.getContents(),o=i.delta.invert(n);this.stack[t].push({delta:o,range:transformRange(i.range,o)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(i.delta,Quill.sources.USER),this.ignoreChange=!1,this.restoreSelection(i)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(0===e.ops.length)return;this.stack.redo=[];let i=e.invert(t),n=this.currentRange;const o=Date.now();if(this.lastRecorded+this.options.delay>o&&this.stack.undo.length>0){const e=this.stack.undo.pop();e&&(i=i.compose(e.delta),n=e.range)}else this.lastRecorded=o;0!==i.length()&&(this.stack.undo.push({delta:i,range:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){transformStack(this.stack.undo,e),transformStack(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,Quill.sources.USER);else{const t=getLastChangeIndex(this.quill.scroll,e.delta);this.quill.setSelection(t,Quill.sources.USER)}}}function transformStack(e,t){let i=t;for(let t=e.length-1;t>=0;t-=1){const n=e[t];e[t]={delta:i.transform(n.delta,!0),range:n.range&&transformRange(n.range,i)},i=n.delta.transform(i),0===e[t].delta.length()&&e.splice(t,1)}}function endsWithNewlineChange(e,t){const i=t.ops[t.ops.length-1];return null!=i&&(null!=i.insert?"string"==typeof i.insert&&i.insert.endsWith("\n"):null!=i.attributes&&Object.keys(i.attributes).some((t=>null!=e.query(t,Scope.BLOCK))))}function getLastChangeIndex(e,t){const i=t.reduce(((e,t)=>e+(t.delete||0)),0);let n=t.length()-i;return endsWithNewlineChange(e,t)&&(n-=1),n}function transformRange(e,t){if(!e)return e;const i=t.transformPosition(e.index);return{index:i,length:t.transformPosition(e.index+e.length)-i}}class Uploader extends Module{constructor(e,t){super(e,t),e.root.addEventListener("drop",(t=>{t.preventDefault();let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){const e=document.caretPositionFromPoint(t.clientX,t.clientY);i=document.createRange(),i.setStart(e.offsetNode,e.offset),i.setEnd(e.offsetNode,e.offset)}const n=i&&e.selection.normalizeNative(i);if(n){const i=e.selection.normalizedToRange(n);t.dataTransfer?.files&&this.upload(i,t.dataTransfer.files)}}))}upload(e,t){const i=[];Array.from(t).forEach((e=>{e&&this.options.mimetypes?.includes(e.type)&&i.push(e)})),i.length>0&&this.options.handler.call(this,e,i)}}Uploader.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(e,t){if(!this.quill.scroll.query("image"))return;const i=t.map((e=>new Promise((t=>{const i=new FileReader;i.onload=()=>{t(i.result)},i.readAsDataURL(e)}))));Promise.all(i).then((t=>{const i=t.reduce(((e,t)=>e.insert({image:t})),(new Delta).retain(e.index).delete(e.length));this.quill.updateContents(i,Emitter.sources.USER),this.quill.setSelection(e.index+t.length,Emitter.sources.SILENT)}))}};const INSERT_TYPES=["insertText","insertReplacementText"];class Input extends Module{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(e=>{this.handleBeforeInput(e)})),/Android/i.test(navigator.userAgent)||e.on(Quill.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){deleteRange({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===e.length)return!1;if(t){const i=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new Delta).retain(e.index).insert(t,i),Quill.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,Quill.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!INSERT_TYPES.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||!0===t.collapsed)return;const i=getPlainTextFromInputEvent(e);if(null==i)return;const n=this.quill.selection.normalizeNative(t),o=n?this.quill.selection.normalizedToRange(n):null;o&&this.replaceText(o,i)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function getPlainTextFromInputEvent(e){return"string"==typeof e.data?e.data:e.dataTransfer?.types.includes("text/plain")?e.dataTransfer.getData("text/plain"):null}const isMac=/Mac/i.test(navigator.platform),TTL_FOR_VALID_SELECTION_CHANGE=100,canMoveCaretBeforeUINode=e=>"ArrowLeft"===e.key||"ArrowRight"===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key||"Home"===e.key||!(!isMac||"a"!==e.key||!0!==e.ctrlKey);class UINode extends Module{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:i,event:n}=t;if(!(i instanceof ParentBlot$1&&i.uiNode))return!0;const o="rtl"===getComputedStyle(i.domNode).direction;return!!(o&&"ArrowRight"!==n.key||!o&&"ArrowLeft"!==n.key)||(this.quill.setSelection(e.index-1,e.length+(n.shiftKey?1:0),Quill.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&canMoveCaretBeforeUINode(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+100,this.isListening)return;this.isListening=!0;document.addEventListener("selectionchange",(()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()}),{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(!0!==t.collapsed||0!==t.startOffset)return;const i=this.quill.scroll.find(t.startContainer);if(!(i instanceof ParentBlot$1&&i.uiNode))return;const n=document.createRange();n.setStartAfter(i.uiNode),n.setEndAfter(i.uiNode),e.removeAllRanges(),e.addRange(n)}}Quill.register({"blots/block":Block,"blots/block/embed":BlockEmbed,"blots/break":Break,"blots/container":Container,"blots/cursor":Cursor,"blots/embed":Embed,"blots/inline":Inline,"blots/scroll":Scroll,"blots/text":Text$1,"modules/clipboard":Clipboard,"modules/history":History,"modules/keyboard":Keyboard,"modules/uploader":Uploader,"modules/input":Input,"modules/uiNode":UINode});class IndentAttributor extends ClassAttributor$1{add(e,t){let i=0;if("+1"===t||"-1"===t){const n=this.value(e)||0;i="+1"===t?n+1:n-1}else"number"==typeof t&&(i=t);return 0===i?(this.remove(e),!0):super.add(e,i.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const IndentClass=new IndentAttributor("indent","ql-indent",{scope:Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Blockquote extends Block{static blotName="blockquote";static tagName="blockquote"}class Header extends Block{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class ListContainer extends Container{}ListContainer.blotName="list-container",ListContainer.tagName="OL";class ListItem extends Block{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){Quill.register(ListContainer)}constructor(e,t){super(e,t);const i=t.ownerDocument.createElement("span"),n=i=>{if(!e.isEnabled())return;const n=this.statics.formats(t,e);"checked"===n?(this.format("list","unchecked"),i.preventDefault()):"unchecked"===n&&(this.format("list","checked"),i.preventDefault())};i.addEventListener("mousedown",n),i.addEventListener("touchstart",n),this.attachUI(i)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}ListItem.blotName="list",ListItem.tagName="LI",ListContainer.allowedChildren=[ListItem],ListItem.requiredContainer=ListContainer;class Bold extends Inline{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}class Italic extends Bold{static blotName="italic";static tagName=["EM","I"]}class Link extends Inline{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return sanitize(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("href",this.constructor.sanitize(t)):super.format(e,t)}}function sanitize(e,t){const i=document.createElement("a");i.href=e;const n=i.href.slice(0,i.href.indexOf(":"));return t.indexOf(n)>-1}class Script extends Inline{static blotName="script";static tagName=["SUB","SUP"];static create(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):super.create(e)}static formats(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}}class Strike extends Bold{static blotName="strike";static tagName=["S","STRIKE"]}class Underline extends Inline{static blotName="underline";static tagName="U"}class Formula extends Embed{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return"string"==typeof e&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}const ATTRIBUTES=["alt","height","width"];class Image extends EmbedBlot$1{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return ATTRIBUTES.reduce(((t,i)=>(e.hasAttribute(i)&&(t[i]=e.getAttribute(i)),t)),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return sanitize(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){ATTRIBUTES.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}const ATTRIBUTES$1=["height","width"];class Video extends BlockEmbed{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return ATTRIBUTES$1.reduce(((t,i)=>(e.hasAttribute(i)&&(t[i]=e.getAttribute(i)),t)),{})}static sanitize(e){return Link.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){ATTRIBUTES$1.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}const TokenAttributor=new ClassAttributor$1("code-token","hljs",{scope:Scope.INLINE});class CodeToken extends Inline{static formats(e,t){for(;null!=e&&e!==t.domNode;){if(e.classList&&e.classList.contains(CodeBlock.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,i){super(e,t,i),TokenAttributor.add(this.domNode,i)}format(e,t){e!==CodeToken.blotName?super.format(e,t):t?TokenAttributor.add(this.domNode,t):(TokenAttributor.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),TokenAttributor.value(this.domNode)||this.unwrap()}}CodeToken.blotName="code-token",CodeToken.className="ql-token";class SyntaxCodeBlock extends CodeBlock{static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),CodeToken.blotName,!1),super.replaceWith(e,t)}}class SyntaxCodeBlockContainer extends CodeBlockContainer{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===SyntaxCodeBlock.blotName&&(this.forceNext=!0,this.children.forEach((i=>{i.format(e,t)})))}formatAt(e,t,i,n){i===SyntaxCodeBlock.blotName&&(this.forceNext=!0),super.formatAt(e,t,i,n)}highlight(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const i=`${Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).map((e=>e.textContent)).join("\n")}\n`,n=SyntaxCodeBlock.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==i){if(i.trim().length>0||null==this.cachedText){const t=this.children.reduce(((e,t)=>e.concat(blockDelta(t,!1))),new Delta),o=e(i,n);t.diff(o).reduce(((e,t)=>{let{retain:i,attributes:n}=t;return i?(n&&Object.keys(n).forEach((t=>{[SyntaxCodeBlock.blotName,CodeToken.blotName].includes(t)&&this.formatAt(e,i,t,n[t])})),e+i):e}),0)}this.cachedText=i,this.forceNext=!1}}html(e,t){const[i]=this.children.find(e);return`<pre data-language="${i?SyntaxCodeBlock.formats(i.domNode):"plain"}">\n${escapeText(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const e=SyntaxCodeBlock.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}SyntaxCodeBlockContainer.allowedChildren=[SyntaxCodeBlock],SyntaxCodeBlock.requiredContainer=SyntaxCodeBlockContainer,SyntaxCodeBlock.allowedChildren=[CodeToken,Cursor,Text$1,Break];const highlight=(e,t,i)=>{if("string"==typeof e.versionString){const n=e.versionString.split(".")[0];if(parseInt(n,10)>=11)return e.highlight(i,{language:t}).value}return e.highlight(t,i).value};class Syntax extends Module{static register(){Quill.register(CodeToken,!0),Quill.register(SyntaxCodeBlock,!0),Quill.register(SyntaxCodeBlockContainer,!0)}constructor(e,t){if(super(e,t),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((e,t)=>{let{key:i}=t;return e[i]=!0,e}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(Quill.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof SyntaxCodeBlockContainer))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((e=>{let{key:i,label:n}=e;const o=t.ownerDocument.createElement("option");o.textContent=n,o.setAttribute("value",i),t.appendChild(o)})),t.addEventListener("change",(()=>{e.format(SyntaxCodeBlock.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),null==e.uiNode&&(e.attachUI(t),e.children.head&&(t.value=SyntaxCodeBlock.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(Quill.events.SCROLL_OPTIMIZE,(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.highlight(),e=null}),this.options.interval)}))}highlight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(Quill.sources.USER);const i=this.quill.getSelection();(null==e?this.quill.scroll.descendants(SyntaxCodeBlockContainer):[e]).forEach((e=>{e.highlight(this.highlightBlot,t)})),this.quill.update(Quill.sources.SILENT),null!=i&&this.quill.setSelection(i,Quill.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(t=this.languages[t]?t:"plain","plain"===t)return escapeText(e).split("\n").reduce(((e,i,n)=>(0!==n&&e.insert("\n",{[CodeBlock.blotName]:t}),e.insert(i))),new Delta);const i=this.quill.root.ownerDocument.createElement("div");return i.classList.add(CodeBlock.className),i.innerHTML=highlight(this.options.hljs,t,e),traverse(this.quill.scroll,i,[(e,t)=>{const i=TokenAttributor.value(e);return i?t.compose((new Delta).retain(t.length(),{[CodeToken.blotName]:i})):t}],[(e,i)=>e.data.split("\n").reduce(((e,i,n)=>(0!==n&&e.insert("\n",{[CodeBlock.blotName]:t}),e.insert(i))),i)],new WeakMap)}}Syntax.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class TableCell extends Block{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",tableId()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===TableCell.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class TableRow extends Container{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),i=this.next.children.head.formats(),n=this.next.children.tail.formats();return e.table===t.table&&e.table===i.table&&e.table===n.table}return!1}optimize(e){super.optimize(e),this.children.forEach((e=>{if(null==e.next)return;const t=e.formats(),i=e.next.formats();if(t.table!==i.table){const t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}}))}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class TableBody extends Container{static blotName="table-body";static tagName="TBODY"}class TableContainer extends Container{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(TableRow),t=e.reduce(((e,t)=>Math.max(t.children.length,e)),0);e.forEach((e=>{new Array(t-e.children.length).fill(0).forEach((()=>{let t;null!=e.children.head&&(t=TableCell.formats(e.children.head.domNode));const i=this.scroll.create(TableCell.blotName,t);e.appendChild(i),i.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(TableBody);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const i=t.children.at(e);null!=i&&i.remove()}))}insertColumn(e){const[t]=this.descendant(TableBody);null!=t&&null!=t.children.head&&t.children.forEach((t=>{const i=t.children.at(e),n=TableCell.formats(t.children.head.domNode),o=this.scroll.create(TableCell.blotName,n);t.insertBefore(o,i)}))}insertRow(e){const[t]=this.descendant(TableBody);if(null==t||null==t.children.head)return;const i=tableId(),n=this.scroll.create(TableRow.blotName);t.children.head.children.forEach((()=>{const e=this.scroll.create(TableCell.blotName,i);n.appendChild(e)}));const o=t.children.at(e);t.insertBefore(n,o)}rows(){const e=this.children.head;return null==e?[]:e.children.map((e=>e))}}function tableId(){return`row-${Math.random().toString(36).slice(2,6)}`}TableContainer.allowedChildren=[TableBody],TableBody.requiredContainer=TableContainer,TableBody.allowedChildren=[TableRow],TableRow.requiredContainer=TableBody,TableRow.allowedChildren=[TableCell],TableCell.requiredContainer=TableRow;class Table extends Module{static register(){Quill.register(TableCell),Quill.register(TableRow),Quill.register(TableBody),Quill.register(TableContainer)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(TableContainer).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();null!=t&&(e.deleteColumn(t.cellOffset()),this.quill.update(Quill.sources.USER))}deleteRow(){const[,e]=this.getTable();null!=e&&(e.remove(),this.quill.update(Quill.sources.USER))}deleteTable(){const[e]=this.getTable();if(null==e)return;const t=e.offset();e.remove(),this.quill.update(Quill.sources.USER),this.quill.setSelection(t,Quill.sources.SILENT)}getTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==e)return[null,null,null,-1];const[t,i]=this.quill.getLine(e.index);if(null==t||t.statics.blotName!==TableCell.blotName)return[null,null,null,-1];const n=t.parent;return[n.parent.parent,n,t,i]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[i,n,o]=this.getTable(t);if(null==o)return;const s=o.cellOffset();i.insertColumn(s+e),this.quill.update(Quill.sources.USER);let r=n.rowOffset();0===e&&(r+=1),this.quill.setSelection(t.index+r,t.length,Quill.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[i,n,o]=this.getTable(t);if(null==o)return;const s=n.rowOffset();i.insertRow(s+e),this.quill.update(Quill.sources.USER),e>0?this.quill.setSelection(t,Quill.sources.SILENT):this.quill.setSelection(t.index+n.children.length,t.length,Quill.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const i=this.quill.getSelection();if(null==i)return;const n=new Array(e).fill(0).reduce((e=>{const i=new Array(t).fill("\n").join("");return e.insert(i,{table:tableId()})}),(new Delta).retain(i.index));this.quill.updateContents(n,Quill.sources.USER),this.quill.setSelection(i.index,Quill.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Quill.events.SCROLL_OPTIMIZE,(e=>{e.some((e=>!!["TD","TR","TBODY","TABLE"].includes(e.target.tagName)&&(this.quill.once(Quill.events.TEXT_CHANGE,((e,t,i)=>{i===Quill.sources.USER&&this.balanceTables()})),!0)))}))}}const debug$6=namespace("quill:toolbar");class Toolbar extends Module{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const t=document.createElement("div");t.setAttribute("role","toolbar"),addControls(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((e=>{const t=this.options.handlers?.[e];t&&this.addHandler(e,t)})),Array.from(this.container.querySelectorAll("button, select")).forEach((e=>{this.attach(e)})),this.quill.on(Quill.events.EDITOR_CHANGE,(()=>{const[e]=this.quill.selection.getRange();this.update(e)}))):debug$6.error("Container required for toolbar",this.options)}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find((e=>0===e.indexOf("ql-")));if(!t)return;if(t=t.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[t]&&null==this.quill.scroll.query(t))return void debug$6.warn("ignoring attaching to nonexistent format",t,e);const i="SELECT"===e.tagName?"change":"click";e.addEventListener(i,(i=>{let n;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;const t=e.options[e.selectedIndex];n=!t.hasAttribute("selected")&&(t.value||!1)}else n=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),i.preventDefault();this.quill.focus();const[o]=this.quill.selection.getRange();if(null!=this.handlers[t])this.handlers[t].call(this,n);else if(this.quill.scroll.query(t).prototype instanceof EmbedBlot$1){if(n=prompt(`Enter ${t}`),!n)return;this.quill.updateContents((new Delta).retain(o.index).delete(o.length).insert({[t]:n}),Quill.sources.USER)}else this.quill.format(t,n,Quill.sources.USER);this.update(o)})),this.controls.push([t,e])}update(e){const t=null==e?{}:this.quill.getFormat(e);this.controls.forEach((i=>{const[n,o]=i;if("SELECT"===o.tagName){let i=null;if(null==e)i=null;else if(null==t[n])i=o.querySelector("option[selected]");else if(!Array.isArray(t[n])){let e=t[n];"string"==typeof e&&(e=e.replace(/"/g,'\\"')),i=o.querySelector(`option[value="${e}"]`)}null==i?(o.value="",o.selectedIndex=-1):i.selected=!0}else if(null==e)o.classList.remove("ql-active"),o.setAttribute("aria-pressed","false");else if(o.hasAttribute("value")){const e=t[n],i=e===o.getAttribute("value")||null!=e&&e.toString()===o.getAttribute("value")||null==e&&!o.getAttribute("value");o.classList.toggle("ql-active",i),o.setAttribute("aria-pressed",i.toString())}else{const e=null!=t[n];o.classList.toggle("ql-active",e),o.setAttribute("aria-pressed",e.toString())}}))}}function addButton(e,t,i){const n=document.createElement("button");n.setAttribute("type","button"),n.classList.add(`ql-${t}`),n.setAttribute("aria-pressed","false"),null!=i?(n.value=i,n.setAttribute("aria-label",`${t}: ${i}`)):n.setAttribute("aria-label",t),e.appendChild(n)}function addControls(e,t){Array.isArray(t[0])||(t=[t]),t.forEach((t=>{const i=document.createElement("span");i.classList.add("ql-formats"),t.forEach((e=>{if("string"==typeof e)addButton(i,e);else{const t=Object.keys(e)[0],n=e[t];Array.isArray(n)?addSelect(i,t,n):addButton(i,t,n)}})),e.appendChild(i)}))}function addSelect(e,t,i){const n=document.createElement("select");n.classList.add(`ql-${t}`),i.forEach((e=>{const t=document.createElement("option");!1!==e?t.setAttribute("value",String(e)):t.setAttribute("selected","selected"),n.appendChild(t)})),e.appendChild(n)}Toolbar.DEFAULTS={},Toolbar.DEFAULTS={container:null,handlers:{clean(){const e=this.quill.getSelection();if(null!=e)if(0===e.length){const e=this.quill.getFormat();Object.keys(e).forEach((e=>{null!=this.quill.scroll.query(e,Scope.INLINE)&&this.quill.format(e,!1,Quill.sources.USER)}))}else this.quill.removeFormat(e.index,e.length,Quill.sources.USER)},direction(e){const{align:t}=this.quill.getFormat();"rtl"===e&&null==t?this.quill.format("align","right",Quill.sources.USER):e||"right"!==t||this.quill.format("align",!1,Quill.sources.USER),this.quill.format("direction",e,Quill.sources.USER)},indent(e){const t=this.quill.getSelection(),i=this.quill.getFormat(t),n=parseInt(i.indent||0,10);if("+1"===e||"-1"===e){let t="+1"===e?1:-1;"rtl"===i.direction&&(t*=-1),this.quill.format("indent",n+t,Quill.sources.USER)}},link(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,Quill.sources.USER)},list(e){const t=this.quill.getSelection(),i=this.quill.getFormat(t);"check"===e?"checked"===i.list||"unchecked"===i.list?this.quill.format("list",!1,Quill.sources.USER):this.quill.format("list","unchecked",Quill.sources.USER):this.quill.format("list",e,Quill.sources.USER)}}};const alignLeftIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',alignCenterIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',alignRightIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',alignJustifyIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',backgroundIcon='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',blockquoteIcon='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',boldIcon='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',cleanIcon='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',codeIcon='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',colorIcon='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',directionLeftToRightIcon='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',directionRightToLeftIcon='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',formulaIcon='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',headerIcon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',header2Icon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',header3Icon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',header4Icon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',header5Icon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',header6Icon='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',italicIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',imageIcon='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',indentIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',outdentIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',linkIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',listBulletIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',listCheckIcon='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',listOrderedIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',subscriptIcon='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',superscriptIcon='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',strikeIcon='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',tableIcon='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',underlineIcon='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',videoIcon='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>';var Icons={align:{"":alignLeftIcon,center:alignCenterIcon,right:alignRightIcon,justify:alignJustifyIcon},background:backgroundIcon,blockquote:blockquoteIcon,bold:boldIcon,clean:cleanIcon,code:codeIcon,"code-block":codeIcon,color:colorIcon,direction:{"":directionLeftToRightIcon,rtl:directionRightToLeftIcon},formula:formulaIcon,header:{1:headerIcon,2:header2Icon,3:header3Icon,4:header4Icon,5:header5Icon,6:header6Icon},italic:italicIcon,image:imageIcon,indent:{"+1":indentIcon,"-1":outdentIcon},link:linkIcon,list:{bullet:listBulletIcon,check:listCheckIcon,ordered:listOrderedIcon},script:{sub:subscriptIcon,super:superscriptIcon},strike:strikeIcon,table:tableIcon,underline:underlineIcon,video:videoIcon};const DropdownIcon='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let optionsCounter=0;function toggleAriaAttribute(e,t){e.setAttribute(t,`${!("true"===e.getAttribute(t))}`)}class Picker{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",(()=>{this.togglePicker()})),this.label.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault()}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),toggleAriaAttribute(this.label,"aria-expanded"),toggleAriaAttribute(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const i=e.getAttribute("value");return i&&t.setAttribute("data-value",i),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",(()=>{this.selectItem(t,!0)})),t.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this.selectItem(t,!0),e.preventDefault();break;case"Escape":this.escape(),e.preventDefault()}})),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=DropdownIcon,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${optionsCounter}`,optionsCounter+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach((t=>{const i=this.buildItem(t);e.appendChild(i),!0===t.selected&&this.selectItem(i)})),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach((e=>{this.container.setAttribute(e.name,e.value)})),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout((()=>this.label.focus()),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.container.querySelector(".ql-selected");e!==i&&(null!=i&&i.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);const t=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class ColorPicker extends Picker{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((e=>{e.classList.add("ql-primary")}))}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const i=this.label.querySelector(".ql-color-label"),n=e&&e.getAttribute("data-value")||"";i&&("line"===i.tagName?i.style.stroke=n:i.style.fill=n)}}class IconPicker extends Picker{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((e=>{e.innerHTML=t[e.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const i=e||this.defaultItem;if(null!=i){if(this.label.innerHTML===i.innerHTML)return;this.label.innerHTML=i.innerHTML}}}const isScrollable=e=>{const{overflowY:t}=getComputedStyle(e,null);return"visible"!==t&&"clip"!==t};class Tooltip{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,isScrollable(this.quill.root)&&this.quill.root.addEventListener("scroll",(()=>{this.root.style.marginTop=-1*this.quill.root.scrollTop+"px"})),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,i=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${i}px`,this.root.classList.remove("ql-flip");const n=this.boundsContainer.getBoundingClientRect(),o=this.root.getBoundingClientRect();let s=0;if(o.right>n.right&&(s=n.right-o.right,this.root.style.left=`${t+s}px`),o.left<n.left&&(s=n.left-o.left,this.root.style.left=`${t+s}px`),o.bottom>n.bottom){const t=o.bottom-o.top,n=e.bottom-e.top+t;this.root.style.top=i-n+"px",this.root.classList.add("ql-flip")}return s}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const ALIGNS=[!1,"center","right","justify"],COLORS=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],FONTS=[!1,"serif","monospace"],HEADERS=["1","2","3",!1],SIZES=["small",!1,"large","huge"];class BaseTheme extends Theme{constructor(e,t){super(e,t);const i=t=>{document.body.contains(e.root)?(null==this.tooltip||this.tooltip.root.contains(t.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach((e=>{e.container.contains(t.target)||e.close()}))):document.body.removeEventListener("click",i)};e.emitter.listenDOM("click",document.body,i)}addModule(e){const t=super.addModule(e);return"toolbar"===e&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach((e=>{(e.getAttribute("class")||"").split(/\s+/).forEach((i=>{if(i.startsWith("ql-")&&(i=i.slice(3),null!=t[i]))if("direction"===i)e.innerHTML=t[i][""]+t[i].rtl;else if("string"==typeof t[i])e.innerHTML=t[i];else{const n=e.value||"";null!=n&&t[i][n]&&(e.innerHTML=t[i][n])}}))}))}buildPickers(e,t){this.pickers=Array.from(e).map((e=>{if(e.classList.contains("ql-align")&&(null==e.querySelector("option")&&fillSelect(e,ALIGNS),"object"==typeof t.align))return new IconPicker(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){const i=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&fillSelect(e,COLORS,"background"===i?"#ffffff":"#000000"),new ColorPicker(e,t[i])}return null==e.querySelector("option")&&(e.classList.contains("ql-font")?fillSelect(e,FONTS):e.classList.contains("ql-header")?fillSelect(e,HEADERS):e.classList.contains("ql-size")&&fillSelect(e,SIZES)),new Picker(e)}));this.quill.on(Emitter.events.EDITOR_CHANGE,(()=>{this.pickers.forEach((e=>{e.update()}))}))}}BaseTheme.DEFAULTS=merge({},Theme.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");null==e&&(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",(()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""})),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class BaseTooltip extends Tooltip{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(e=>{"Enter"===e.key?(this.save(),e.preventDefault()):"Escape"===e.key&&(this.cancel(),e.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const i=this.quill.getBounds(this.quill.selection.savedRange);null!=i&&this.position(i),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Emitter.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Emitter.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=extractVideoUrl(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(null!=t){const i=t.index+t.length;this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),e,Emitter.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(i+1," ",Emitter.sources.USER),this.quill.setSelection(i+2,Emitter.sources.USER)}break}}this.textbox.value="",this.hide()}}function extractVideoUrl(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:e}function fillSelect(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach((t=>{const n=document.createElement("option");t===i?n.setAttribute("selected","selected"):n.setAttribute("value",String(t)),e.appendChild(n)}))}const TOOLBAR_CONFIG=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class BubbleTooltip extends BaseTooltip{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(e,t){super(e,t),this.quill.on(Emitter.events.EDITOR_CHANGE,((e,t,i,n)=>{if(e===Emitter.events.SELECTION_CHANGE)if(null!=t&&t.length>0&&n===Emitter.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const e=this.quill.getLines(t.index,t.length);if(1===e.length){const e=this.quill.getBounds(t);null!=e&&this.position(e)}else{const i=e[e.length-1],n=this.quill.getIndex(i),o=Math.min(i.length()-1,t.index+t.length-n),s=this.quill.getBounds(new Range(n,o));null!=s&&this.position(s)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()}))}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")})),this.quill.on(Emitter.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(null!=e){const t=this.quill.getBounds(e);null!=t&&this.position(t)}}),1)}))}cancel(){this.show()}position(e){const t=super.position(e),i=this.root.querySelector(".ql-tooltip-arrow");return i.style.marginLeft="",0!==t&&(i.style.marginLeft=-1*t-i.offsetWidth/2+"px"),t}}class BubbleTheme extends BaseTheme{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=TOOLBAR_CONFIG),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new BubbleTooltip(this.quill,this.options.bounds),null!=e.container&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Icons),this.buildPickers(e.container.querySelectorAll("select"),Icons))}}BubbleTheme.DEFAULTS=merge({},BaseTheme.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,Quill.sources.USER)}}}}});const TOOLBAR_CONFIG$1=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class SnowTooltip extends BaseTooltip{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",(e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(e=>{if(null!=this.linkRange){const e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,Emitter.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(Emitter.events.SELECTION_CHANGE,((e,t,i)=>{if(null!=e){if(0===e.length&&i===Emitter.sources.USER){const[t,i]=this.quill.scroll.descendant(Link,e.index);if(null!=t){this.linkRange=new Range(e.index-i,t.length());const n=Link.formats(t.domNode);this.preview.textContent=n,this.preview.setAttribute("href",n),this.show();const o=this.quill.getBounds(this.linkRange);return void(null!=o&&this.position(o))}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class SnowTheme extends BaseTheme{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=TOOLBAR_CONFIG$1),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){null!=e.container&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Icons),this.buildPickers(e.container.querySelectorAll("select"),Icons),this.tooltip=new SnowTooltip(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((t,i)=>{e.handlers.link.call(e,!i.format.link)})))}}SnowTheme.DEFAULTS=merge({},BaseTheme.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){const e=this.quill.getSelection();if(null==e||0===e.length)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&0!==t.indexOf("mailto:")&&(t=`mailto:${t}`);const{tooltip:i}=this.quill.theme;i.edit("link",t)}else this.quill.format("link",!1,Quill.sources.USER)}}}}}),Quill.register({"attributors/attribute/direction":DirectionAttribute,"attributors/class/align":AlignClass,"attributors/class/background":BackgroundClass,"attributors/class/color":ColorClass,"attributors/class/direction":DirectionClass,"attributors/class/font":FontClass,"attributors/class/size":SizeClass,"attributors/style/align":AlignStyle,"attributors/style/background":BackgroundStyle,"attributors/style/color":ColorStyle,"attributors/style/direction":DirectionStyle,"attributors/style/font":FontStyle,"attributors/style/size":SizeStyle},!0),Quill.register({"formats/align":AlignClass,"formats/direction":DirectionClass,"formats/indent":IndentClass,"formats/background":BackgroundStyle,"formats/color":ColorStyle,"formats/font":FontClass,"formats/size":SizeClass,"formats/blockquote":Blockquote,"formats/code-block":CodeBlock,"formats/header":Header,"formats/list":ListItem,"formats/bold":Bold,"formats/code":Code,"formats/italic":Italic,"formats/link":Link,"formats/script":Script,"formats/strike":Strike,"formats/underline":Underline,"formats/formula":Formula,"formats/image":Image,"formats/video":Video,"modules/syntax":Syntax,"modules/table":Table,"modules/toolbar":Toolbar,"themes/bubble":BubbleTheme,"themes/snow":SnowTheme,"ui/icons":Icons,"ui/picker":Picker,"ui/icon-picker":IconPicker,"ui/color-picker":ColorPicker,"ui/tooltip":Tooltip},!0);const Embed$1=Quill.import("blots/embed");class PresetReplyBlot extends Embed$1{static blotName="preset-reply";static tagName="span";static className="ql-preset-reply-tag";static create(e){const t=super.create(e);t.setAttribute("data-value",e),t.setAttribute("contenteditable","false");const i=document.createElement("span");i.classList.add("ql-preset-reply-text"),i.textContent=e;const n=document.createElement("span");return n.classList.add("ql-preset-reply-delete"),t.appendChild(i),t.appendChild(n),t}constructor(e,t){super(e,t);const i=t.querySelector(".ql-preset-reply-delete");i&&i.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation();const i=Quill.find(t);if(i){const e=Quill.find(i.scroll.domNode.parentNode);if(e){const t=e.getIndex(i);e.deleteText(t,1,"user")}}}))}static value(e){return e.getAttribute("data-value")}}const EventBus=new Vue;class Constants{RICH_TEXT_IMAGE_COUNT_LIMIT=20}const consts=new Constants;Quill.register(PresetReplyBlot);var script$a=Vue.extend({name:"QuillEditor",inject:{showVideoScreenShotButton:{default:!1},$rootComponent:{default:{}}},mixins:[LocaleMixin],props:{value:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},maxlength:{type:Number,default:5e3}},mounted(){this.initQuill(),EventBus.$on("screen-shot-urls",this.handleScreenShotUrl),this.componentId=this.generateRandomId()},computed:{imageCount(){if(this.value){let e=/<img\s[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/g,t=this.value.match(e);return t?t.length:0}return 0}},methods:{handleScreenShotUrl(e){if(this.componentId===e.messageId){if(this.screenShotTimeoutId&&(clearTimeout(this.screenShotTimeoutId),this.screenShotTimeoutId=null),this.setScreenShotButtonEnabled(!0),this.isScreenShotting=!1,this.imageCount>consts.RICH_TEXT_IMAGE_COUNT_LIMIT)return void this.$Message.error(this.getLocaleValue("survey_creator.common.tips.upload_image_exceed_the_limit"));for(let t of e.urls)this.insertImageUrl(t)}},insertImageEmbed(e){let t=this.quill.getSelection();t||(t={index:this.quill.getLength(),length:0}),this.quill.insertEmbed(t,"image",e,"user"),this.$nextTick((()=>{this.quill.update("user")}))},insertImageUrl(e){if(e){let t=this.quill.getSelection();t||(t={index:this.quill.getLength(),length:0});const i=`<img src="${e}" alt="image load fail">`;this.quill.clipboard.dangerouslyPasteHTML(t.index,i),this.quill.setSelection(t.index+1)}},changeVideoScreenShotButtonName(){const e=this.quill.getModule("toolbar").container.querySelectorAll("button.ql-video-screen-shot");if(e.length>0){let t=e[0];t.style.visibility="hidden",t.innerHTML=this.getLocaleValue("survey_creator.common.tips.get_screen_shot_name"),t.style.padding="2px",t.style.fontSize="12px",t.style.color="rgb(105, 140, 208)",t.style.border="1px solid rgb(105, 140, 208)",t.style.borderRadius="4px",t.style.width="auto",t.style.display="flex",t.style.alignItems="center",this.$nextTick((()=>{t.style.visibility="visible"}))}},getScreenShotButton(){const e=this.quill.getModule("toolbar").container.querySelectorAll("button.ql-video-screen-shot");return e.length>0?e[0]:null},setScreenShotButtonEnabled(e){const t=this.getScreenShotButton();t?e?(t.disabled=!1,t.style.opacity="1",t.style.cursor="pointer",t.innerHTML=this.getLocaleValue("survey_creator.common.tips.get_screen_shot_name")):(t.disabled=!0,t.style.opacity="0.6",t.style.cursor="not-allowed",t.innerHTML=this.getLocaleValue("survey_creator.common.tips.get_screen_shot_name")+"..."):console.log("⚠️ [QuillEditor-Creator] Screenshot button not found")},initQuill(){let e=[["bold","italic","underline","strike",{list:"ordered"},{list:"bullet"},{color:[]},{background:[]},{align:[]},"clean"]];this.showVideoScreenShotButton&&e.push([{"video-screen-shot":"video-screen-shot"}]),this.quill=new Quill(this.$refs.editor,{theme:"snow",placeholder:this.disabled?"":this.placeholder,readOnly:this.disabled,modules:{toolbar:!this.disabled&&{container:e,handlers:{"video-screen-shot":this.customVideoScreenShot}}}}),this.quill.root.innerHTML=this.value,this.quill.on("text-change",this.handleTextChange),this.quill.root.addEventListener("paste",this.handlePaste,!0),this.quill.root.addEventListener("compositionstart",(()=>{this.quill.root.classList.remove("ql-blank")})),this.disabled&&this.setReadOnlyBackgroundColor(),this.showVideoScreenShotButton&&!this.disabled&&this.$nextTick((()=>{this.changeVideoScreenShotButtonName()}))},handleTextChange(){let e=this.quill.getText();e.length>this.maxlength&&(this.$Message.error(this.getLocaleValue("survey_creator.common.tips.max_length_hint")),this.quill.deleteText(this.maxlength,e.trim().length)),e=this.quill.getText();let t=this.quill.root.innerHTML;"<p><br></p>"===t.trim()&&(this.quill.root.innerHTML="",t=""),this.$emit("input",t)},handlePaste(e){let t=e.clipboardData||window.clipboardData;if(t&&(t.items||t.files)){let i=t.items||t.files;const n=/^image\/(jpe?g|gif|png|svg|webp)$/i;for(let t=0;t<i.length;t++)if(n.test(i[t].type)){let n=i[t].getAsFile?i[t].getAsFile():i[t];n&&(this.quill.focus(),this.range=this.quill.getSelection(),e.preventDefault(),setTimeout((()=>{this.quill.focus(),this.range=this.quill.getSelection(),this.uploadAndInsertImage(n)}),0))}}},customVideoScreenShot(){if(this.isScreenShotting)return void console.log("⚠️ [QuillEditor-Creator] Already screenshotting, ignoring click");this.isScreenShotting=!0,this.setScreenShotButtonEnabled(!1);const e=setTimeout((()=>{this.isScreenShotting&&(this.isScreenShotting=!1,this.setScreenShotButtonEnabled(!0))}),3e4);this.screenShotTimeoutId=e,EventBus.$emit("get-screen-shot-image",this.componentId)},setReadOnlyBackgroundColor(){this.quill&&this.quill.root&&(this.quill.root.style.backgroundColor="#f5f5f5",this.quill.root.style.color="#ccc")},generateRandomId:()=>"id-"+Math.random().toString(36).slice(2,11)+"-"+Date.now(),getLocaleValue(e){return this.t(e,this.$rootComponent.currentLanguage)},uploadAndInsertImage(e){const t=new FormData;t.append("file",e);let i=this.$serverHttp;i&&i.post("/api/storage/upload/file",t).then((e=>{if(200===e.status&&e.data.data){let t=e.data.data.downloadUrl;this.insertImageUrl(t)}})).catch((e=>{console.log("upload fail",e),this.$Message.error(this.getLocaleValue("survey_creator.common.tips.upload_fail"))}))}},data:()=>({quill:null,componentId:null,isScreenShotting:!1,screenShotTimeoutId:null}),watch:{value(e){e!==this.quill.root.innerHTML&&(this.quill.root.innerHTML=e,this.$nextTick((()=>{this.quill.setSelection(e.length)})))},disabled(e){this.quill&&(this.quill.enable(!e),e?this.setReadOnlyBackgroundColor():this.quill.root&&(this.quill.root.style.backgroundColor=""))}},beforeDestroy(){this.screenShotTimeoutId&&clearTimeout(this.screenShotTimeoutId),EventBus.$off("screen-shot-urls",this.handleScreenShotUrl),this.quill.root.removeEventListener("paste",this.handlePaste)}});const __vue_script__$a=script$a;var __vue_render__$9=function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("div",{ref:"editor"})])},__vue_staticRenderFns__$9=[];const __vue_inject_styles__$a=function(e){e&&(e("data-v-7a72a174_0",{source:"/*!\n * Quill Editor v2.0.3\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked]>.ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked]>.ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:0;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor>*{cursor:text}.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6,.ql-editor ol,.ql-editor p,.ql-editor pre{margin:0;padding:0}@supports (counter-set:none){.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6,.ql-editor p{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6,.ql-editor p{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li>.ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked]>.ql-ui,.ql-editor li[data-list=unchecked]>.ql-ui{color:#777}.ql-editor li[data-list=bullet]>.ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked]>.ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked]>.ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered]>.ql-ui:before{content:counter(list-0,decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1>.ql-ui:before{content:counter(list-1,lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2>.ql-ui:before{content:counter(list-2,lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3>.ql-ui:before{content:counter(list-3,decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4>.ql-ui:before{content:counter(list-4,lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5>.ql-ui:before{content:counter(list-5,lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6>.ql-ui:before{content:counter(list-6,decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7>.ql-ui:before{content:counter(list-7,lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8>.ql-ui:before{content:counter(list-8,lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9>.ql-ui:before{content:counter(list-9,decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl>.ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:0}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-snow .ql-toolbar:after,.ql-snow.ql-toolbar:after{clear:both;content:'';display:table}.ql-snow .ql-toolbar button,.ql-snow.ql-toolbar button{background:0 0;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-snow .ql-toolbar button svg,.ql-snow.ql-toolbar button svg{float:left;height:100%}.ql-snow .ql-toolbar button:active:hover,.ql-snow.ql-toolbar button:active:hover{outline:0}.ql-snow .ql-toolbar input.ql-image[type=file],.ql-snow.ql-toolbar input.ql-image[type=file]{display:none}.ql-snow .ql-toolbar .ql-picker-item.ql-selected,.ql-snow .ql-toolbar .ql-picker-item:hover,.ql-snow .ql-toolbar .ql-picker-label.ql-active,.ql-snow .ql-toolbar .ql-picker-label:hover,.ql-snow .ql-toolbar button.ql-active,.ql-snow .ql-toolbar button:focus,.ql-snow .ql-toolbar button:hover,.ql-snow.ql-toolbar .ql-picker-item.ql-selected,.ql-snow.ql-toolbar .ql-picker-item:hover,.ql-snow.ql-toolbar .ql-picker-label.ql-active,.ql-snow.ql-toolbar .ql-picker-label:hover,.ql-snow.ql-toolbar button.ql-active,.ql-snow.ql-toolbar button:focus,.ql-snow.ql-toolbar button:hover{color:#06c}.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:focus .ql-fill,.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover .ql-fill,.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:focus .ql-fill,.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:hover .ql-fill,.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill{fill:#06c}.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow .ql-toolbar button.ql-active .ql-stroke,.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar button:focus .ql-stroke,.ql-snow .ql-toolbar button:focus .ql-stroke-miter,.ql-snow .ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow.ql-toolbar button.ql-active .ql-stroke,.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar button:focus .ql-stroke,.ql-snow.ql-toolbar button:focus .ql-stroke-miter,.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow.ql-toolbar button:hover .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow .ql-toolbar button:hover:not(.ql-active),.ql-snow.ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow{box-sizing:border-box}.ql-snow *{box-sizing:border-box}.ql-snow .ql-hidden{display:none}.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:'';display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-stroke.ql-thin,.ql-snow .ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor .ql-code-block-container,.ql-snow .ql-editor code{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-snow .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-snow .ql-picker-label::before{display:inline-block;line-height:22px}.ql-snow .ql-picker-options{background-color:#fff;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-snow .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#ccc;z-index:2}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-snow .ql-color-picker,.ql-snow .ql-icon-picker{width:28px}.ql-snow .ql-color-picker .ql-picker-label,.ql-snow .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-label svg,.ql-snow .ql-icon-picker .ql-picker-label svg{right:4px}.ql-snow .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-snow .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-snow .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-snow .ql-picker.ql-header{width:98px}.ql-snow .ql-picker.ql-header .ql-picker-item::before,.ql-snow .ql-picker.ql-header .ql-picker-label::before{content:'Normal'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before{content:'Heading 1'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before{content:'Heading 2'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before{content:'Heading 3'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before{content:'Heading 4'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before{content:'Heading 5'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before{content:'Heading 6'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-snow .ql-picker.ql-font{width:108px}.ql-snow .ql-picker.ql-font .ql-picker-item::before,.ql-snow .ql-picker.ql-font .ql-picker-label::before{content:'Sans Serif'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before{content:'Serif'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before{content:'Monospace'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-snow .ql-picker.ql-size{width:98px}.ql-snow .ql-picker.ql-size .ql-picker-item::before,.ql-snow .ql-picker.ql-size .ql-picker-label::before{content:'Normal'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before{content:'Small'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before{content:'Large'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before{content:'Huge'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-snow .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-snow .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-toolbar.ql-snow{border:1px solid #ccc;box-sizing:border-box;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:8px}.ql-toolbar.ql-snow .ql-formats{margin-right:15px}.ql-toolbar.ql-snow .ql-picker-label{border:1px solid transparent}.ql-toolbar.ql-snow .ql-picker-options{border:1px solid transparent;box-shadow:rgba(0,0,0,.2) 0 2px 8px}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:#ccc}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc}.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover{border-color:#000}.ql-toolbar.ql-snow+.ql-container.ql-snow{border-top:0}.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:\"Visit URL:\";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';margin-left:16px;padding-right:8px}.ql-snow .ql-tooltip a.ql-remove::before{content:'Remove';margin-left:8px}.ql-snow .ql-tooltip a{line-height:26px}.ql-snow .ql-tooltip.ql-editing a.ql-preview,.ql-snow .ql-tooltip.ql-editing a.ql-remove{display:none}.ql-snow .ql-tooltip.ql-editing input[type=text]{display:inline-block}.ql-snow .ql-tooltip.ql-editing a.ql-action::after{border-right:0;content:'Save';padding-right:0}.ql-snow .ql-tooltip[data-mode=link]::before{content:\"Enter link:\"}.ql-snow .ql-tooltip[data-mode=formula]::before{content:\"Enter formula:\"}.ql-snow .ql-tooltip[data-mode=video]::before{content:\"Enter video:\"}.ql-snow a{color:#06c}.ql-container.ql-snow{border:1px solid #ccc}",map:void 0,media:void 0}),e("data-v-7a72a174_1",{source:"/*!\n * Quill Editor v2.0.3\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked]>.ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked]>.ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:0;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor>*{cursor:text}.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6,.ql-editor ol,.ql-editor p,.ql-editor pre{margin:0;padding:0}@supports (counter-set:none){.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6,.ql-editor p{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6,.ql-editor p{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li>.ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked]>.ql-ui,.ql-editor li[data-list=unchecked]>.ql-ui{color:#777}.ql-editor li[data-list=bullet]>.ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked]>.ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked]>.ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered]>.ql-ui:before{content:counter(list-0,decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1>.ql-ui:before{content:counter(list-1,lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2>.ql-ui:before{content:counter(list-2,lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3>.ql-ui:before{content:counter(list-3,decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4>.ql-ui:before{content:counter(list-4,lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5>.ql-ui:before{content:counter(list-5,lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6>.ql-ui:before{content:counter(list-6,decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7>.ql-ui:before{content:counter(list-7,lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8>.ql-ui:before{content:counter(list-8,lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9>.ql-ui:before{content:counter(list-9,decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl>.ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:0}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}",map:void 0,media:void 0}),e("data-v-7a72a174_2",{source:'.ql-preset-reply-tag{display:inline-flex;align-items:center;padding:2px 8px;margin:0 2px;border:1px solid #d9d9d9;border-radius:4px;background:#f7f7f7;font-size:13px;color:#515a6e;line-height:1.6;cursor:default;user-select:none;vertical-align:baseline}.ql-preset-reply-tag .ql-preset-reply-text{margin-right:4px}.ql-preset-reply-tag .ql-preset-reply-delete{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:#999;cursor:pointer;border-radius:50%;transition:all .2s}.ql-preset-reply-tag .ql-preset-reply-delete::after{content:"×"}.ql-preset-reply-tag .ql-preset-reply-delete:hover{color:#fff;background:var(--primary-brand-color,#2d8cf0)}',map:void 0,media:void 0}),e("data-v-7a72a174_3",{source:".ql-snow .ql-editor img[data-v-7a72a174]{max-width:600px;height:auto;width:100%}.ql-editor[data-v-7a72a174]{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:0;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word;max-height:500px}.ql-editor[contenteditable=false][data-v-7a72a174]{background-color:#f5f5f5}",map:void 0,media:void 0}))},__vue_scope_id__$a="data-v-7a72a174",__vue_module_identifier__$a=void 0,__vue_is_functional_template__$a=!1,__vue_component__$a=normalizeComponent({render:__vue_render__$9,staticRenderFns:__vue_staticRenderFns__$9},__vue_inject_styles__$a,__vue_script__$a,"data-v-7a72a174",false,undefined,!1,createInjector,void 0,void 0);var script$b=Vue.extend({name:"short-answer",components:{QuillRichText:__vue_component__$a},mixins:[LocaleMixin],inject:["$rootComponent"],props:{question:{type:Object,required:!0}},data:()=>({enabledPresetReplies:!1}),computed:{showPresetReplies(){return this.enabledPresetReplies&&!this.question.options.readonly&&Array.isArray(this.question.options.presetReplies)&&this.question.options.presetReplies.length>0}},created(){this.enabledPresetReplies=_$1.get(this.$rootComponent,"options.enabledPresetReplies",!1)},methods:{applyPresetReply(e){const t=this.$refs.richText.quill;if(t){let i=t.getSelection();i||(i={index:t.getLength()-1,length:0}),t.insertEmbed(i.index,"preset-reply",e,"user"),t.setSelection(i.index+1)}}}});const __vue_script__$b=script$b;var __vue_render__$a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e.showPresetReplies?i("div",{staticClass:"preset-reply-area"},[i("div",{staticClass:"preset-reply-tip"},[e._v("\n            "+e._s(e.t("survey_creator.question.presetReplyTip",e.$rootComponent.currentLanguage))+"\n        ")]),e._v(" "),i("div",{staticClass:"preset-reply-buttons"},e._l(e.question.options.presetReplies,(function(t,n){return i("span",{key:n,staticClass:"preset-reply-btn",on:{click:function(i){return e.applyPresetReply(t)}}},[e._v(e._s(t))])})),0)]):e._e(),e._v(" "),i("quill-rich-text",{ref:"richText",attrs:{disabled:e.question.options.readonly,placeholder:e.t("survey_creator.common.tips.please_input_answer",e.$rootComponent.currentLanguage),maxlength:e.question.options.wordLimit}})],1)},__vue_staticRenderFns__$a=[];const __vue_inject_styles__$b=function(e){e&&e("data-v-53d4cbd0_0",{source:".preset-reply-area[data-v-53d4cbd0]{margin-bottom:12px}.preset-reply-area .preset-reply-tip[data-v-53d4cbd0]{color:#999;font-size:13px;margin-bottom:8px}.preset-reply-area .preset-reply-buttons[data-v-53d4cbd0]{display:flex;flex-wrap:wrap;gap:8px}.preset-reply-area .preset-reply-buttons .preset-reply-btn[data-v-53d4cbd0]{display:inline-block;padding:4px 12px;border:1px solid #dcdee2;border-radius:4px;font-size:13px;color:#515a6e;cursor:pointer;background:#fff;transition:all .2s}.preset-reply-area .preset-reply-buttons .preset-reply-btn[data-v-53d4cbd0]:hover{border-color:#2d8cf0;color:#2d8cf0}",map:void 0,media:void 0})},__vue_scope_id__$b="data-v-53d4cbd0",__vue_module_identifier__$b=void 0,__vue_is_functional_template__$b=!1,__vue_component__$b=normalizeComponent({render:__vue_render__$a,staticRenderFns:__vue_staticRenderFns__$a},__vue_inject_styles__$b,__vue_script__$b,"data-v-53d4cbd0",false,undefined,!1,createInjector,void 0,void 0);var script$c=Vue.extend({name:"fill-blank",components:{QuillRichText:__vue_component__$a,Row:Row,Col:Col,Radio:Radio,Input:Input$1},inject:["$rootComponent"],mixins:[LocaleMixin],props:{question:{type:Object,required:!0}}});const __vue_script__$c=script$c;var __vue_render__$b=function(){var e=this,t=e.$createElement;return(e._self._c||t)("quill-rich-text",{attrs:{disabled:e.question.options.readonly,placeholder:e.t("survey_creator.common.tips.please_input_answer",e.$rootComponent.currentLanguage),maxlength:e.question.options.wordLimit}})},__vue_staticRenderFns__$b=[];const __vue_inject_styles__$c=void 0,__vue_scope_id__$c=void 0,__vue_module_identifier__$c=void 0,__vue_is_functional_template__$c=!1,__vue_component__$c=normalizeComponent({render:__vue_render__$b,staticRenderFns:__vue_staticRenderFns__$b},undefined,__vue_script__$c,undefined,false,undefined,!1,void 0,void 0,void 0);var script$d={name:"text-title"};const __vue_script__$d=script$d;var __vue_render__$c=function(){var e=this.$createElement;return(this._self._c||e)("div")},__vue_staticRenderFns__$c=[];const __vue_inject_styles__$d=void 0,__vue_scope_id__$d=void 0,__vue_module_identifier__$d=void 0,__vue_is_functional_template__$d=!1,__vue_component__$d=normalizeComponent({render:__vue_render__$c,staticRenderFns:__vue_staticRenderFns__$c},undefined,__vue_script__$d,undefined,false,undefined,!1,void 0,void 0,void 0);var script$e=Vue.extend({name:"matrix",components:{Row:Row,Col:Col,Radio:Radio,RadioGroup:RadioGroup,Divider:Divider},mixins:[LocaleMixin],inject:["$rootComponent"],props:{question:{type:Object,required:!0},maxScore:{type:Boolean,default:!0}},data(){return{choiceClasses:this.buildChoiceClasses()}},watch:{"question.options.layout"(){this.choiceClasses=this.buildChoiceClasses()}},methods:{buildChoiceClasses(){return["question-choice",`question-choice-${_$1.lowerCase(this.question.options.layout||"HORIZONTAL")}`]}},computed:{haveMaxScore(){return _$1.get(this.question,"options.scoringEnabled",!1)},choiceMaxScore(){return _$1.max(_$1.map(this.question.choices,(e=>parseFloat(_$1.get(e,"options.score",0)||0))))}}});const __vue_script__$e=script$e;var __vue_render__$d=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"question"},e._l(e.question.subQuestions,(function(t,n){return i("div",{key:n},[e.isPreview?e._e():i("Divider",{staticClass:"question-type-desc",attrs:{orientation:"left",size:"small"}},[e._v(e._s(e.t("survey_creator.question.sub_questions",e.$rootComponent.currentLanguage)))]),e._v(" "),i("div",{staticClass:"sub-question-title"},[i("span",{staticClass:"number"},[e._v(e._s(e.question.header.number)+"."+e._s(t.number))]),e._v(" "),i("span",{staticClass:"content"},[e._v(e._s(e._f("translate")(t.text,!0)))]),e._v(" "),e.maxScore&&e.choiceMaxScore?i("span",{staticClass:"sub-max-score"},[e._v("("+e._s(e.t("survey_creator.question.max_score",e.$rootComponent.currentLanguage))+e._s(e.choiceMaxScore)+")")]):e._e()]),e._v(" "),i("RadioGroup",[i("Row",{attrs:{type:"flex",justify:"start",gutter:50,align:"middle"}},e._l(e.question.choices,(function(t){return i("Col",{key:t.id,class:e.choiceClasses},[i("Radio",{attrs:{label:t.id}},[i("span",{staticClass:"choice-title"},[e._v(e._s(e._f("translate")(t.text,!0)))]),e._v(" "),e.haveMaxScore?i("span",{staticClass:"choice-score"},[e._v(e._s("("+(t.options.score||0)+" "+e.t("survey_creator.question.scores",e.$rootComponent.currentLanguage)+")"))]):e._e()])],1)})),1)],1)],1)})),0)},__vue_staticRenderFns__$d=[];const __vue_inject_styles__$e=void 0,__vue_scope_id__$e=void 0,__vue_module_identifier__$e=void 0,__vue_is_functional_template__$e=!1,__vue_component__$e=normalizeComponent({render:__vue_render__$d,staticRenderFns:__vue_staticRenderFns__$d},undefined,__vue_script__$e,undefined,false,undefined,!1,void 0,void 0,void 0);var script$f=Vue.extend({name:"star",mixins:[LocaleMixin],props:{item:{type:Object,required:!0}},watch:{item:{handler(e){this.getDesc()},deep:!0}},methods:{getDesc(){let e=this.item.range.max||null,t=this.item.range.min||0;return null==e?this.t("survey_creator.question.evaluation.desc.outOfRange",[t]):e==t?this.t("survey_creator.question.evaluation.desc.atPoint",[t]):this.t("survey_creator.question.evaluation.desc.inRange",[t,e])}}});const __vue_script__$f=script$f;var __vue_render__$e=function(){var e=this,t=e.$createElement;return(e._self._c||t)("p",{staticClass:"desc"},[e._v(e._s(e.getDesc()))])},__vue_staticRenderFns__$e=[];const __vue_inject_styles__$f=void 0,__vue_scope_id__$f=void 0,__vue_module_identifier__$f=void 0,__vue_is_functional_template__$f=!1,__vue_component__$f=normalizeComponent({render:__vue_render__$e,staticRenderFns:__vue_staticRenderFns__$e},undefined,__vue_script__$f,undefined,false,undefined,!1,void 0,void 0,void 0);class ExprEvaluationQuestion{questions;scope;questionMap;constructor(e,t){this.questions=e,this.scope=_$1.sortBy(t),this.questionMap=this.buildQuestionMap()}calculateNumbers(){const e=this.checkedQuestion(),t=new Array;return this.recurs(e,t),t}buildQuestionMap(){const e={};return _$1.forEach(this.questions,(t=>{e[t.id]=t,"MATRIX"==t.type&&_$1.forEach(_$1.get(t,"subQuestions",[]),(t=>{e[t.id]=t}))})),e}checkedQuestion(){const e=new Array;return _$1.forEach(this.questions,(t=>{if("MATRIX"==_$1.get(t,"type")){const i=new Array;_$1.forEach(_$1.get(t,"subQuestions",[]),(e=>{if(_$1.includes(this.scope,e.id)){const n=_$1.cloneDeep(e);_$1.set(n,"type","MATRIX"),_$1.set(n,"parentId",_$1.get(t,"id")),i.push(n)}})),_$1.isEmpty(i)||e.push(i)}else _$1.includes(this.scope,t.id)&&e.push(t)})),e}recurs(e,t){for(let i=0;i<e.length;i++){const n=e[i];if(_$1.isArray(n))t.push(new Array),this.recurs(n,t[t.length-1]);else{const o=new Array;if(o.push(this.getFullNumber(n)),i==e.length-1){t.push(o);continue}for(let n=i+1;;n++){if(n==e.length||!this.isContinuous(e[n-1],e[n])){t.push(o),i=n-1;break}_$1.size(o)>1&&o.pop(),o.push(this.getFullNumber(e[n]))}}}}isContinuous(e,t){return!_$1.isArray(t)&&this.getNumber(t)-this.getNumber(e)==1}getFullNumber(e){return"MATRIX"==e.type?this.questionMap[e.parentId].header.number+"."+this.getNumber(e):this.getNumber(e).toString()}getNumber(e){return"MATRIX"==e.type?e.number:e.header.number}}const SPLIT_LENGTH=60;var script$g=Vue.extend({name:"expr-if",mixins:[LocaleMixin],components:{Tooltip:Tooltip$1},inject:["$rootComponent"],data:()=>({desc:"",descTitle:""}),created(){this.initialDesc()},props:{conditions:{type:Array,required:!0}},computed:{questions(){return _$1.cloneDeep(this.$rootComponent.currentSurvey.questions)}},watch:{conditions:{handler(e){this.initialDesc()},deep:!0}},methods:{getDesc(e){let t=e.payload;if("SCORE"==e.type)return this.t("survey_creator.question.evaluation.condition.score_template",[t.minScore,t.leftOperator,t.rightOperator,t.maxScore]);{let i=new ExprEvaluationQuestion(this.questions,t.scope).calculateNumbers(),n=_$1.join(_$1.map(i,(e=>_$1.isArray(_$1.head(e))?_$1.join(_$1.map(e,(e=>_$1.join(e,"-"))),", "):_$1.join(e,"-"))),", ");return"ASSIGN"==e.type?this.t("survey_creator.question.evaluation.condition.assign_template",[n,_$1.join(t.values,"、"),_$1.unescape(t.operator),t.size]):"AUTO"==e.type?this.t("survey_creator.question.evaluation.condition.auto_template",[n,_$1.join(t.values,"、")]):""}},getChineseLength(e){if(!(e=_$1.trim(e)).length)return 0;let t=e.match(/[\u4e00-\u9fa5]/g);return t?t.length:0},initialDesc(){let e="",t=_$1.map(this.conditions,(e=>this.getDesc(e)));e=_$1.join(t,"<br>"),this.desc=e;let i=e.length,n=this.getChineseLength(e.substring(0,60));i>60&&(this.desc=e.substring(0,60-_$1.ceil(n/2))+"..."),this.descTitle=e}}});const __vue_script__$g=script$g;var __vue_render__$f=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Tooltip",{attrs:{"max-width":"200"}},[i("span",{attrs:{slot:"content"},domProps:{innerHTML:e._s(this.descTitle)},slot:"content"}),e._v(" "),i("span",{staticClass:"desc",domProps:{innerHTML:e._s(this.desc)}})])},__vue_staticRenderFns__$f=[];const __vue_inject_styles__$g=void 0,__vue_scope_id__$g=void 0,__vue_module_identifier__$g=void 0,__vue_is_functional_template__$g=!1,__vue_component__$g=normalizeComponent({render:__vue_render__$f,staticRenderFns:__vue_staticRenderFns__$f},undefined,__vue_script__$g,undefined,false,undefined,!1,void 0,void 0,void 0);var script$h=Vue.extend({name:"expr-else",mixins:[LocaleMixin],props:{conditions:{type:Array}}});const __vue_script__$h=script$h;var __vue_render__$g=function(){var e=this,t=e.$createElement;return(e._self._c||t)("p",{staticClass:"desc",domProps:{innerHTML:e._s(e.t("survey_creator.question.evaluation.condition.other"))}})},__vue_staticRenderFns__$g=[];const __vue_inject_styles__$h=void 0,__vue_scope_id__$h=void 0,__vue_module_identifier__$h=void 0,__vue_is_functional_template__$h=!1,__vue_component__$h=normalizeComponent({render:__vue_render__$g,staticRenderFns:__vue_staticRenderFns__$g},undefined,__vue_script__$h,undefined,false,undefined,!1,void 0,void 0,void 0);var script$i=Vue.extend({name:"expr",props:{item:{type:Object,required:!0}},components:{IF:__vue_component__$g,ELSE:__vue_component__$h}});const __vue_script__$i=script$i;var __vue_render__$h=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.item.type,{tag:"component",attrs:{conditions:e.item.conditions}})},__vue_staticRenderFns__$h=[];const __vue_inject_styles__$i=void 0,__vue_scope_id__$i=void 0,__vue_module_identifier__$i=void 0,__vue_is_functional_template__$i=!1,__vue_component__$i=normalizeComponent({render:__vue_render__$h,staticRenderFns:__vue_staticRenderFns__$h},undefined,__vue_script__$i,undefined,false,undefined,!1,void 0,void 0,void 0);var script$j=Vue.extend({name:"Evaluation",components:{Row:Row,Col:Col,Checkbox:Checkbox,CheckboxGroup:CheckboxGroup,Card:Card,Icon:Icon,Tooltip:Tooltip$1,STAR:__vue_component__$f,EXPR:__vue_component__$i},mixins:[LocaleMixin],props:{question:{type:Object,required:!0}}});const __vue_script__$j=script$j;var __vue_render__$i=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e.question.evaluationItems.length>0?i("Row",{attrs:{type:"flex",justify:"start",gutter:24}},e._l(e.question.evaluationItems,(function(t){return i("Col",{key:t.id,staticClass:"col-padding"},[i("Card",{staticClass:"evaluation-cards-default",attrs:{"dis-hover":""}},[i("div",{staticClass:"card-title",attrs:{slot:"title"},slot:"title"},[i("Icon",{staticClass:"icon",attrs:{type:"ios-checkmark-circle-outline",size:36}})],1),e._v(" "),i("div",{staticClass:"card-content"},[i("Tooltip",{attrs:{"max-width":"200"}},[i("p",{attrs:{slot:"content"},slot:"content"},[e._v(e._s(e._f("translate")(t.text,!0)))]),e._v(" "),i("p",{staticClass:"text"},[e._v(e._s(e._f("translate")(t.text,!0)))])]),e._v(" "),i(e.question.options.evaluationType,{tag:"component",attrs:{item:t}})],1)])],1)})),1):e._e()],1)},__vue_staticRenderFns__$i=[];const __vue_inject_styles__$j=void 0,__vue_scope_id__$j=void 0,__vue_module_identifier__$j=void 0,__vue_is_functional_template__$j=!1,__vue_component__$j=normalizeComponent({render:__vue_render__$i,staticRenderFns:__vue_staticRenderFns__$i},undefined,__vue_script__$j,undefined,false,undefined,!1,void 0,void 0,void 0);var script$k=Vue.extend({name:"matrix",components:{Row:Row,Divider:Divider,Slider:Slider},mixins:[LocaleMixin],inject:["$rootComponent"],props:{question:{type:Object,required:!0},maxScore:{type:Boolean,default:!0}},data:()=>({}),created(){},computed:{showQuestionScoreSlider(){return!(this.question.subQuestions&&this.question.subQuestions.length>0)},sliderStep:function(){return 0==this.question.options.decimalPlaces?1:.1},extremeValueLabelSelected:function(){return this.question.options.extremeValueLabelEnabled}}});const __vue_script__$k=script$k;var __vue_render__$j=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"question"},[i("Row",{directives:[{name:"show",rawName:"v-show",value:e.showQuestionScoreSlider,expression:"showQuestionScoreSlider"}]},[i("div",{staticClass:"slider-container"},[i("Slider",{staticClass:"slider",attrs:{min:e.question.options.minRange,max:e.question.options.maxRange,step:e.sliderStep,"show-input":"","show-tips":"always"}}),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.extremeValueLabelSelected,expression:"extremeValueLabelSelected"}],staticClass:"text-desc"},[i("span",[e._v("\n          "+e._s(e.t("survey_creator.question.scoring.extreme_value_labels."+e.question.options.extremeValueLabel+".minValue"))+"\n        ")]),e._v(" "),i("span",[e._v("\n          "+e._s(e.t("survey_creator.question.scoring.extreme_value_labels."+e.question.options.extremeValueLabel+".maxValue"))+"\n        ")])])],1)]),e._v(" "),e._l(e.question.subQuestions,(function(t,n){return i("div",{key:n},[e.isPreview?e._e():i("Divider",{staticClass:"question-type-desc",attrs:{orientation:"left",size:"small"}},[e._v(e._s(e.t("survey_creator.question.sub_questions",e.$rootComponent.currentLanguage))+"\n    ")]),e._v(" "),i("div",{staticClass:"sub-question-title"},[i("span",{staticClass:"number"},[e._v(e._s(e.question.header.number)+"."+e._s(t.number))]),e._v(" "),i("span",{staticClass:"content"},[e._v(e._s(e._f("translate")(t.text,!0)))]),e._v(" "),i("Row",[i("div",{staticClass:"slider-container"},[i("Slider",{staticClass:"slider",attrs:{min:e.question.options.minRange,max:e.question.options.maxRange,step:e.sliderStep,"show-input":"","show-tips":"always"}}),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.extremeValueLabelSelected,expression:"extremeValueLabelSelected"}],staticClass:"text-desc"},[i("span",[e._v("\n              "+e._s(e.t("survey_creator.question.scoring.extreme_value_labels."+e.question.options.extremeValueLabel+".minValue"))+"\n            ")]),e._v(" "),i("span",[e._v("\n              "+e._s(e.t("survey_creator.question.scoring.extreme_value_labels."+e.question.options.extremeValueLabel+".maxValue"))+"\n            ")])])],1)])],1)],1)}))],2)},__vue_staticRenderFns__$j=[];const __vue_inject_styles__$k=function(e){e&&e("data-v-013e301f_0",{source:".slider-container[data-v-013e301f]{margin-bottom:18px;width:100%}.slider[data-v-013e301f]{width:85%;margin-left:66px;margin-right:134px;margin-top:16px}.text-desc[data-v-013e301f]{display:flex;justify-content:space-between;width:85%;padding-left:50px}",map:void 0,media:void 0})},__vue_scope_id__$k="data-v-013e301f",__vue_module_identifier__$k=void 0,__vue_is_functional_template__$k=!1,__vue_component__$k=normalizeComponent({render:__vue_render__$j,staticRenderFns:__vue_staticRenderFns__$j},__vue_inject_styles__$k,__vue_script__$k,"data-v-013e301f",false,undefined,!1,createInjector,void 0,void 0);var script$l=Vue.extend({name:"editor-question-row",components:{Row:Row,Col:Col,Divider:Divider,Card:Card,Icon:Icon,QuestionDefaultLayout:__vue_component__$7,SINGLE_SELECTION:__vue_component__$8,MULTI_SELECTION:__vue_component__$9,SHORT_ANSWER:__vue_component__$b,FILL_BLANK:__vue_component__$c,TEXT_TITLE:__vue_component__$d,MATRIX:__vue_component__$e,SCORING:__vue_component__$k,EVALUATION:__vue_component__$j},mixins:[LocaleMixin],inject:["$rootComponent"],props:{question:{type:Object,required:!0},index:{type:Number,required:!0},survey:{type:Object,required:!0}}});const __vue_script__$l=script$l;var __vue_render__$k=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Card",{staticClass:"question-row",attrs:{padding:0,bordered:!1,"dis-hover":!0}},[i("Divider",{staticClass:"question-type-desc",attrs:{orientation:"left"}},[e._v("\n    "+e._s(e.t("survey_creator.question.types."+e.question.type))+"\n  ")]),e._v(" "),i("Row",{staticStyle:{"flex-flow":"nowrap"},attrs:{type:"flex",justify:"start",align:"middle",gutter:20}},[i("Col",{staticClass:"question-row-move"},[i("Icon",{attrs:{custom:"i-icon icon-activity-drag",size:"15",color:"#dcdee2"}})],1),e._v(" "),i("Col",{staticClass:"question-row-content"},[i("question-default-layout",{attrs:{question:e.question,survey:e.survey}},[i(e.question.type,{tag:"component",attrs:{question:e.question,survey:e.survey}})],1)],1)],1)],1)},__vue_staticRenderFns__$k=[];const __vue_inject_styles__$l=void 0,__vue_scope_id__$l=void 0,__vue_module_identifier__$l=void 0,__vue_is_functional_template__$l=!1,__vue_component__$l=normalizeComponent({render:__vue_render__$k,staticRenderFns:__vue_staticRenderFns__$k},undefined,__vue_script__$l,undefined,false,undefined,!1,void 0,void 0,void 0);var script$m=Vue.extend({name:"editor-questions",components:{EditorQuestionRow:__vue_component__$l,draggable:draggable},mixins:[LocaleMixin],props:{survey:{type:Object,required:!0}},methods:{dragEnd(e){e.newIndex!==e.oldIndex&&BaseQuestionModel.rebuildQuestionNumber(this.survey.questions)},chooseQuestion(e){BaseQuestionModel.setActiveQuestion(e,this.survey.questions)}}}),__$_require_images_empty_svg__="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4NiIgaGVpZ2h0PSI4MCIgdmlld0JveD0iMCAwIDg2IDgwIj4KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPHBhdGggZmlsbD0iI0Y1RjVGNyIgZD0iTTc5IDY1LjY4djIuOTJjMCAyLjc2LTIuMjM5IDUtNSA1SDEyYy0yLjc2MiAwLTUtMi4yNC01LTV2LTIuOTJjLTQuNDIgMS40MTQtNyAzLjEwNC03IDQuOTIgMCA0Ljk3IDE5LjI1MSA5IDQzIDkgMjMuNzQ4IDAgNDMtNC4wMyA0My05IDAtMS44MTYtMi41NzktMy41MDYtNy00LjkyIi8+CiAgICAgICAgPHBhdGggZmlsbD0iI0RDREVFOCIgZD0iTTU3LjQxNCA1Mi4xNDljLS4yNDUuODU5LTEuMDMgMS40NS0xLjkyMyAxLjQ1SDMwLjUwOGMtLjg5MyAwLTEuNjc4LS41OTEtMS45MjMtMS40NWwtLjU0OS0xLjkyM2MtLjYxMy0yLjE0Ni0yLjU3NS0zLjYyNi00LjgwNy0zLjYyNkg3djIyYzAgMi43NjIgMi4yMzggNSA1IDVoNjJjMi43NjEgMCA1LTIuMjM4IDUtNXYtMjJINjIuNzcyYy0yLjIzMyAwLTQuMTk1IDEuNDgtNC44MDggMy42MjZsLS41NSAxLjkyM3oiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjRjBGMkY1IiBkPSJNNTkgNDMuNkgyN2MtLjU1MyAwLTEtLjQ0OC0xLTEgMC0uNTUzLjQ0Ny0xIDEtMWgzMmMuNTUyIDAgMSAuNDQ3IDEgMSAwIC41NTItLjQ0OCAxLTEgMXptMC05SDI3Yy0uNTUzIDAtMS0uNDQ4LTEtMSAwLS41NTMuNDQ3LTEgMS0xaDMyYy41NTIgMCAxIC40NDcgMSAxIDAgLjU1Mi0uNDQ4IDEtMSAxem0tMzEtOGMtMS4xMDQgMC0yLS44OTYtMi0ydi0xNGMwLTEuMTA0Ljg5Ni0yIDItMmgzMGMxLjEwNCAwIDIgLjg5NiAyIDJ2MTRjMCAxLjEwNC0uODk2IDItMiAySDI4eiIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM5MTk2QUEiIGQ9Ik02OC42IDQ2LjZ2LTEuNUg2OHYtMi41ODRoLjZ2LTIuOTVINjhWMzcuMDFoLjZWMzQuNmwxMC40IDEySDY4LjZ6TTE3LjQgMzQuNTk5djIuNDM5aC42djIuNTU2aC0uNnYyLjk0OWguNlY0NS4xaC0uNnYxLjVIN2wxMC40LTEyLjAwMXoiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjRENERUU4IiBkPSJNMTcuNDAxIDQ2LjZ2LTEuNUgxOC42djEuNWgtMS4xOTl6TTI3Ljc0OSAxLjJWMGgyLjk0OXYxLjJoLTIuOTQ5em01LjUwNiAwVjBoMi45NDl2MS4yaC0yLjk0OXptNS41MDQgMFYwaDIuOTQ5djEuMmgtMi45NDl6bTUuNTA2IDBWMGgyLjk0OXYxLjJoLTIuOTQ5em01LjUwNSAwVjBoMi45NDl2MS4ySDQ5Ljc3em01LjUwNiAwVjBoMi45NDl2MS4yaC0yLjk0OXptOC4zNjMuMDQ2QzYzLjQzIDEuMjE0IDYzLjIxNyAxLjIgNjMgMS4yaC0yLjIxOVYwSDYzYy4yNzggMCAuNTQ5LjAyLjgxNS4wNThsLS4xNzYgMS4xODh6bS00MS4zMDMuMDA0TDIyLjE1Ny4wNjJDMjIuNDMyLjAyMiAyMi43MTQgMCAyMyAwaDIuMTkzdjEuMkgyM2MtLjIyNSAwLS40NDcuMDE2LS42NjQuMDV6bTQ0LjgzNiAyLjk0N2MtLjI3OC0uODI2LS43OTItMS41NDYtMS40ODYtMi4wODNsLjczNC0uOTQ5Yy44ODMuNjgyIDEuNTM2IDEuNTk4IDEuODg5IDIuNjVsLTEuMTM3LjM4MnpNMTguODIgNC4yMmwtMS4xMzktLjM3N2MuMzQ4LTEuMDUyLjk5NS0xLjk3MiAxLjg3NC0yLjY1OWwuNzM4Ljk0NWMtLjY5LjU0LTEuMiAxLjI2My0xLjQ3MyAyLjA5MXptNDguNTgxIDUuMjYzVjYuNTM0SDY4LjZ2Mi45NWgtMS4xOTl6bS01MCAuMDI3VjYuNTYxSDE4LjZ2Mi45NWgtMS4xOTl6bTUwIDUuNDc4VjEyLjA0SDY4LjZ2Mi45NWgtMS4xOTl6bS01MCAuMDI4di0yLjk1SDE4LjZ2Mi45NWgtMS4xOTl6bTUwIDUuNDc4di0yLjk0OUg2OC42djIuOTVoLTEuMTk5em0tNTAgLjAyN3YtMi45NDlIMTguNnYyLjk1aC0xLjE5OXptNTAgNS40NzhWMjMuMDVINjguNlYyNmgtMS4xOTl6bS01MCAuMDI4di0yLjk1SDE4LjZ2Mi45NWgtMS4xOTl6bTUwIDUuNDc3di0yLjk0OUg2OC42djIuOTVoLTEuMTk5em0tNTAgLjAyOHYtMi45NDlIMTguNnYyLjk1aC0xLjE5OXptNTAgNS40NzdWMzQuMDZINjguNnYyLjk1aC0xLjE5OXptLTUwIC4wM3YtMi45NUgxOC42djIuOTVoLTEuMTk5em01MCA1LjQ3NnYtMi45NDlINjguNnYyLjk1aC0xLjE5OXptLTUwIC4wMjh2LTIuOTQ5SDE4LjZ2Mi45NWgtMS4xOTl6bTUwIDQuMDU2di0xLjVINjguNnYxLjVoLTEuMTk5eiIvPgogICAgPC9nPgo8L3N2Zz4K";const __vue_script__$m=script$m;var __vue_render__$l=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e.survey.questions.length>0?i("draggable",{staticClass:"questions-wrapper",attrs:{draggable:".question-row"},on:{start:function(t){e.drag=!0},end:e.dragEnd},model:{value:e.survey.questions,callback:function(t){e.$set(e.survey,"questions",t)},expression:"survey.questions"}},[i("transition-group",e._l(e.survey.questions,(function(t,n){return i("editor-question-row",{key:t.id,class:{"question-row-active":t.active},attrs:{question:t,survey:e.survey,index:n,id:t.id},nativeOn:{click:function(i){return e.chooseQuestion(t)}}})})),1)],1):i("div",{staticClass:"no-data"},[i("img",{staticClass:"empty-icon",attrs:{src:__$_require_images_empty_svg__}}),e._v(" "),i("p",{staticClass:"empty-desc"},[e._v(e._s(e.t("survey_creator.question.no_data")))])])],1)},__vue_staticRenderFns__$l=[];const __vue_inject_styles__$m=void 0,__vue_scope_id__$m=void 0,__vue_module_identifier__$m=void 0,__vue_is_functional_template__$m=!1,__vue_component__$m=normalizeComponent({render:__vue_render__$l,staticRenderFns:__vue_staticRenderFns__$l},undefined,__vue_script__$m,undefined,false,undefined,!1,void 0,void 0,void 0);var script$n=Vue.extend({name:"survey-editor",mixins:[LocaleMixin],components:{Card:Card,Row:Row,Col:Col,Button:Button,EditQuestions:__vue_component__$m},props:{survey:{type:Object,required:!0},options:{type:Object,required:!0}}});const __vue_script__$n=script$n;var __vue_render__$m=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"survey-editor-wrapper"},[i("Card",{attrs:{bordered:!1,"dis-hover":""}},[i("edit-questions",{attrs:{survey:e.survey}})],1)],1)},__vue_staticRenderFns__$m=[];const __vue_inject_styles__$n=void 0,__vue_scope_id__$n=void 0,__vue_module_identifier__$n=void 0,__vue_is_functional_template__$n=!1,__vue_component__$n=normalizeComponent({render:__vue_render__$m,staticRenderFns:__vue_staticRenderFns__$m},undefined,__vue_script__$n,undefined,false,undefined,!1,void 0,void 0,void 0);var questionFormMixin=Vue.extend({inject:["$rootComponent"],mixins:[LocaleMixin],props:{question:{type:Object,required:!0}},data:()=>({editQuestion:Object,primaryLanguage:""}),mounted(){this.primaryLanguage=this.$rootComponent.primaryLanguage},created(){this.editQuestion=_$1.cloneDeep(this.question)},methods:{}}),script$o=Vue.extend({name:"rich-text",components:{Button:Button},props:{value:{type:String,default:""},placeholder:{type:String,default:""}},data:()=>({spaceCharacter:"_____",isError:!1}),mounted(){this.$nextTick((()=>{this.value&&(this.$refs.richTextArea.innerText=this.value)}))},methods:{t:t,replaceNewline:e=>e.replace(/(\n|\r|\r\n)/g,""),add(){const e=this.$refs.richTextArea;e.focus();const t=window.getSelection();if(t){const e=t.getRangeAt(0),i=document.createElement("span");i.innerText=this.spaceCharacter,e.insertNode(i),e.collapse(!1)}this.$emit("input",this.replaceNewline(e.innerText))},onInput(e){this.$emit("input",this.replaceNewline(e.target.innerText))},onValidate(e){this.isError=e}}});const __vue_script__$o=script$o;var __vue_render__$n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"rich-text-container",class:{error:e.isError}},[i("div",{staticClass:"header"},[i("Button",{staticClass:"add-button",attrs:{size:"small"},nativeOn:{click:function(t){return e.add.apply(null,arguments)}}},[e._v(e._s(e.t("survey_creator.question.rich_text.filler"))+"\n        ")])],1),e._v(" "),i("div",{ref:"richTextArea",staticClass:"rich-text-area",attrs:{contenteditable:"true",placeholder:e.placeholder},on:{input:e.onInput}})])},__vue_staticRenderFns__$n=[];const __vue_inject_styles__$o=function(e){e&&e("data-v-c74a5f40_0",{source:".rich-text-container[data-v-c74a5f40]{display:flex;flex-direction:column;border-radius:4px;outline:1px solid #dcdee2}.rich-text-container[data-v-c74a5f40]:focus-within{outline:1px solid #1890ff}.rich-text-container .header[data-v-c74a5f40]{height:40px;display:flex;align-items:center;background-color:#f7f7f7}.rich-text-container .header .add-button[data-v-c74a5f40]{margin-left:8px;color:#1890ff;border-color:#1890ff}.rich-text-container .rich-text-area[data-v-c74a5f40]{width:100%;overflow:auto;padding:5px;outline:0;display:flex;align-items:center;flex-wrap:wrap}.rich-text-container .rich-text-area[data-v-c74a5f40]:empty:after{content:attr(placeholder);color:#c5c8ce}.error[data-v-c74a5f40]{outline-color:#ed4014}",map:void 0,media:void 0})},__vue_scope_id__$o="data-v-c74a5f40",__vue_module_identifier__$o=void 0,__vue_is_functional_template__$o=!1,__vue_component__$o=normalizeComponent({render:__vue_render__$n,staticRenderFns:__vue_staticRenderFns__$n},__vue_inject_styles__$o,__vue_script__$o,"data-v-c74a5f40",false,undefined,!1,createInjector,void 0,void 0);var script$p=Vue.extend({name:"single-selection-form",components:{Form:Form,FormItem:FormItem,ButtonGroup:ButtonGroup,Button:Button,Input:Input$1,Checkbox:Checkbox,Radio:Radio,RadioGroup:RadioGroup,Row:Row,Col:Col,Icon:Icon,draggable:draggable,Modal:Modal,InputNumber:InputNumber,RichText:__vue_component__$o,Alert:Alert},mixins:[questionFormMixin],data:()=>({choiceLimit:{max:20,min:1},layoutOptions:["HORIZONTAL","VERTICAL"],enabledInputChoice:!1,enabledRichText:!1,enabledSpeciallyQuestions:!0,enabledEvaluationTag:!1}),created(){this.enabledInputChoice=_$1.get(this.$rootComponent,"options.enabledInputChoice",!1),this.enabledRichText=_$1.get(this.$rootComponent,"options.enabledPlanSurveyTeacherSetting",!1),this.enabledSpeciallyQuestions=_$1.get(this.$rootComponent,"options.enabledSpeciallyQuestions",!0),this.enabledEvaluationTag=_$1.get(this.$rootComponent,"options.enabledEvaluationTag",!1),this.enabledEvaluationTag&&!this.editQuestion.options.evaluationTag&&this.$set(this.editQuestion.options,"evaluationTag","COURSE"),this.editQuestion.options.richTextEnabled=this.enabledRichText},methods:{addOption(){this.editQuestion.choices.push(QuestionFactory.createDefault(this.$rootComponent.primaryLanguage))},deleteOption(e,t){let i=_$1.findIndex(_$1.get(this.editQuestion,"jumps",[]),(e=>e.choiceId===t));i>-1?Modal.confirm({title:this.t("survey_creator.question.jump.delete_option"),content:this.t("survey_creator.question.jump.delete_option_desc"),onOk:()=>{this.editQuestion.choices.splice(e,1),this.editQuestion.jumps.splice(i,1)}}):this.editQuestion.choices.splice(e,1)},scoringEnabledChange(){this.editQuestion.options.scoringEnabled||_$1.each(this.editQuestion.choices,(e=>{e.options.score=null}))},starEnabledChange(){this.editQuestion.options.starEnabled||_$1.each(this.editQuestion.choices,(e=>{e.options.star=!1}))},inputEnabledChange(){this.editQuestion.options.inputtedEnabled?this.editQuestion.options.inputMinLength=10:this.editQuestion.options.inputMinLength=null,this.editQuestion.options.inputtedEnabled||_$1.each(this.editQuestion.choices,(e=>{e.options.inputEnabled=!1}))},starChange(e){_$1.each(this.editQuestion.choices,(t=>{t.id==e&&(t.options.starCount=1==t.options.star?1:0)}))},validatedStar(e,t,i,n,o){if(this.editQuestion.options.starEnabled){let e=!1;_$1.each(this.editQuestion.choices,(t=>{t.options.star&&(e=!0)})),e&&i(),i(new Error(this.t("survey_creator.question.starRequiredTip")))}i()},validatedInput(e,t,i,n,o){if(this.editQuestion.options.inputtedEnabled){let e=!1;_$1.each(this.editQuestion.choices,(t=>{t.options.inputEnabled&&(e=!0)})),e&&i(),i(new Error(this.t("survey_creator.question.inputLeastOneTip")))}i()},onValidate(e,t,i){this.enabledRichText&&e===`header.text.${this.primaryLanguage}`&&this.$refs.richText.onValidate(!t)},onRichTextInput(){this.$refs.questionForm.validateField(`header.text.${this.primaryLanguage}`,(e=>{this.$refs.richText.onValidate(e)}))}}});const __vue_script__$p=script$p;var __vue_render__$o=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Form",{ref:"questionForm",attrs:{model:e.editQuestion,"label-colon":!1},on:{"on-validate":e.onValidate}},[i("div",{staticClass:"options-container",style:e.enabledSpeciallyQuestions||e.enabledInputChoice?"grid-template-columns: 50% 50%":"grid-template-columns: 100%"},[i("div",{staticClass:"options-row"},[i("div",{staticClass:"options"},[i("Checkbox",{model:{value:e.editQuestion.options.required,callback:function(t){e.$set(e.editQuestion.options,"required",t)},expression:"editQuestion.options.required"}},[e._v("\n                    "+e._s(e.t("survey_creator.question.questionRequired"))+"\n                ")]),e._v(" "),i("Checkbox",{staticClass:"option",on:{"on-change":e.scoringEnabledChange},model:{value:e.editQuestion.options.scoringEnabled,callback:function(t){e.$set(e.editQuestion.options,"scoringEnabled",t)},expression:"editQuestion.options.scoringEnabled"}},[e._v("\n                    "+e._s(e.t("survey_creator.question.scoringEnabled"))+"\n                ")])],1)]),e._v(" "),i("div",{staticClass:"options-row before-border"},[e.enabledSpeciallyQuestions?i("div",{staticClass:"options"},[i("Checkbox",{on:{"on-change":e.starEnabledChange},model:{value:e.editQuestion.options.starEnabled,callback:function(t){e.$set(e.editQuestion.options,"starEnabled",t)},expression:"editQuestion.options.starEnabled"}},[i("span",[e._v("\n          "+e._s(e.t("survey_creator.question.starEnabled"))+"\n          "),i("Icon",{attrs:{type:"md-star",color:"orange",size:16}})],1)]),e._v(" "),e.enabledInputChoice?i("div",[i("Checkbox",{staticClass:"option",on:{"on-change":e.inputEnabledChange},model:{value:e.editQuestion.options.inputtedEnabled,callback:function(t){e.$set(e.editQuestion.options,"inputtedEnabled",t)},expression:"editQuestion.options.inputtedEnabled"}},[e._v("\n                        "+e._s(e.t("survey_creator.question.inputted_enabled"))+"\n                    ")]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],staticClass:"option-expand"},[i("span",[e._v(e._s(e.t("survey_creator.question.inputted_enabled_prefix")))]),e._v(" "),i("InputNumber",{staticClass:"inputing",attrs:{max:999,min:1,precision:0},model:{value:e.editQuestion.options.inputMinLength,callback:function(t){e.$set(e.editQuestion.options,"inputMinLength",t)},expression:"editQuestion.options.inputMinLength"}}),e._v(" "),i("span",[e._v(e._s(e.t("survey_creator.question.inputted_enabled_suffix")))])],1)],1):e._e()],1):i("div",{staticClass:"options"},[e.enabledInputChoice?i("div",[i("Checkbox",{staticClass:"option",staticStyle:{"margin-top":"0px"},on:{"on-change":e.inputEnabledChange},model:{value:e.editQuestion.options.inputtedEnabled,callback:function(t){e.$set(e.editQuestion.options,"inputtedEnabled",t)},expression:"editQuestion.options.inputtedEnabled"}},[e._v("\n                        "+e._s(e.t("survey_creator.question.inputted_enabled"))+"\n                    ")]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],staticClass:"option-expand"},[i("span",[e._v(e._s(e.t("survey_creator.question.inputted_enabled_prefix")))]),e._v(" "),i("InputNumber",{staticClass:"inputing",attrs:{max:999,min:1,precision:0},model:{value:e.editQuestion.options.inputMinLength,callback:function(t){e.$set(e.editQuestion.options,"inputMinLength",t)},expression:"editQuestion.options.inputMinLength"}}),e._v(" "),i("span",[e._v(e._s(e.t("survey_creator.question.inputted_enabled_suffix")))])],1)],1):e._e()])])]),e._v(" "),e.enabledEvaluationTag?i("div",{staticClass:"evaluation-tag-row"},[i("span",{staticClass:"evaluation-tag-label"},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.label"))+"：")]),e._v(" "),i("RadioGroup",{model:{value:e.editQuestion.options.evaluationTag,callback:function(t){e.$set(e.editQuestion.options,"evaluationTag",t)},expression:"editQuestion.options.evaluationTag"}},[i("Radio",{attrs:{label:"TEACHER"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.TEACHER")))]),e._v(" "),i("Radio",{attrs:{label:"COURSE"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.COURSE")))])],1)],1):e._e(),e._v(" "),e.enabledRichText?i("Alert",{attrs:{"show-icon":""}},[e._v(e._s(e.t("survey_creator.question.rich_text.alert"))+"\n    ")]):e._e(),e._v(" "),i("Row",[i("Form-item",{attrs:{"label-width":80,label:e.t("survey_creator.page.question"),prop:"header.text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.titleRequiredTip")}}},[i("Row",[i("Col",{attrs:{span:"24"}},[e.enabledRichText?i("rich-text",{ref:"richText",attrs:{placeholder:e.t("survey_creator.question.titleRequiredTip")},on:{input:e.onRichTextInput},model:{value:e.editQuestion.header.text[e.primaryLanguage],callback:function(t){e.$set(e.editQuestion.header.text,e.primaryLanguage,t)},expression:"editQuestion.header.text[primaryLanguage]"}}):i("Input",{attrs:{maxlength:500,placeholder:e.t("survey_creator.question.titleRequiredTip")},model:{value:e.editQuestion.header.text[e.primaryLanguage],callback:function(t){e.$set(e.editQuestion.header.text,e.primaryLanguage,t)},expression:"editQuestion.header.text[primaryLanguage]"}})],1)],1)],1)],1),e._v(" "),i("div",{staticClass:"option-header"},[i("div",{staticClass:"choice"},[e._v("\n            "+e._s(e.t("survey_creator.question.option_header_choice"))+"\n        ")]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.scoringEnabled,expression:"editQuestion.options.scoringEnabled"}],staticClass:"scoring"},[e._v("\n            "+e._s(e.t("survey_creator.question.option_header_scoring"))+"\n        ")]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[e._v("\n            "+e._s(e.t("survey_creator.question.option_header_inputing"))+"\n        ")]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.starEnabled,expression:"editQuestion.options.starEnabled"}],staticClass:"inputing"},[e._v("\n            "+e._s(e.t("survey_creator.question.starEnabled"))+"\n        ")])]),e._v(" "),i("draggable",{staticClass:"question-choices-wrapper",attrs:{draggable:".question-choice"},on:{start:function(t){e.drag=!0},end:function(t){e.drag=!1}},model:{value:e.editQuestion.choices,callback:function(t){e.$set(e.editQuestion,"choices",t)},expression:"editQuestion.choices"}},e._l(e.editQuestion.choices,(function(t,n){return i("div",{key:n},[i("FormItem",{attrs:{"label-width":80,label:e.t("survey_creator.question.optional"),prop:"choices."+n+".text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.optionalRequiredTip")}}},[i("div",{staticClass:"question-choice"},[i("div",{staticClass:"choice"},[i("Input",{model:{value:t.text[e.primaryLanguage],callback:function(i){e.$set(t.text,e.primaryLanguage,"string"==typeof i?i.trim():i)},expression:"option.text[primaryLanguage]"}}),e._v(" "),e.editQuestion.choices.length<e.choiceLimit.max?i("Button",{staticClass:"button",attrs:{icon:"md-add"},nativeOn:{click:function(t){return e.addOption()}}}):e._e(),e._v(" "),e.editQuestion.choices.length>e.choiceLimit.min?i("Button",{staticClass:"button",attrs:{icon:"md-remove"},nativeOn:{click:function(i){return e.deleteOption(n,t.id)}}}):e._e()],1),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.scoringEnabled,expression:"editQuestion.options.scoringEnabled"}],staticClass:"scoring"},[i("Form-item",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.scoringEnabled,expression:"editQuestion.options.scoringEnabled"}],attrs:{prop:"choices."+n+".options.score","label-width":80,rules:[{required:e.editQuestion.options.scoringEnabled,message:e.t("survey_creator.question.scoreRequiredTip")},{pattern:/^(100|0(\.\d{1,2})?|[1-9]?\d(\.\d{1,2})?)$/,message:e.t("survey_creator.question.scoreErrorTip")}]}},[i("Input",{attrs:{type:"number"},model:{value:t.options.score,callback:function(i){e.$set(t.options,"score",i)},expression:"option.options.score"}})],1)],1),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[i("Form-item",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],attrs:{prop:"choices."+n+".options.inputEnabled","label-width":80,rules:[{message:e.t("survey_creator.question.inputLeastOneTip"),validator:e.validatedInput}]}},[i("Checkbox",{model:{value:t.options.inputEnabled,callback:function(i){e.$set(t.options,"inputEnabled",i)},expression:"option.options.inputEnabled"}})],1)],1),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.starEnabled,expression:"editQuestion.options.starEnabled"}],staticClass:"inputing"},[i("Form-item",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.starEnabled,expression:"editQuestion.options.starEnabled"}],attrs:{prop:"choices."+n+".options.star","label-width":80,rules:[{message:e.t("survey_creator.question.starLeastOneTip"),validator:e.validatedStar}]}},[i("Checkbox",{on:{"on-change":function(i){return e.starChange(t.id)}},model:{value:t.options.star,callback:function(i){e.$set(t.options,"star",i)},expression:"option.options.star"}})],1)],1)])]),e._v(" "),t.options.inputEnabled?i("div",{staticClass:"option-input"},[i("Input",{attrs:{disabled:"",placeholder:e.t("survey_creator.question.inputEnabledTip")}})],1):e._e()],1)})),0)],1)},__vue_staticRenderFns__$o=[];const __vue_inject_styles__$p=function(e){e&&e("data-v-4214b994_0",{source:".options-container[data-v-4214b994]{margin:0 8px 16px;border-bottom:1px solid #e8eaec;display:grid}.options-container .options-row[data-v-4214b994]{display:flex;flex-direction:row;margin-bottom:16px}.options-container .options-row .options[data-v-4214b994]{display:flex;flex-direction:column}.options-container .options-row .options .option[data-v-4214b994]{margin-top:24px}.options-container .options-row .options .option-expand[data-v-4214b994]{display:flex;align-items:center;margin-top:10px;padding:8px;border-radius:4px;background:#f7f7f7}.options-container .options-row .options .option-expand .inputing[data-v-4214b994]{width:64px}.options-container .before-border[data-v-4214b994]{border-left:1px solid #e8eaec;padding-left:16px}.evaluation-tag-row[data-v-4214b994]{display:flex;align-items:center;padding:8px 8px 12px;border-bottom:1px solid #e8eaec;margin-bottom:16px}.evaluation-tag-row .evaluation-tag-label[data-v-4214b994]{margin-right:8px;font-size:14px;color:#262833;white-space:nowrap}.option-header[data-v-4214b994]{background:#f0f1f3;border-radius:4px;width:100%;height:32px;margin-bottom:24px;display:flex;flex-direction:row;color:#70748c;align-items:center;padding:0 8px 0 16px}.option-header .choice[data-v-4214b994]{width:100%}.option-header .scoring[data-v-4214b994]{width:100px;display:flex;justify-content:center}.option-header .inputing[data-v-4214b994]{width:145px;min-width:42px;display:flex;justify-content:center}.question-choice[data-v-4214b994]{display:flex;flex-direction:row;align-items:center;padding-right:8px}.question-choice .choice[data-v-4214b994]{display:flex;flex-direction:row;width:100%;margin-right:8px}.question-choice .choice .button[data-v-4214b994]{margin-left:8px}.question-choice .scoring[data-v-4214b994]{width:85px}.question-choice .inputing[data-v-4214b994]{width:145px;text-align:center}.question-choice .inputing .ivu-checkbox-wrapper[data-v-4214b994]{margin-right:0}[data-v-4214b994] .ivu-form-item{width:100%}.option-input[data-v-4214b994]{margin:0 50px 30px 80px}[data-v-4214b994] .ivu-form-item-error-tip{min-width:170px}",map:void 0,media:void 0})},__vue_scope_id__$p="data-v-4214b994",__vue_module_identifier__$p=void 0,__vue_is_functional_template__$p=!1,__vue_component__$p=normalizeComponent({render:__vue_render__$o,staticRenderFns:__vue_staticRenderFns__$o},__vue_inject_styles__$p,__vue_script__$p,"data-v-4214b994",false,undefined,!1,createInjector,void 0,void 0);var script$q=Vue.extend({name:"multi-selection-form",components:{Form:Form,FormItem:FormItem,ButtonGroup:ButtonGroup,Button:Button,Input:Input$1,Checkbox:Checkbox,Radio:Radio,RadioGroup:RadioGroup,Row:Row,Col:Col,Icon:Icon,Select:Select,Option:Option,Tooltip:Tooltip$1,draggable:draggable,InputNumber:InputNumber,RichText:__vue_component__$o,Alert:Alert},mixins:[questionFormMixin],data:()=>({choiceLimit:{max:20,min:1},layoutOptions:["HORIZONTAL","VERTICAL"],selectStarList:[],enabledExclusiveChoice:!1,enabledInputChoice:!1,enabledRichText:!1,enabledSpeciallyQuestions:!0,enabledEvaluationTag:!1}),created(){this.resetStarList(),this.enabledExclusiveChoice=_$1.get(this.$rootComponent,"options.enabledExclusiveChoice",!1),this.enabledInputChoice=_$1.get(this.$rootComponent,"options.enabledInputChoice",!1),this.enabledRichText=_$1.get(this.$rootComponent,"options.enabledPlanSurveyTeacherSetting",!1),this.editQuestion.options.richTextEnabled=this.enabledRichText,this.enabledSpeciallyQuestions=_$1.get(this.$rootComponent,"options.enabledSpeciallyQuestions",!0),this.enabledEvaluationTag=_$1.get(this.$rootComponent,"options.enabledEvaluationTag",!1),this.enabledEvaluationTag&&!this.editQuestion.options.evaluationTag&&this.$set(this.editQuestion.options,"evaluationTag","COURSE")},computed:{gridTemplateColumns(){var e=0;return this.enabledExclusiveChoice&&e++,this.enabledInputChoice&&e++,this.enabledSpeciallyQuestions&&e++,e}},methods:{handleExclusiveChoice(e){if(this.editQuestion.options.exclusiveEnabled){const t=this.editQuestion.choices.pop();e(),this.editQuestion.choices.push(t)}else e()},addOption(){this.handleExclusiveChoice((()=>{this.editQuestion.choices.push(QuestionFactory.createDefault(this.$rootComponent.primaryLanguage))})),this.resetStarList()},deleteOption(e){this.editQuestion.choices.splice(e,1),this.resetStarList()},scoringEnabledChange(){this.editQuestion.options.scoringEnabled||_$1.each(this.editQuestion.choices,(e=>{e.options.score=null}))},starEnabledChange(){this.editQuestion.options.starEnabled?this.editQuestion.options.starMinCount=1:this.editQuestion.options.starMinCount=null},inputEnabledChange(){this.editQuestion.options.inputtedEnabled?this.editQuestion.options.inputMinLength=10:this.editQuestion.options.inputMinLength=null,this.editQuestion.options.inputtedEnabled||_$1.each(this.editQuestion.choices,(e=>{e.options.inputEnabled=!1}))},resetStarList(){this.selectStarList=[],_$1.each(this.editQuestion.choices,((e,t)=>{this.selectStarList.push({label:t+1,value:t+1})})),this.editQuestion.options.starMinCount=1},exclusiveEnabledChange(){const e=QuestionFactory.createExclusiveChoice(this.$rootComponent.primaryLanguage);e.text[this.$rootComponent.primaryLanguage]=this.t("survey_creator.question.exclusive_choice"),this.editQuestion.options.exclusiveEnabled?this.editQuestion.choices.push(e):this.editQuestion.choices.pop(),this.resetStarList()},validatedInput(e,t,i,n,o){if(this.editQuestion.options.inputtedEnabled){let e=!1;_$1.each(this.editQuestion.choices,(t=>{t.options.inputEnabled&&(e=!0)})),e&&i(),i(new Error(this.t("survey_creator.question.inputLeastOneTip")))}i()},onValidate(e,t,i){this.enabledRichText&&e===`header.text.${this.primaryLanguage}`&&this.$refs.richText.onValidate(!t)},onRichTextInput(){this.$refs.questionForm.validateField(`header.text.${this.primaryLanguage}`,(e=>{this.$refs.richText.onValidate(e)}))}}});const __vue_script__$q=script$q;var __vue_render__$p=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Form",{ref:"questionForm",staticClass:"multi-selection-form",attrs:{model:e.editQuestion,"label-colon":!1},on:{"on-validate":e.onValidate}},[i("div",{staticClass:"options-container",style:e.gridTemplateColumns>2?"grid-template-columns: 30% 40% 30%":"grid-template-columns: 50% 50%"},[i("div",{staticClass:"options-row"},[i("div",{staticClass:"options"},[i("Checkbox",{model:{value:e.editQuestion.options.required,callback:function(t){e.$set(e.editQuestion.options,"required",t)},expression:"editQuestion.options.required"}},[e._v("\n                    "+e._s(e.t("survey_creator.question.questionRequired"))+"\n                ")]),e._v(" "),i("Checkbox",{staticClass:"option",on:{"on-change":e.scoringEnabledChange},model:{value:e.editQuestion.options.scoringEnabled,callback:function(t){e.$set(e.editQuestion.options,"scoringEnabled",t)},expression:"editQuestion.options.scoringEnabled"}},[e._v("\n                    "+e._s(e.t("survey_creator.question.scoringEnabled"))+"\n                ")])],1)]),e._v(" "),e.gridTemplateColumns>0?i("div",{staticClass:"options-row before-border"},[e.enabledSpeciallyQuestions?i("div",{staticClass:"options"},[i("Checkbox",{on:{"on-change":e.starEnabledChange},model:{value:e.editQuestion.options.starEnabled,callback:function(t){e.$set(e.editQuestion.options,"starEnabled",t)},expression:"editQuestion.options.starEnabled"}},[i("span",[e._v("\n          "+e._s(e.t("survey_creator.question.starEnabled"))+"\n          "),i("Icon",{attrs:{type:"md-star",color:"orange",size:16}})],1)]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.starEnabled,expression:"editQuestion.options.starEnabled"}],staticClass:"option-expand"},[i("span",[e._v("\n          "+e._s(e.t("survey_creator.question.starMinCountPrefix"))+"\n        ")]),e._v(" "),i("Select",{staticStyle:{width:"50px"},attrs:{size:"small"},model:{value:e.editQuestion.options.starMinCount,callback:function(t){e.$set(e.editQuestion.options,"starMinCount",t)},expression:"editQuestion.options.starMinCount"}},e._l(e.selectStarList,(function(t){return i("Option",{key:t.value,attrs:{value:t.value}},[e._v(e._s(t.label)+"\n                        ")])})),1),e._v(" "),i("span",[e._v("\n          "+e._s(e.t("survey_creator.question.starMinCountSuffix"))+"\n        ")])],1),e._v(" "),e.enabledInputChoice?i("div",[i("Checkbox",{staticClass:"option",on:{"on-change":e.inputEnabledChange},model:{value:e.editQuestion.options.inputtedEnabled,callback:function(t){e.$set(e.editQuestion.options,"inputtedEnabled",t)},expression:"editQuestion.options.inputtedEnabled"}},[e._v("\n                        "+e._s(e.t("survey_creator.question.inputted_enabled"))+"\n                    ")]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],staticClass:"option-expand"},[i("span",[e._v(e._s(e.t("survey_creator.question.inputted_enabled_prefix")))]),e._v(" "),i("InputNumber",{staticClass:"inputing",attrs:{max:999,min:1,precision:0},model:{value:e.editQuestion.options.inputMinLength,callback:function(t){e.$set(e.editQuestion.options,"inputMinLength",t)},expression:"editQuestion.options.inputMinLength"}}),e._v(" "),i("span",[e._v(e._s(e.t("survey_creator.question.inputted_enabled_suffix")))])],1)],1):e._e(),e._v(" "),e.enabledExclusiveChoice&&!e.enabledInputChoice?i("div",{staticClass:"options"},[i("Checkbox",{staticClass:"option",on:{"on-change":e.exclusiveEnabledChange},model:{value:e.editQuestion.options.exclusiveEnabled,callback:function(t){e.$set(e.editQuestion.options,"exclusiveEnabled",t)},expression:"editQuestion.options.exclusiveEnabled"}},[i("span",[e._v("\n          "+e._s(e.t("survey_creator.question.exclusive_enabled"))+"\n          "),i("Tooltip",{attrs:{"max-width":"200",content:e.t("survey_creator.question.exclusive_option_tooltip"),placement:"bottom"}},[i("Icon",{attrs:{custom:"i-icon icon-exclamation-mark-outline",size:"16"}})],1)],1)])],1):e._e()],1):i("div",{staticClass:"options"},[e.enabledInputChoice?i("div",[i("Checkbox",{staticClass:"option",staticStyle:{"margin-top":"0px"},on:{"on-change":e.inputEnabledChange},model:{value:e.editQuestion.options.inputtedEnabled,callback:function(t){e.$set(e.editQuestion.options,"inputtedEnabled",t)},expression:"editQuestion.options.inputtedEnabled"}},[e._v("\n                        "+e._s(e.t("survey_creator.question.inputted_enabled"))+"\n                    ")]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],staticClass:"option-expand"},[i("span",[e._v(e._s(e.t("survey_creator.question.inputted_enabled_prefix")))]),e._v(" "),i("InputNumber",{staticClass:"inputing",attrs:{max:999,min:1,precision:0},model:{value:e.editQuestion.options.inputMinLength,callback:function(t){e.$set(e.editQuestion.options,"inputMinLength",t)},expression:"editQuestion.options.inputMinLength"}}),e._v(" "),i("span",[e._v(e._s(e.t("survey_creator.question.inputted_enabled_suffix")))])],1)],1):e._e(),e._v(" "),e.enabledExclusiveChoice?i("Checkbox",{staticClass:"option",style:e.enabledInputChoice?"margin-top: 24px":"margin-top: 0px",on:{"on-change":e.exclusiveEnabledChange},model:{value:e.editQuestion.options.exclusiveEnabled,callback:function(t){e.$set(e.editQuestion.options,"exclusiveEnabled",t)},expression:"editQuestion.options.exclusiveEnabled"}},[i("span",[e._v("\n          "+e._s(e.t("survey_creator.question.exclusive_enabled"))+"\n          "),i("Tooltip",{attrs:{"max-width":"200",content:e.t("survey_creator.question.exclusive_option_tooltip"),placement:"bottom"}},[i("Icon",{attrs:{custom:"i-icon icon-exclamation-mark-outline",size:"16"}})],1)],1)]):e._e()],1)]):e._e(),e._v(" "),e.gridTemplateColumns>2?i("div",{staticClass:"options-row before-border"},[i("div",{staticClass:"options"},[i("Checkbox",{on:{"on-change":e.exclusiveEnabledChange},model:{value:e.editQuestion.options.exclusiveEnabled,callback:function(t){e.$set(e.editQuestion.options,"exclusiveEnabled",t)},expression:"editQuestion.options.exclusiveEnabled"}},[i("span",[e._v("\n          "+e._s(e.t("survey_creator.question.exclusive_enabled"))+"\n          "),i("Tooltip",{attrs:{"max-width":"200",content:e.t("survey_creator.question.exclusive_option_tooltip"),placement:"bottom"}},[i("Icon",{attrs:{custom:"i-icon icon-exclamation-mark-outline",size:"16"}})],1)],1)])],1)]):e._e()]),e._v(" "),e.enabledEvaluationTag?i("div",{staticClass:"evaluation-tag-row"},[i("span",{staticClass:"evaluation-tag-label"},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.label"))+"：")]),e._v(" "),i("RadioGroup",{model:{value:e.editQuestion.options.evaluationTag,callback:function(t){e.$set(e.editQuestion.options,"evaluationTag",t)},expression:"editQuestion.options.evaluationTag"}},[i("Radio",{attrs:{label:"TEACHER"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.TEACHER")))]),e._v(" "),i("Radio",{attrs:{label:"COURSE"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.COURSE")))])],1)],1):e._e(),e._v(" "),e.enabledRichText?i("Alert",{attrs:{"show-icon":""}},[e._v(e._s(e.t("survey_creator.question.rich_text.alert"))+"\n    ")]):e._e(),e._v(" "),i("Row",[i("Form-item",{attrs:{"label-width":60,label:e.t("survey_creator.page.question"),prop:"header.text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.titleRequiredTip")}}},[i("Row",[i("Col",{attrs:{span:"24"}},[e.enabledRichText?i("rich-text",{ref:"richText",attrs:{placeholder:e.t("survey_creator.question.titleRequiredTip")},on:{input:e.onRichTextInput},model:{value:e.editQuestion.header.text[e.primaryLanguage],callback:function(t){e.$set(e.editQuestion.header.text,e.primaryLanguage,t)},expression:"editQuestion.header.text[primaryLanguage]"}}):i("Input",{attrs:{maxlength:500,placeholder:e.t("survey_creator.question.titleRequiredTip")},model:{value:e.editQuestion.header.text[e.primaryLanguage],callback:function(t){e.$set(e.editQuestion.header.text,e.primaryLanguage,t)},expression:"editQuestion.header.text[primaryLanguage]"}})],1)],1)],1)],1),e._v(" "),i("div",{staticClass:"option-header"},[i("div",{staticClass:"choice"},[e._v("\n            "+e._s(e.t("survey_creator.question.option_header_choice"))+"\n        ")]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.scoringEnabled,expression:"editQuestion.options.scoringEnabled"}],staticClass:"scoring"},[e._v("\n            "+e._s(e.t("survey_creator.question.option_header_scoring"))+"\n        ")]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[e._v("\n            "+e._s(e.t("survey_creator.question.option_header_inputing"))+"\n        ")])]),e._v(" "),i("draggable",{staticClass:"question-choices-wrapper",attrs:{draggable:".question-choice"},on:{start:function(t){e.drag=!0},end:function(t){e.drag=!1}},model:{value:e.editQuestion.choices,callback:function(t){e.$set(e.editQuestion,"choices",t)},expression:"editQuestion.choices"}},e._l(e.editQuestion.choices,(function(t,n){return i("div",{key:n},[t.options.exclusiveEnabled?i("div",{staticClass:"choice-row exclusive-choice"},[i("FormItem",{attrs:{"label-width":60,label:e.t("survey_creator.question.optional"),prop:"choices."+n+".text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.optionalRequiredTip")}}},[i("div",{staticClass:"question-choice"},[i("div",{staticClass:"choice"},[i("Input",{model:{value:t.text[e.primaryLanguage],callback:function(i){e.$set(t.text,e.primaryLanguage,"string"==typeof i?i.trim():i)},expression:"option.text[primaryLanguage]"}})],1),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.scoringEnabled,expression:"editQuestion.options.scoringEnabled"}],staticClass:"scoring"},[i("Form-item",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.scoringEnabled,expression:"editQuestion.options.scoringEnabled"}],attrs:{prop:"choices."+n+".options.score","label-width":60,rules:[{required:e.editQuestion.options.scoringEnabled,message:e.t("survey_creator.question.scoreRequiredTip")},{pattern:/^(100|0(\.\d{1,2})?|[1-9]?\d(\.\d{1,2})?)$/,message:e.t("survey_creator.question.scoreErrorTip")}]}},[i("Input",{attrs:{type:"number"},model:{value:t.options.score,callback:function(i){e.$set(t.options,"score",i)},expression:"option.options.score"}})],1)],1),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[i("Form-item",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],attrs:{prop:"choices."+n+".options.inputEnabled","label-width":80,rules:[{message:e.t("survey_creator.question.inputLeastOneTip"),validator:e.validatedInput}]}},[i("Checkbox",{model:{value:t.options.inputEnabled,callback:function(i){e.$set(t.options,"inputEnabled",i)},expression:"option.options.inputEnabled"}})],1)],1)])]),e._v(" "),t.options.inputEnabled?i("div",{staticClass:"option-input"},[i("Input",{attrs:{disabled:"",placeholder:e.t("survey_creator.question.inputEnabledTip")}})],1):e._e()],1):i("div",{staticClass:"choice-row"},[i("FormItem",{attrs:{"label-width":60,label:e.t("survey_creator.question.optional"),prop:"choices."+n+".text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.optionalRequiredTip")}}},[i("div",{staticClass:"question-choice"},[i("div",{staticClass:"choice"},[i("Input",{model:{value:t.text[e.primaryLanguage],callback:function(i){e.$set(t.text,e.primaryLanguage,"string"==typeof i?i.trim():i)},expression:"option.text[primaryLanguage]"}}),e._v(" "),e.editQuestion.choices.length<e.choiceLimit.max?i("Button",{staticClass:"button",attrs:{icon:"md-add"},nativeOn:{click:function(t){return e.addOption()}}}):e._e(),e._v(" "),e.editQuestion.choices.length>e.choiceLimit.min?i("Button",{staticClass:"button",attrs:{icon:"md-remove"},nativeOn:{click:function(t){return e.deleteOption(n)}}}):e._e()],1),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.scoringEnabled,expression:"editQuestion.options.scoringEnabled"}],staticClass:"scoring"},[i("Form-item",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.scoringEnabled,expression:"editQuestion.options.scoringEnabled"}],attrs:{prop:"choices."+n+".options.score","label-width":60,rules:[{required:e.editQuestion.options.scoringEnabled,message:e.t("survey_creator.question.scoreRequiredTip")},{pattern:/^(100|0(\.\d{1,2})?|[1-9]?\d(\.\d{1,2})?)$/,message:e.t("survey_creator.question.scoreErrorTip")}]}},[i("Input",{attrs:{type:"number"},model:{value:t.options.score,callback:function(i){e.$set(t.options,"score",i)},expression:"option.options.score"}})],1)],1),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],staticClass:"inputing"},[i("Form-item",{directives:[{name:"show",rawName:"v-show",value:e.editQuestion.options.inputtedEnabled,expression:"editQuestion.options.inputtedEnabled"}],attrs:{prop:"choices."+n+".options.inputEnabled","label-width":80,rules:[{message:e.t("survey_creator.question.inputLeastOneTip"),validator:e.validatedInput}]}},[i("Checkbox",{model:{value:t.options.inputEnabled,callback:function(i){e.$set(t.options,"inputEnabled",i)},expression:"option.options.inputEnabled"}})],1)],1)])]),e._v(" "),t.options.inputEnabled?i("div",{staticClass:"option-input"},[i("Input",{attrs:{disabled:"",placeholder:e.t("survey_creator.question.inputEnabledTip")}})],1):e._e()],1)])})),0)],1)},__vue_staticRenderFns__$p=[];const __vue_inject_styles__$q=function(e){e&&e("data-v-45217913_0",{source:".multi-selection-form .options-container[data-v-45217913]{margin:0 8px 16px;border-bottom:1px solid #e8eaec;display:grid}.multi-selection-form .options-container .options-row[data-v-45217913]{display:flex;flex-direction:row;margin-bottom:16px}.multi-selection-form .options-container .options-row .options[data-v-45217913]{display:flex;flex-direction:column}.multi-selection-form .options-container .options-row .options .option[data-v-45217913]{margin-top:24px}.multi-selection-form .options-container .options-row .options .option-expand[data-v-45217913]{display:flex;align-items:center;margin-top:10px;padding:8px;border-radius:4px;background:#f7f7f7}.multi-selection-form .options-container .options-row .options .option-expand .inputing[data-v-45217913]{width:64px}.multi-selection-form .options-container .before-border[data-v-45217913]{border-left:1px solid #e8eaec;padding-left:16px}.multi-selection-form .question-options[data-v-45217913]{padding-bottom:10px;padding-left:80px}.multi-selection-form[data-v-45217913] .ivu-form-item{width:100%}.multi-selection-form .evaluation-tag-row[data-v-45217913]{display:flex;align-items:center;padding:8px 8px 12px;border-bottom:1px solid #e8eaec;margin-bottom:16px}.multi-selection-form .evaluation-tag-row .evaluation-tag-label[data-v-45217913]{margin-right:8px;font-size:14px;color:#262833;white-space:nowrap}.multi-selection-form .option-header[data-v-45217913]{background:#f0f1f3;border-radius:4px;width:100%;height:32px;margin-bottom:24px;display:flex;flex-direction:row;color:#70748c;align-items:center;padding:0 8px 0 16px}.multi-selection-form .option-header .choice[data-v-45217913]{width:100%}.multi-selection-form .option-header .scoring[data-v-45217913]{width:100px;display:flex;justify-content:center}.multi-selection-form .option-header .inputing[data-v-45217913]{width:145px;min-width:42px;display:flex;justify-content:center}.multi-selection-form .choice-row .question-choice[data-v-45217913]{display:flex;flex-direction:row;align-items:center;padding-right:8px}.multi-selection-form .choice-row .question-choice .choice[data-v-45217913]{display:flex;flex-direction:row;width:100%;margin-right:8px}.multi-selection-form .choice-row .question-choice .choice .button[data-v-45217913]{margin-left:8px}.multi-selection-form .choice-row .question-choice .scoring[data-v-45217913]{width:85px}.multi-selection-form .choice-row .question-choice .inputing[data-v-45217913]{width:145px;text-align:center}.multi-selection-form .choice-row .question-choice .inputing .ivu-checkbox-wrapper[data-v-45217913]{margin-right:0}.multi-selection-form .exclusive-choice[data-v-45217913]{border-top:1px solid #e8eaec;padding-top:16px}.multi-selection-form .option-input[data-v-45217913]{margin:0 50px 30px 60px}[data-v-45217913] .ivu-form-item-error-tip{min-width:170px}",map:void 0,media:void 0})},__vue_scope_id__$q="data-v-45217913",__vue_module_identifier__$q=void 0,__vue_is_functional_template__$q=!1,__vue_component__$q=normalizeComponent({render:__vue_render__$p,staticRenderFns:__vue_staticRenderFns__$p},__vue_inject_styles__$q,__vue_script__$q,"data-v-45217913",false,undefined,!1,createInjector,void 0,void 0);var script$r=Vue.extend({name:"short-answer-form",components:{Form:Form,FormItem:FormItem,ButtonGroup:ButtonGroup,Button:Button,Input:Input$1,Checkbox:Checkbox,Radio:Radio,RadioGroup:RadioGroup,Icon:Icon},mixins:[questionFormMixin],data:()=>({enabledPresetReplies:!1,enabledEvaluationTag:!1}),computed:{isShortAnswer(){return"SHORT_ANSWER"===this.editQuestion.type},showPresetReplies(){return this.isShortAnswer&&this.enabledPresetReplies},hasEmptyReply(){const e=this.editQuestion?.options?.presetReplies;return!(!e||0===e.length)&&e.some((e=>!e||""===e.trim()))}},created(){this.enabledPresetReplies=_$1.get(this.$rootComponent,"options.enabledPresetReplies",!1),this.enabledEvaluationTag=_$1.get(this.$rootComponent,"options.enabledEvaluationTag",!1),this.editQuestion.options.presetReplies||this.$set(this.editQuestion.options,"presetReplies",[]),this.enabledEvaluationTag&&!this.editQuestion.options.evaluationTag&&this.$set(this.editQuestion.options,"evaluationTag","COURSE")},methods:{addPresetReply(){this.hasEmptyReply||this.editQuestion.options.presetReplies.push("")},removePresetReply(e){this.editQuestion.options.presetReplies.splice(e,1)},replyInputWidth(e){if(!e)return"200px";return Math.max(200,15*e.length+44)+"px"},validateDuplicate(e){return(t,i,n)=>{if(i){if(this.editQuestion.options.presetReplies.some(((t,n)=>t===i&&n!==e)))return void n(new Error(this.t("survey_creator.question.presetReplyDuplicateTip")))}n()}}}});const __vue_script__$r=script$r;var __vue_render__$q=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Form",{ref:"questionForm",attrs:{model:e.editQuestion,"label-colon":!1}},[i("Form-item",{attrs:{prop:"header.text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.titleRequiredTip")}}},[i("label",{attrs:{slot:"label"},slot:"label"},[i("span"),e._v(" "),i("span",[e._v(e._s(e.t("survey_creator.page.question")))])]),e._v(" "),i("Checkbox",{model:{value:e.editQuestion.options.required,callback:function(t){e.$set(e.editQuestion.options,"required",t)},expression:"editQuestion.options.required"}},[e._v("\n            "+e._s(e.t("survey_creator.question.questionRequired"))+"\n        ")]),e._v(" "),e.enabledEvaluationTag?i("div",{staticClass:"evaluation-tag-row"},[i("span",{staticClass:"evaluation-tag-label"},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.label"))+"：")]),e._v(" "),i("RadioGroup",{model:{value:e.editQuestion.options.evaluationTag,callback:function(t){e.$set(e.editQuestion.options,"evaluationTag",t)},expression:"editQuestion.options.evaluationTag"}},[i("Radio",{attrs:{label:"TEACHER"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.TEACHER")))]),e._v(" "),i("Radio",{attrs:{label:"COURSE"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.COURSE")))])],1)],1):e._e(),e._v(" "),i("Input",{attrs:{placeholder:e.t("survey_creator.question.titleRequiredTip")},model:{value:e.editQuestion.header.text[e.primaryLanguage],callback:function(t){e.$set(e.editQuestion.header.text,e.primaryLanguage,"string"==typeof t?t.trim():t)},expression:"editQuestion.header.text[primaryLanguage]"}})],1),e._v(" "),e.showPresetReplies?i("div",{staticClass:"preset-replies"},[i("Button",{attrs:{type:"primary",icon:"md-add",disabled:e.hasEmptyReply},on:{click:e.addPresetReply}},[e._v(e._s(e.t("survey_creator.question.addPresetReply"))+"\n        ")]),e._v(" "),i("div",{staticClass:"preset-reply-list"},e._l(e.editQuestion.options.presetReplies,(function(t,n){return i("Form-item",{key:n,staticClass:"preset-reply-item",attrs:{prop:"options.presetReplies."+n,rules:[{required:!0,message:e.t("survey_creator.question.presetReplyRequiredTip")},{validator:e.validateDuplicate(n)}]}},[i("div",{staticClass:"preset-reply-input",style:{width:e.replyInputWidth(e.editQuestion.options.presetReplies[n])}},[i("Input",{attrs:{placeholder:e.t("survey_creator.question.presetReply")},model:{value:e.editQuestion.options.presetReplies[n],callback:function(t){e.$set(e.editQuestion.options.presetReplies,n,"string"==typeof t?t.trim():t)},expression:"editQuestion.options.presetReplies[index]"}}),e._v(" "),i("Icon",{staticClass:"preset-reply-close",attrs:{type:"md-close"},on:{click:function(t){return e.removePresetReply(n)}}})],1)])})),1)],1):e._e()],1)},__vue_staticRenderFns__$q=[];const __vue_inject_styles__$r=function(e){e&&e("data-v-4d1aeb95_0",{source:"[data-v-4d1aeb95] .ivu-form-item{width:100%}.evaluation-tag-row[data-v-4d1aeb95]{display:flex;align-items:center;padding:8px 0 12px;margin-bottom:8px}.evaluation-tag-row .evaluation-tag-label[data-v-4d1aeb95]{margin-right:8px;font-size:14px;color:#262833;white-space:nowrap}.preset-replies .preset-reply-list[data-v-4d1aeb95]{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}.preset-replies .preset-reply-list[data-v-4d1aeb95] .ivu-form-item{margin-bottom:14px}.preset-replies .preset-reply-item[data-v-4d1aeb95] .ivu-form-item{margin-bottom:0}.preset-replies .preset-reply-item[data-v-4d1aeb95] .ivu-form-item .ivu-form-item-error-tip{white-space:nowrap}.preset-replies .preset-reply-item .preset-reply-input[data-v-4d1aeb95]{position:relative;min-width:200px}.preset-replies .preset-reply-item .preset-reply-input[data-v-4d1aeb95] .ivu-input{padding-right:28px}.preset-replies .preset-reply-item .preset-reply-input .preset-reply-close[data-v-4d1aeb95]{position:absolute;right:8px;top:50%;transform:translateY(-50%);font-size:16px;cursor:pointer;color:#999}.preset-replies .preset-reply-item .preset-reply-input .preset-reply-close[data-v-4d1aeb95]:hover{color:#ed4014}",map:void 0,media:void 0})},__vue_scope_id__$r="data-v-4d1aeb95",__vue_module_identifier__$r=void 0,__vue_is_functional_template__$r=!1,__vue_component__$r=normalizeComponent({render:__vue_render__$q,staticRenderFns:__vue_staticRenderFns__$q},__vue_inject_styles__$r,__vue_script__$r,"data-v-4d1aeb95",false,undefined,!1,createInjector,void 0,void 0);var script$s=Vue.extend({name:"matrix-form",components:{Form:Form,FormItem:FormItem,ButtonGroup:ButtonGroup,Button:Button,Input:Input$1,Checkbox:Checkbox,Radio:Radio,RadioGroup:RadioGroup,InputNumber:InputNumber,Row:Row,Col:Col,draggable:draggable},mixins:[questionFormMixin],data:()=>({labelWidth:80,defaultLevel:5,layoutOptions:["HORIZONTAL","VERTICAL"],enabledEvaluationTag:!1}),created(){this.enabledEvaluationTag=_$1.get(this.$rootComponent,"options.enabledEvaluationTag",!1),this.enabledEvaluationTag&&!this.editQuestion.options.evaluationTag&&this.$set(this.editQuestion.options,"evaluationTag","COURSE")},mounted(){this.initData()},methods:{initData(){this.editQuestion.options.level=this.editQuestion.choices.length,this.editQuestion.options.scoringEnabled=!0,this.editQuestion.subQuestions||_$1.set(this.editQuestion,"subQuestions",[]),this.initDefaultItems(this.editQuestion)},initDefaultItems(e){const t=this.primaryLanguage,i=this.t;return _$1.forEach(e.choices,((e,n)=>{_$1.get(e.text,t)||_$1.set(e.text,t,i(`survey_creator.question.matrixLevel${n+1}`)),e.options.score||(e.options.score=n+1)})),e},addItem(){this.editQuestion.subQuestions.push(new SubQuestionModel(this.primaryLanguage)),this.scrollToEnd()},deleteSubQuestion(e){this.editQuestion.subQuestions.splice(e,1)},scrollToEnd(){let e=this.editQuestion.subQuestions.length-1;this.$nextTick((()=>{document.getElementById("subQuestion-"+e).scrollIntoView()}))},levelChange(e){null==e&&(e=2);const t=this.primaryLanguage,i=this.t;let n=e-this.editQuestion.choices.length;if(0!=n)if(n>0)for(let e=0;e<n;e++)this.editQuestion.choices.push({options:{score:this.editQuestion.choices.length+1},text:_$1.set({},t,_$1.includes(_$1.range(1,this.defaultLevel+1),this.editQuestion.choices.length+1)?i(`survey_creator.question.matrixLevel${this.editQuestion.choices.length+1}`):""),id:ChoiceModel.createChoiceId()});else this.editQuestion.choices.splice(e,0-n)}},watch:{editQuestion:function(e){this.initData()}}});const __vue_script__$s=script$s;var __vue_render__$r=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Form",{ref:"questionForm",attrs:{model:e.editQuestion,"label-colon":!1}},[e.enabledEvaluationTag?i("div",{staticClass:"evaluation-tag-row"},[i("span",{staticClass:"evaluation-tag-label"},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.label"))+"：")]),e._v(" "),i("RadioGroup",{model:{value:e.editQuestion.options.evaluationTag,callback:function(t){e.$set(e.editQuestion.options,"evaluationTag",t)},expression:"editQuestion.options.evaluationTag"}},[i("Radio",{attrs:{label:"TEACHER"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.TEACHER")))]),e._v(" "),i("Radio",{attrs:{label:"COURSE"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.COURSE")))])],1)],1):e._e(),e._v(" "),i("Row",[i("Form-item",{attrs:{prop:"header.text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.titleRequiredTip")},label:e.t("survey_creator.page.matrixQuestion")}},[i("Checkbox",{model:{value:e.editQuestion.options.required,callback:function(t){e.$set(e.editQuestion.options,"required",t)},expression:"editQuestion.options.required"}},[e._v(e._s(e.t("survey_creator.question.questionRequired")))]),e._v(" "),i("Row",[i("Col",{attrs:{span:23,offset:-1}},[i("Input",{attrs:{placeholder:e.t("survey_creator.question.titleRequiredTip")},model:{value:e.editQuestion.header.text[e.primaryLanguage],callback:function(t){e.$set(e.editQuestion.header.text,e.primaryLanguage,"string"==typeof t?t.trim():t)},expression:"editQuestion.header.text[primaryLanguage]"}})],1)],1)],1)],1),e._v(" "),i("Row",[i("Form-item",{attrs:{label:e.t("survey_creator.question.level"),"label-width":e.labelWidth}},[i("InputNumber",{attrs:{min:2,max:20},on:{"on-change":e.levelChange},model:{value:e.editQuestion.options.level,callback:function(t){e.$set(e.editQuestion.options,"level",t)},expression:"editQuestion.options.level"}})],1)],1),e._v(" "),e._l(e.editQuestion.choices,(function(t,n){return i("FormItem",{key:t.id,attrs:{label:e.t("survey_creator.question.optional"),"label-width":e.labelWidth}},[i("Row",[i("Col",{attrs:{span:"4"}},[i("FormItem",{attrs:{prop:"choices."+n+".options.score",rules:{required:!0,message:e.t("survey_creator.question.scoreRequiredTip")}}},[i("InputNumber",{attrs:{min:0},model:{value:t.options.score,callback:function(i){e.$set(t.options,"score",i)},expression:"choice.options.score"}})],1)],1),e._v(" "),i("Col",{attrs:{span:"19"}},[i("FormItem",{attrs:{prop:"choices."+n+".text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.commitRequiredTip")}}},[i("Input",{model:{value:t.text[e.primaryLanguage],callback:function(i){e.$set(t.text,e.primaryLanguage,"string"==typeof i?i.trim():i)},expression:"choice.text[primaryLanguage]"}})],1)],1)],1)],1)})),e._v(" "),e._l(e.editQuestion.subQuestions,(function(t,n){return i("div",{key:n,attrs:{id:"subQuestion-"+n}},[i("FormItem",{attrs:{"label-width":e.labelWidth,label:e.t("survey_creator.question.sub_questions"),prop:"subQuestions."+ +n+".text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.subQuestionRequiredTip")}}},[i("Row",{attrs:{type:"flex",justify:"space-between"}},[i("Col",{attrs:{span:"20"}},[i("Input",{model:{value:t.text[e.primaryLanguage],callback:function(i){e.$set(t.text,e.primaryLanguage,"string"==typeof i?i.trim():i)},expression:"subQuestion.text[primaryLanguage]"}})],1),e._v(" "),i("Col",{attrs:{span:"3"}},[i("ButtonGroup",[e.editQuestion.subQuestions.length?i("Button",{attrs:{icon:"md-add"},nativeOn:{click:function(t){return e.addItem()}}}):e._e(),e._v(" "),e.editQuestion.subQuestions.length>1?i("Button",{attrs:{icon:"md-remove"},nativeOn:{click:function(t){return e.deleteSubQuestion(n)}}}):e._e()],1)],1)],1)],1)],1)}))],2)},__vue_staticRenderFns__$r=[];const __vue_inject_styles__$s=function(e){e&&e("data-v-9e7e18a0_0",{source:"[data-v-9e7e18a0] .ivu-form-item{width:100%}.evaluation-tag-row[data-v-9e7e18a0]{display:flex;align-items:center;padding:8px 8px 12px;border-bottom:1px solid #e8eaec;margin-bottom:16px}.evaluation-tag-row .evaluation-tag-label[data-v-9e7e18a0]{margin-right:8px;font-size:14px;color:#262833;white-space:nowrap}",map:void 0,media:void 0})},__vue_scope_id__$s="data-v-9e7e18a0",__vue_module_identifier__$s=void 0,__vue_is_functional_template__$s=!1,__vue_component__$s=normalizeComponent({render:__vue_render__$r,staticRenderFns:__vue_staticRenderFns__$r},__vue_inject_styles__$s,__vue_script__$s,"data-v-9e7e18a0",false,undefined,!1,createInjector,void 0,void 0);var script$t=Vue.extend({name:"scoring-form",components:{Form:Form,FormItem:FormItem,Input:Input$1,Checkbox:Checkbox,Radio:Radio,RadioGroup:RadioGroup,Row:Row,Col:Col,Select:Select,Option:Option,Divider:Divider,Slider:Slider,Icon:Icon,Tooltip:Tooltip$1,ButtonGroup:ButtonGroup,Button:Button},mixins:[questionFormMixin],data:()=>({extremeValueLabels:["satisfaction","importance","degree_of_conformity","degree_of_approval","willingness"],scoreRange:[],decimalPlaceOptions:[0,1],enabledEvaluationTag:!1}),created(){this.initData(),this.enabledEvaluationTag=_$1.get(this.$rootComponent,"options.enabledEvaluationTag",!1),this.enabledEvaluationTag&&!this.editQuestion.options.evaluationTags&&this.$set(this.editQuestion.options,"evaluationTags",["COURSE"])},computed:{disableLabelSelector(){return!this.editQuestion.options.extremeValueLabelEnabled},extremeValueLabelSelected(){return this.editQuestion.options.extremeValueLabelEnabled&&this.editQuestion.options.extremeValueLabel},sliderStep(){return 0===this.editQuestion.options.decimalPlaces?1:.1},showQuestionScoreSlider(){return!(this.editQuestion.subQuestions&&this.editQuestion.subQuestions.length>0)},showAddBtn(){return!this.editQuestion.subQuestions||this.editQuestion.subQuestions.length<10}},methods:{initData(){this.scoreRange=_$1.get(this.$rootComponent,"options.scoreRange",[0,1,2,3,4,5,6,7,8,9,10]),this.editQuestion.options.extremeValueLabelEnabled||Vue.set(this.editQuestion.options,"extremeValueLabelEnabled",!1),this.editQuestion.options.extremeValueLabel||Vue.set(this.editQuestion.options,"extremeValueLabel",void 0),this.editQuestion.options.minRange||Vue.set(this.editQuestion.options,"minRange",1),this.editQuestion.options.maxRange||Vue.set(this.editQuestion.options,"maxRange",_$1.last(this.scoreRange)),this.editQuestion.options.decimalPlaces||Vue.set(this.editQuestion.options,"decimalPlaces",0),Vue.set(this.editQuestion.options,"scoringEnabled",!0),this.editQuestion.subQuestions||_$1.set(this.editQuestion,"subQuestions",[])},addItem(){this.showAddBtn&&(this.editQuestion.subQuestions.push(new SubQuestionModel(this.primaryLanguage)),this.scrollToEnd())},deleteSubQuestion(e){this.editQuestion.subQuestions.splice(e,1)},scrollToEnd(){let e=this.editQuestion.subQuestions.length-1;this.$nextTick((()=>{document.getElementById("subQuestion-"+e).scrollIntoView()}))},disableMinRangeOption(e){return e>=this.editQuestion.options.maxRange},disableMaxRangeOption(e){return e<=this.editQuestion.options.minRange}},watch:{"editQuestion.options.maxRange":function(){(!this.editQuestion.subQuestions||_$1.isEmpty(this.editQuestion.subQuestions))&&this.editQuestion.options.sliderValue>this.editQuestion.options.maxRange?this.editQuestion.options.sliderValue=this.editQuestion.options.maxRange:_$1.forEach(this.editQuestion.subQuestions,(e=>{e.sliderValue>this.editQuestion.options.maxRange&&(e.sliderValue=this.editQuestion.options.maxRange)}))},"editQuestion.options.minRange":function(){this.editQuestion.subQuestions&&!_$1.isEmpty(this.editQuestion.subQuestions)||this.editQuestion.options.sliderValue&&!(this.editQuestion.options.sliderValue<this.editQuestion.options.minRange)?_$1.forEach(this.editQuestion.subQuestions,(e=>{(!e.sliderValue||e.sliderValue<this.editQuestion.options.minRange)&&(e.sliderValue=this.editQuestion.options.minRange)})):this.editQuestion.options.sliderValue=this.editQuestion.options.minRange}}});const __vue_script__$t=script$t;var __vue_render__$s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Form",{ref:"questionForm",attrs:{model:e.editQuestion,"label-colon":!1}},[i("Row",{staticStyle:{"margin-left":"24px"}},[i("Col",[i("Form-item",[i("Checkbox",{model:{value:e.editQuestion.options.required,callback:function(t){e.$set(e.editQuestion.options,"required",t)},expression:"editQuestion.options.required"}},[e._v(e._s(e.t("survey_creator.question.questionRequired"))+"\n                ")])],1),e._v(" "),i("Row",[i("Form-item",[i("Checkbox",{model:{value:e.editQuestion.options.extremeValueLabelEnabled,callback:function(t){e.$set(e.editQuestion.options,"extremeValueLabelEnabled",t)},expression:"editQuestion.options.extremeValueLabelEnabled"}},[e._v(e._s(e.t("survey_creator.question.scoring.extreme_value_label"))+"\n                    ")]),e._v(" "),i("Select",{staticStyle:{width:"160px"},attrs:{disabled:e.disableLabelSelector,"default-label":e.extremeValueLabels[0]},model:{value:e.editQuestion.options.extremeValueLabel,callback:function(t){e.$set(e.editQuestion.options,"extremeValueLabel",t)},expression:"editQuestion.options.extremeValueLabel"}},e._l(e.extremeValueLabels,(function(t){return i("Option",{key:t,attrs:{value:t}},[e._v(e._s(e.t("survey_creator.question.scoring.extreme_value_labels."+t+".label"))+"\n                        ")])})),1)],1)],1)],1),e._v(" "),i("Col",[i("Divider",{staticStyle:{height:"90px","margin-right":"16px"},attrs:{type:"vertical"}})],1),e._v(" "),i("Col",[i("div",[i("span",[e._v("\n        "+e._s(e.t("survey_creator.question.scoring.setScoringRange"))+"\n      ")]),e._v(" "),i("Select",{staticStyle:{width:"80px"},model:{value:e.editQuestion.options.minRange,callback:function(t){e.$set(e.editQuestion.options,"minRange",t)},expression:"editQuestion.options.minRange"}},e._l(e.scoreRange,(function(t){return i("Option",{key:t,attrs:{value:t,disabled:e.disableMinRangeOption(t)}},[e._v(e._s(t)+"\n                    ")])})),1),e._v("\n                -\n                "),i("Select",{staticStyle:{width:"80px"},model:{value:e.editQuestion.options.maxRange,callback:function(t){e.$set(e.editQuestion.options,"maxRange",t)},expression:"editQuestion.options.maxRange"}},e._l(e.scoreRange,(function(t){return i("Option",{key:t,attrs:{value:t,disabled:e.disableMaxRangeOption(t)}},[e._v(e._s(t)+"\n                    ")])})),1)],1),e._v(" "),i("div",{staticStyle:{"margin-top":"24px"}},[i("span",[e._v("\n        "+e._s(e.t("survey_creator.question.scoring.retainDecimal"))+"\n      ")]),e._v(" "),i("Select",{staticStyle:{width:"80px"},attrs:{"default-label":e.decimalPlaceOptions[0]},model:{value:e.editQuestion.options.decimalPlaces,callback:function(t){e.$set(e.editQuestion.options,"decimalPlaces",t)},expression:"editQuestion.options.decimalPlaces"}},e._l(e.decimalPlaceOptions,(function(t){return i("Option",{key:t,attrs:{value:t}},[e._v(e._s(t)+"\n                    ")])})),1),e._v(" "),i("span",[e._v("\n        "+e._s(e.t("survey_creator.question.scoring.decimalPlaces"))+"\n      ")])],1)])],1),e._v(" "),i("Divider",{staticStyle:{"margin-top":"-9px"}}),e._v(" "),e.enabledEvaluationTag?i("div",{staticClass:"evaluation-tag-row"},[i("span",{staticClass:"evaluation-tag-label"},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.label"))+"：")]),e._v(" "),i("RadioGroup",{model:{value:e.editQuestion.options.evaluationTag,callback:function(t){e.$set(e.editQuestion.options,"evaluationTag",t)},expression:"editQuestion.options.evaluationTag"}},[i("Radio",{attrs:{label:"TEACHER"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.TEACHER")))]),e._v(" "),i("Radio",{attrs:{label:"COURSE"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.COURSE")))])],1)],1):e._e(),e._v(" "),i("Row",[i("Form-item",{attrs:{prop:"header.text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.titleRequiredTip")},label:e.t("survey_creator.page.question")}},[i("Row",[i("Input",{attrs:{placeholder:e.t("survey_creator.question.titleRequiredTip")},model:{value:e.editQuestion.header.text[e.primaryLanguage],callback:function(t){e.$set(e.editQuestion.header.text,e.primaryLanguage,"string"==typeof t?t.trim():t)},expression:"editQuestion.header.text[primaryLanguage]"}})],1)],1),e._v(" "),i("Row",{directives:[{name:"show",rawName:"v-show",value:e.showQuestionScoreSlider,expression:"showQuestionScoreSlider"}]},[i("div",{staticStyle:{"margin-right":"134px","margin-bottom":"18px"}},[i("Slider",{staticStyle:{width:"562px","margin-left":"66px","margin-right":"134px","margin-top":"16px"},attrs:{min:e.editQuestion.options.minRange,max:e.editQuestion.options.maxRange,step:e.sliderStep,"show-input":"","show-tips":"always"},model:{value:e.editQuestion.options.sliderValue,callback:function(t){e.$set(e.editQuestion.options,"sliderValue",t)},expression:"editQuestion.options.sliderValue"}}),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.extremeValueLabelSelected,expression:"extremeValueLabelSelected"}]},[i("span",{staticStyle:{"margin-left":"66px",float:"left"}},[e._v("\n          "+e._s(e.t("survey_creator.question.scoring.extreme_value_labels."+e.editQuestion.options.extremeValueLabel+".minValue"))+"\n        ")]),e._v(" "),i("span",{staticStyle:{"margin-right":"230px",float:"right","align-items":"flex-end"}},[e._v("\n          "+e._s(e.t("survey_creator.question.scoring.extreme_value_labels."+e.editQuestion.options.extremeValueLabel+".maxValue"))+"\n        ")])])],1)]),e._v(" "),e._l(e.editQuestion.subQuestions,(function(t,n){return i("Col",{key:n,attrs:{span:"24",id:"subQuestion-"+n}},[i("Form-item",{attrs:{prop:"subQuestions."+n+".text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.titleRequiredTip")},label:e.t("survey_creator.page.subQuestion")}},[i("Row",[i("Col",{attrs:{span:"22"}},[i("Input",{attrs:{placeholder:e.t("survey_creator.question.titleRequiredTip")},model:{value:t.text[e.primaryLanguage],callback:function(i){e.$set(t.text,e.primaryLanguage,"string"==typeof i?i.trim():i)},expression:"subQuestion.text[primaryLanguage]"}})],1),e._v(" "),i("Col",{staticStyle:{"margin-left":"8px"}},[i("ButtonGroup",[i("Button",{attrs:{icon:"md-remove"},nativeOn:{click:function(t){return e.deleteSubQuestion(n)}}})],1)],1)],1)],1),e._v(" "),i("Row",[i("div",{staticStyle:{"margin-right":"134px","margin-bottom":"18px"}},[i("Slider",{staticStyle:{width:"562px","margin-left":"66px","margin-right":"134px","margin-top":"16px"},attrs:{min:e.editQuestion.options.minRange,max:e.editQuestion.options.maxRange,step:e.sliderStep,"show-input":"","show-tips":"always"},model:{value:t.sliderValue,callback:function(i){e.$set(t,"sliderValue",i)},expression:"subQuestion.sliderValue"}}),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.extremeValueLabelSelected,expression:"extremeValueLabelSelected"}]},[i("span",{staticStyle:{"margin-left":"66px",float:"left"}},[e._v("\n            "+e._s(e.t("survey_creator.question.scoring.extreme_value_labels."+e.editQuestion.options.extremeValueLabel+".minValue"))+"\n          ")]),e._v(" "),i("span",{staticStyle:{"margin-right":"230px",float:"right","align-items":"flex-end"}},[e._v("\n            "+e._s(e.t("survey_creator.question.scoring.extreme_value_labels."+e.editQuestion.options.extremeValueLabel+".maxValue"))+"\n          ")])])],1)])],1)}))],2),e._v(" "),i("div",{staticClass:"btn-container"},[i("Tooltip",{attrs:{placement:"right",disabled:e.showAddBtn,content:e.t("survey_creator.question.jump.no_option_to_setting")}},[i("div",{staticClass:"icon"},[i("Icon",{attrs:{type:"md-add",color:e.showAddBtn?"#1890FF":"#C5C8CE"},model:{value:e.showAddBtn,callback:function(t){e.showAddBtn=t},expression:"showAddBtn"}})],1),e._v(" "),i("div",{staticClass:"label",class:e.showAddBtn?"enabled":"disabled",on:{click:e.addItem}},[e._v("\n                "+e._s(e.t("survey_creator.question.scoring.addSubQuestion"))+"\n            ")])])],1)],1)},__vue_staticRenderFns__$s=[];const __vue_inject_styles__$t=function(e){e&&e("data-v-2f49f423_0",{source:"[data-v-2f49f423] .ivu-form-item{width:100%}.evaluation-tag-row[data-v-2f49f423]{display:flex;align-items:center;padding:8px 8px 12px;border-bottom:1px solid #e8eaec;margin-bottom:16px}.evaluation-tag-row .evaluation-tag-label[data-v-2f49f423]{margin-right:8px;font-size:14px;color:#262833;white-space:nowrap}.btn-container[data-v-2f49f423]{padding-left:8px}.btn-container .icon[data-v-2f49f423]{display:flex;float:left;font-size:18px}.btn-container .label[data-v-2f49f423]{display:flex;float:left;align-items:center;font-weight:500;font-size:14px;line-height:22px}.btn-container .disabled[data-v-2f49f423]{color:#c5c8ce}.btn-container .enabled[data-v-2f49f423]{color:#1890ff;cursor:pointer}",map:void 0,media:void 0})},__vue_scope_id__$t="data-v-2f49f423",__vue_module_identifier__$t=void 0,__vue_is_functional_template__$t=!1,__vue_component__$t=normalizeComponent({render:__vue_render__$s,staticRenderFns:__vue_staticRenderFns__$s},__vue_inject_styles__$t,__vue_script__$t,"data-v-2f49f423",false,undefined,!1,createInjector,void 0,void 0);var script$u=Vue.extend({name:"title-form",components:{Form:Form,FormItem:FormItem,ButtonGroup:ButtonGroup,Button:Button,Input:Input$1,Checkbox:Checkbox,Radio:Radio,RadioGroup:RadioGroup},mixins:[questionFormMixin],data:()=>({enabledEvaluationTag:!1}),created(){this.enabledEvaluationTag=_$1.get(this.$rootComponent,"options.enabledEvaluationTag",!1),this.enabledEvaluationTag&&!this.editQuestion.options.evaluationTag&&this.$set(this.editQuestion.options,"evaluationTag","COURSE")}});const __vue_script__$u=script$u;var __vue_render__$t=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Form",{ref:"questionForm",attrs:{model:e.editQuestion,"label-colon":!1}},[e.enabledEvaluationTag?i("div",{staticClass:"evaluation-tag-row"},[i("span",{staticClass:"evaluation-tag-label"},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.label"))+"：")]),e._v(" "),i("RadioGroup",{model:{value:e.editQuestion.options.evaluationTag,callback:function(t){e.$set(e.editQuestion.options,"evaluationTag",t)},expression:"editQuestion.options.evaluationTag"}},[i("Radio",{attrs:{label:"TEACHER"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.TEACHER")))]),e._v(" "),i("Radio",{attrs:{label:"COURSE"}},[e._v(e._s(e.t("survey_creator.question.evaluation_tag.COURSE")))])],1)],1):e._e(),e._v(" "),i("Form-item",{attrs:{prop:"header.text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.textTitleRequiredTip")}}},[i("label",{attrs:{slot:"label"},slot:"label"},[i("span"),e._v(" "),i("span",[e._v(e._s(e.t("survey_creator.page.textTitle")))])]),e._v(" "),i("Input",{attrs:{autosize:{minRows:3,maxRows:3},type:"textarea",placeholder:e.t("survey_creator.question.textTitleRequiredTip")},model:{value:e.editQuestion.header.text[e.primaryLanguage],callback:function(t){e.$set(e.editQuestion.header.text,e.primaryLanguage,"string"==typeof t?t.trim():t)},expression:"editQuestion.header.text[primaryLanguage]"}})],1)],1)},__vue_staticRenderFns__$t=[];const __vue_inject_styles__$u=function(e){e&&e("data-v-356bf7dc_0",{source:".evaluation-tag-row[data-v-356bf7dc]{display:flex;align-items:center;padding:8px 8px 12px;border-bottom:1px solid #e8eaec;margin-bottom:16px}.evaluation-tag-row .evaluation-tag-label[data-v-356bf7dc]{margin-right:8px;font-size:14px;color:#262833;white-space:nowrap}",map:void 0,media:void 0})},__vue_scope_id__$u="data-v-356bf7dc",__vue_module_identifier__$u=void 0,__vue_is_functional_template__$u=!1,__vue_component__$u=normalizeComponent({render:__vue_render__$t,staticRenderFns:__vue_staticRenderFns__$t},__vue_inject_styles__$u,__vue_script__$u,"data-v-356bf7dc",false,undefined,!1,createInjector,void 0,void 0);var script$v=Vue.extend({name:"star",mixins:[questionFormMixin],components:{FormItem:FormItem,Input:Input$1,InputNumber:InputNumber,draggable:draggable,Select:Select,Table:Table$1,Button:Button},props:{value:{type:Array,required:!0}},data(){return{evaluationItems:this.value,realColumns:[]}},created(){this.initDefaultChoices(),this.initColumns()},methods:{initDefaultChoices(){const e=this;let t=this.$rootComponent.primaryLanguage;_$1.forEach(this.evaluationItems,((i,n)=>{let o=e.t(`survey_creator.question.evaluation.level.${n+1}`);_$1.get(i.text,t)||o.startsWith("survey_creator.question.evaluation.level")||_$1.set(i.text,t,o),_$1.get(i,"level")||_$1.set(i,"level",1)})),this.calculationItemLevelRange()},calculationItemLevelRange(){let e=_$1.chain(this.evaluationItems).map((e=>parseInt(e.level))).filter((e=>!isNaN(e))).uniq().sortBy().value();_$1.forEach(this.evaluationItems,((t,i)=>{let n=_$1.indexOf(e,_$1.get(t,"level"));e.length==n+1?_$1.set(t,"range",{max:null,min:e[n]}):_$1.set(t,"range",{max:e[n+1]-1,min:e[n]})}))},initColumns(){this.realColumns=[{title:this.t("survey_creator.question.evaluation.levelNameLabel"),key:"levelName",slot:"levelName"},{title:`${this.t("survey_creator.question.evaluation.levelNameLabel")}(${this.t("survey_creator.question.evaluation.type.STAR")})`,key:"level",slot:"level"},{title:this.t("survey_creator.common.operation"),key:"actions",slot:"actions"}]},addItem(){let e=new StarEvaluationItemModel(this.primaryLanguage);e.level=1,this.evaluationItems.push(e),this.initDefaultChoices(),this.scrollToEnd()},deleteItem(e){this.evaluationItems.splice(e,1)},scrollToEnd(){this.evaluationItems.length;this.$nextTick((()=>{document.querySelector("tr.ivu-table-row :last-child").scrollIntoView()}))}}});const __vue_script__$v=script$v;var __vue_render__$u=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Table",{ref:"myTable",attrs:{size:"small",border:"",data:e.evaluationItems,columns:e.realColumns},scopedSlots:e._u([{key:"levelName",fn:function(t){var n=t.row;t.column;return[i("FormItem",{attrs:{prop:"evaluationItems["+n._index+"].text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.commitRequiredTip")}}},[i("Input",{model:{value:e.evaluationItems[n._index].text[e.primaryLanguage],callback:function(t){e.$set(e.evaluationItems[n._index].text,e.primaryLanguage,"string"==typeof t?t.trim():t)},expression:"evaluationItems[row._index].text[primaryLanguage]"}})],1)]}},{key:"level",fn:function(t){var n=t.row;t.column;return[i("FormItem",{attrs:{prop:"evaluationItems["+n._index+"].level",rules:{required:!0,message:e.t("survey_creator.question.levelRequiredTip")}}},[i("span",[e._v(">=")]),e._v(" "),i("InputNumber",{attrs:{min:1,max:100,"active-change":!1,precision:0},on:{"on-change":e.calculationItemLevelRange},model:{value:e.evaluationItems[n._index].level,callback:function(t){e.$set(e.evaluationItems[n._index],"level",t)},expression:"evaluationItems[row._index].level"}})],1)]}},{key:"actions",fn:function(t){var n=t.row;t.column;return[e.evaluationItems.length?i("Button",{attrs:{icon:"md-add"},nativeOn:{click:function(t){return e.addItem()}}}):e._e(),e._v(" "),e.evaluationItems.length>1?i("Button",{attrs:{icon:"md-remove"},nativeOn:{click:function(t){return e.deleteItem(n._index)}}}):e._e()]}}])})},__vue_staticRenderFns__$u=[];const __vue_inject_styles__$v=void 0,__vue_scope_id__$v=void 0,__vue_module_identifier__$v=void 0,__vue_is_functional_template__$v=!1,__vue_component__$v=normalizeComponent({render:__vue_render__$u,staticRenderFns:__vue_staticRenderFns__$u},undefined,__vue_script__$v,undefined,false,undefined,!1,void 0,void 0,void 0);var ExprMixin=Vue.extend({inject:["$rootComponent"],props:{value:{type:Object,required:!0},evaluationItems:{type:Array,required:!0},itemIndex:{type:Number,required:!0},index:{type:Number,required:!0}},data:()=>({primaryLanguage:"",choices:[],operators:["=",">=",">","<=","<","!="]}),watch:{value:{handler(e,t){this.$emit("expr",this.generateExpr()),this.choices=this.buildChoices(this.value.scope)},deep:!0,immediate:!0}},mounted(){this.primaryLanguage=this.$rootComponent.primaryLanguage,this.choices=this.buildChoices(this.value.scope)},methods:{buildChoices(e){const t=new Array,i=this.$rootComponent.currentSurvey.questions;return _$1.forEach(i,(i=>{!_$1.includes(e,i.id)&&_$1.isEmpty(_$1.intersection(e,_$1.map(_$1.get(i,"subQuestions",[]),"id")))||_$1.forEach(i.choices,(e=>{_$1.isNil(e.text[this.primaryLanguage])||t.push(e.text[this.primaryLanguage])}))})),_$1.uniq(t)},generateExpr:()=>""}}),script$w=Vue.extend({name:"question-select",components:{Select:Select,Option:Option,Tooltip:Tooltip$1},mixins:[questionFormMixin],props:{value:{type:Array,required:!0}},data(){return{scope:this.value}},computed:{questions(){return _$1.clone(this.$rootComponent.currentSurvey.questions)}},filters:{title:(e,t=10)=>e&&e.length>t?`${e.substring(0,t)}...`:e},methods:{onChange(e){this.$emit("input",e)},numbers(e){let t=new ExprEvaluationQuestion(this.questions,this.scope).calculateNumbers();return _$1.join(_$1.map(t,(e=>_$1.isArray(_$1.head(e))?_$1.join(_$1.map(e,(e=>_$1.join(e,"-"))),","):_$1.join(e,"-"))),",")},getSingleOptionContent(e){return e.header.number+" "+e.header.text[this.primaryLanguage]},getMatrixOptionContent(e,t){return e.header.number+"."+t.number+" "+t.text[this.primaryLanguage]}}});const __vue_script__$w=script$w;var __vue_render__$v=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Select",{attrs:{placeholder:e.t("survey_creator.question.evaluation.condition.question_scope"),multiple:"","max-tag-count":0,"max-tag-placeholder":e.numbers},on:{"on-change":e.onChange},model:{value:e.scope,callback:function(t){e.scope=t},expression:"scope"}},[e._l(e.questions,(function(t){return["SINGLE_SELECTION"==t.type?i("Option",{key:t.id,attrs:{value:t.id,tag:t.header.number}},[i("Tooltip",{attrs:{transfer:!0,content:e.getSingleOptionContent(t),"max-width":"500",placement:"top-start"}},[e._v("\n        "+e._s(t.header.number)+"\n        "+e._s(e._f("title")(t.header.text[e.primaryLanguage]))+"\n      ")])],1):e._e(),e._v(" "),"MATRIX"==t.type?e._l(t.subQuestions,(function(n){return i("Option",{key:n.id,attrs:{value:n.id,tag:t.header.number+"."+n.number}},[i("Tooltip",{attrs:{transfer:!0,content:e.getMatrixOptionContent(t,n),"max-width":"500",placement:"top-start"}},[e._v("\n          "+e._s(t.header.number)+"."+e._s(n.number)+"\n          "+e._s(e._f("title")(n.text[e.primaryLanguage]))+"\n        ")])],1)})):e._e()]}))],2)},__vue_staticRenderFns__$v=[];const __vue_inject_styles__$w=void 0,__vue_scope_id__$w=void 0,__vue_module_identifier__$w=void 0,__vue_is_functional_template__$w=!1,__vue_component__$w=normalizeComponent({render:__vue_render__$v,staticRenderFns:__vue_staticRenderFns__$v},undefined,__vue_script__$w,undefined,false,undefined,!1,void 0,void 0,void 0);var script$x=Vue.extend({name:"assign",mixins:[questionFormMixin,ExprMixin],components:{Row:Row,Col:Col,Select:Select,OptionGroup:OptionGroup,Option:Option,FormItem:FormItem,InputNumber:InputNumber,QuestionSelect:__vue_component__$w},created(){this.value.operator=_$1.unescape(this.value.operator)},methods:{generateExpr(){return`$count($[id in [${`${_$1.map(this.value.scope,(e=>'"'+e+'"'))}`}]][answer in [${`${_$1.map(this.value.values,(e=>'"'+e+'"'))}`}]]) ${this.value.operator} ${this.value.size}`}}});const __vue_script__$x=script$x;var __vue_render__$w=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Row",{attrs:{type:"flex",justify:"start",gutter:6,align:"middle"}},[i("Col",{staticClass:"label"},[e._v("\n    "+e._s(e.t("survey_creator.question.evaluation.condition.question"))+"\n  ")]),e._v(" "),i("Col",{attrs:{span:5}},[i("FormItem",{attrs:{prop:"evaluationItems["+e.itemIndex+"].conditions["+e.index+"].payload.scope",rules:{required:!0,type:"array",trigger:"change",min:1,message:e.t("survey_creator.question.notEmpty")}}},[i("question-select",{attrs:{question:e.question},model:{value:e.value.scope,callback:function(t){e.$set(e.value,"scope",t)},expression:"value.scope"}})],1)],1),e._v(" "),i("Col",{staticClass:"label"},[e._v("\n    "+e._s(e.t("survey_creator.question.evaluation.condition.question_result"))+"\n  ")]),e._v(" "),i("Col",{attrs:{span:5}},[i("FormItem",{attrs:{prop:"evaluationItems["+e.itemIndex+"].conditions["+e.index+"].payload.values",rules:{required:!0,type:"array",trigger:"change",min:1,message:e.t("survey_creator.question.notEmpty")}}},[i("Select",{attrs:{placeholder:e.t("survey_creator.question.evaluation.condition.choose_result"),"max-tag-count":1,multiple:""},model:{value:e.value.values,callback:function(t){e.$set(e.value,"values",t)},expression:"value.values"}},e._l(e.choices,(function(t,n){return i("Option",{key:n,attrs:{value:t}},[e._v("\n          "+e._s(t)+"\n        ")])})),1)],1)],1),e._v(" "),i("Col",{staticClass:"label"},[e._v("\n    "+e._s(e.t("survey_creator.question.evaluation.condition.question_count"))+"\n  ")]),e._v(" "),i("Col",{attrs:{span:3}},[i("FormItem",{attrs:{prop:"evaluationItems["+e.itemIndex+"].conditions["+e.index+"].payload.operator",rules:{required:!0,trigger:"change",message:e.t("survey_creator.question.notEmpty")}}},[i("Select",{attrs:{placeholder:e.t("survey_creator.question.evaluation.condition.operator")},model:{value:e.value.operator,callback:function(t){e.$set(e.value,"operator",t)},expression:"value.operator"}},e._l(e.operators,(function(t,n){return i("Option",{key:n,attrs:{value:t}},[e._v("\n          "+e._s(t)+"\n        ")])})),1)],1)],1),e._v(" "),i("Col",{attrs:{span:3}},[i("FormItem",{attrs:{prop:"evaluationItems["+e.itemIndex+"].conditions["+e.index+"].payload.size",rules:{required:!0,type:"number",trigger:"change",message:e.t("survey_creator.question.notEmpty")}}},[i("InputNumber",{attrs:{min:0,max:e.value.scope.length},model:{value:e.value.size,callback:function(t){e.$set(e.value,"size",t)},expression:"value.size"}})],1)],1)],1)},__vue_staticRenderFns__$w=[];const __vue_inject_styles__$x=function(e){e&&e("data-v-20a98ce1_0",{source:".label[data-v-20a98ce1]{text-align:right;margin-bottom:24px;padding-right:2px}",map:void 0,media:void 0})},__vue_scope_id__$x="data-v-20a98ce1",__vue_module_identifier__$x=void 0,__vue_is_functional_template__$x=!1,__vue_component__$x=normalizeComponent({render:__vue_render__$w,staticRenderFns:__vue_staticRenderFns__$w},__vue_inject_styles__$x,__vue_script__$x,"data-v-20a98ce1",false,undefined,!1,createInjector,void 0,void 0);var script$y=Vue.extend({name:"auto",mixins:[ExprMixin,questionFormMixin],components:{Row:Row,Col:Col,Select:Select,Option:Option,FormItem:FormItem,QuestionSelect:__vue_component__$w},methods:{generateExpr(){return`$count($[id in [${`${_$1.map(this.value.scope,(e=>'"'+e+'"'))}`}]][answer in [${`${_$1.map(this.value.values,(e=>'"'+e+'"'))}`}]]) = ${_$1.size(this.value.scope)}`}}});const __vue_script__$y=script$y;var __vue_render__$x=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Row",{attrs:{type:"flex",justify:"start",gutter:6,align:"middle"}},[i("Col",{staticClass:"label"},[e._v("\n    "+e._s(e.t("survey_creator.question.evaluation.condition.question"))+"\n  ")]),e._v(" "),i("Col",{attrs:{span:5}},[i("FormItem",{attrs:{prop:"evaluationItems["+e.itemIndex+"].conditions["+e.index+"].payload.scope",rules:{required:!0,type:"array",trigger:"change",min:1,message:e.t("survey_creator.question.notEmpty")}}},[i("question-select",{attrs:{question:e.question},model:{value:e.value.scope,callback:function(t){e.$set(e.value,"scope",t)},expression:"value.scope"}})],1)],1),e._v(" "),i("Col",{staticClass:"label"},[e._v("\n    "+e._s(e.t("survey_creator.question.evaluation.condition.question_result"))+"\n  ")]),e._v(" "),i("Col",{attrs:{span:8}},[i("FormItem",{attrs:{prop:"evaluationItems["+e.itemIndex+"].conditions["+e.index+"].payload.values",rules:{required:!0,type:"array",trigger:"change",min:1,message:e.t("survey_creator.question.notEmpty")}}},[i("Select",{attrs:{placeholder:e.t("survey_creator.question.evaluation.condition.choose_result"),"max-tag-count":1,multiple:""},model:{value:e.value.values,callback:function(t){e.$set(e.value,"values",t)},expression:"value.values"}},e._l(e.choices,(function(t,n){return i("Option",{key:n,attrs:{value:t}},[e._v("\n          "+e._s(t)+"\n        ")])})),1)],1)],1)],1)},__vue_staticRenderFns__$x=[];const __vue_inject_styles__$y=function(e){e&&e("data-v-77e16c1e_0",{source:".label[data-v-77e16c1e]{text-align:right;margin-bottom:24px}",map:void 0,media:void 0})},__vue_scope_id__$y="data-v-77e16c1e",__vue_module_identifier__$y=void 0,__vue_is_functional_template__$y=!1,__vue_component__$y=normalizeComponent({render:__vue_render__$x,staticRenderFns:__vue_staticRenderFns__$x},__vue_inject_styles__$y,__vue_script__$y,"data-v-77e16c1e",false,undefined,!1,createInjector,void 0,void 0);Vue.prototype.$Message=Message;var script$z=Vue.extend({name:"score",mixins:[ExprMixin,LocaleMixin],components:{Row:Row,Col:Col,Select:Select,Option:Option,FormItem:FormItem},data:()=>({operators:["<=","<"],leftScores:[],rightScores:[]}),created(){this.value.leftOperator=_$1.unescape(this.value.leftOperator),this.value.rightOperator=_$1.unescape(this.value.rightOperator),this.createInitScoresOption()},computed:{totalScore(){return this.$rootComponent.currentSurvey.statistics.maxScore},otherConditions(){let e=_$1.filter(_$1.map(this.evaluationItems,((e,t)=>_$1.extend({},e,{index:t}))),(e=>e.index!=this.itemIndex));const t=_$1.flatMap(e,(e=>_$1.get(e,"conditions",[])));return _$1.filter(t,(e=>"SCORE"==_$1.get(e,"type")))}},methods:{createInitScoresOption(){let e=_$1.map(this.otherConditions,(e=>({min:_$1.get(e,"payload.minScore",0),max:_$1.get(e,"payload.maxScore",0)})));this.leftScores=_$1.map(_$1.range(1,this.totalScore+1,1),(function(t){let i=_$1.some(e,(function(e){return t>=e.min&&t<=e.max}));return{value:t,label:t,disabled:i}})),this.rightScores=_$1.map(_$1.range(1,this.totalScore+1,1),(function(t){let i=_$1.some(e,(function(e){return t>=e.min&&t<=e.max}));return{value:t,label:t,disabled:i}}))},resetLeftScoreOptions(){this.resetScoreOptions(this.leftScores,"left")},resetRightScoreOptions(){this.resetScoreOptions(this.rightScores,"right")},getScoreOptions(e){return"left"===e?this.leftScores:this.rightScores},getScoreValue(e){return"left"===e?this.value.minScore:this.value.maxScore},getScoreSelectRef(e){return"left"===e?this.$refs.leftScoreSelect:this.$refs.rightScoreSelect},findAvailableScoreOptionByValue:(e,t)=>_$1.find(e,(e=>!e.disabled&&e.value===t)),findMatchedScoreOption(e,t){const i=String(null==t?"":t).trim(),n=_$1.filter(e,(e=>!e.disabled));return n.length?i?_$1.find(n,(e=>String(e.value)===i))||_$1.find(n,(e=>0===String(e.value).indexOf(i)))||null:n[0]:null},updateScoreSelectFocus(e,t,i=!1){const n=this.getScoreSelectRef(e);if(!n)return;const o=t;if(!o){if(!i)return void(n.focusIndex=-1);const t=_$1.find(this.getScoreOptions(e),(e=>!e.disabled));return t?this.updateScoreSelectFocus(e,t,!1):void(n.focusIndex=-1)}const s=_$1.findIndex(n.flatOptions,(e=>{const t=e&&e.componentOptions&&e.componentOptions.propsData;return t&&t.value===o.value}));if(-1!==s)n.focusIndex=s;else if(i){const t=_$1.find(this.getScoreOptions(e),(e=>!e.disabled)),i=o?o.value:null;t&&t.value!==i&&this.updateScoreSelectFocus(e,t,!1)}},handleScoreSelectOpenChange(e,t){if("left"===e?this.resetLeftScoreOptions():this.resetRightScoreOptions(),!t)return;const i=this.getScoreValue(e),n=this.findAvailableScoreOptionByValue(this.getScoreOptions(e),i);this.$nextTick((()=>{this.updateScoreSelectFocus(e,n,!0)}))},handleScoreQueryChange(e,t){const i=this.getScoreOptions(e),n=this.findMatchedScoreOption(i,t);this.$nextTick((()=>{this.updateScoreSelectFocus(e,n,!1)}))},resetScoreOptions(e,t){let i=_$1.map(this.otherConditions,(e=>({min:_$1.get(e,"payload.minScore",0),max:_$1.get(e,"payload.maxScore",0)}))),n=null==this.value.minScore?0:this.value.minScore,o=null==this.value.maxScore?this.totalScore:this.value.maxScore;_$1.forEach(e,(function(e){let s=_$1.some(i,(function(t){let i=e.value>=t.min&&e.value<=t.max,s=e.value>=n&&e.value<=o;return i&&s})),r=!1;"left"===t&&null!=o&&(r=e.value>o),"right"===t&&null!=n&&(r=e.value<n),e.disabled=s||r}))},generateExpr(){let e=this.value.minScore,t=this.value.maxScore;return`${e} ${this.value.leftOperator} score and score ${this.value.rightOperator} ${t}`},validateMinScore(e,t,i){null!=t&&""!==t?t<1?i(new Error(this.t("survey_creator.question.scoreRequiredTip"))):t>this.totalScore?i(new Error(`${this.t("survey_creator.question.scoreExceedTotalTip")} ${this.totalScore}`)):null!=this.value.maxScore&&t>this.value.maxScore?i(new Error(this.t("survey_creator.question.minScoreGreaterThanMaxTip"))):i():i(new Error(this.t("survey_creator.question.scoreRequiredTip")))},validateMaxScore(e,t,i){null!=t&&""!==t?t<1?i(new Error(this.t("survey_creator.question.scoreRequiredTip"))):t>this.totalScore?i(new Error(`${this.t("survey_creator.question.scoreExceedTotalTip")} ${this.totalScore}`)):null!=this.value.minScore&&t<this.value.minScore?i(new Error(this.t("survey_creator.question.maxScoreLessThanMinTip"))):i():i(new Error(this.t("survey_creator.question.scoreRequiredTip")))},handleMinScoreChange(e){null!=this.value.maxScore&&e>this.value.maxScore&&(this.value.maxScore=e),this.resetLeftScoreOptions(),this.resetRightScoreOptions()},handleMaxScoreChange(e){null!=this.value.minScore&&e<this.value.minScore&&(this.value.maxScore=this.value.minScore),this.resetLeftScoreOptions(),this.resetRightScoreOptions()}}});const __vue_script__$z=script$z;var __vue_render__$y=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Row",{attrs:{type:"flex",justify:"start",gutter:6,align:"middle"}},[i("Col",{staticClass:"label"},[e._v("\n    "+e._s(e.t("survey_creator.question.evaluation.condition.score_condition_title"))+"\n  ")]),e._v(" "),i("Col",{attrs:{span:4}},[i("FormItem",{attrs:{prop:"evaluationItems["+e.itemIndex+"].conditions["+e.index+"].payload.minScore",rules:[{required:!0,type:"number",trigger:"change",message:e.t("survey_creator.question.scoreRequiredTip")},{validator:e.validateMinScore,trigger:"change"}]}},[i("Select",{ref:"leftScoreSelect",attrs:{filterable:"",placeholder:e.t("survey_creator.question.selectScore")},on:{"on-open-change":function(t){return e.handleScoreSelectOpenChange("left",t)},"on-change":e.handleMinScoreChange,"on-query-change":function(t){return e.handleScoreQueryChange("left",t)}},model:{value:e.value.minScore,callback:function(t){e.$set(e.value,"minScore",t)},expression:"value.minScore"}},e._l(e.leftScores,(function(t){return i("Option",{key:t.value,attrs:{value:t.value,label:String(t.value),disabled:t.disabled}},[e._v("\n          "+e._s(t.value)+"\n        ")])})),1)],1)],1),e._v(" "),i("Col",{attrs:{span:3}},[i("FormItem",{attrs:{prop:"evaluationItems["+e.itemIndex+"].conditions["+e.index+"].payload.leftOperator",rules:{required:!0,trigger:"change",message:e.t("survey_creator.question.notEmpty")}}},[i("Select",{staticClass:"operator",attrs:{placeholder:e.t("survey_creator.question.evaluation.condition.operator")},model:{value:e.value.leftOperator,callback:function(t){e.$set(e.value,"leftOperator",t)},expression:"value.leftOperator"}},e._l(e.operators,(function(t,n){return i("Option",{key:n,attrs:{value:t}},[e._v("\n          "+e._s(t)+"\n        ")])})),1)],1)],1),e._v(" "),i("Col",{staticClass:"label"},[e._v("\n    "+e._s(e.t("survey_creator.question.totalScores"))+"\n  ")]),e._v(" "),i("Col",{attrs:{span:3}},[i("FormItem",{attrs:{prop:"evaluationItems["+e.itemIndex+"].conditions["+e.index+"].payload.rightOperator",rules:{required:!0,trigger:"change",message:e.t("survey_creator.question.notEmpty")}}},[i("Select",{staticClass:"operator",attrs:{placeholder:e.t("survey_creator.question.evaluation.condition.operator")},model:{value:e.value.rightOperator,callback:function(t){e.$set(e.value,"rightOperator",t)},expression:"value.rightOperator"}},e._l(e.operators,(function(t,n){return i("Option",{key:n,attrs:{value:t}},[e._v("\n          "+e._s(t)+"\n        ")])})),1)],1)],1),e._v(" "),i("Col",{attrs:{span:4}},[i("FormItem",{attrs:{prop:"evaluationItems["+e.itemIndex+"].conditions["+e.index+"].payload.maxScore",rules:[{required:!0,type:"number",trigger:"change",message:e.t("survey_creator.question.scoreRequiredTip")},{validator:e.validateMaxScore,trigger:"change"}]}},[i("Select",{ref:"rightScoreSelect",attrs:{filterable:"",placeholder:e.t("survey_creator.question.selectScore")},on:{"on-open-change":function(t){return e.handleScoreSelectOpenChange("right",t)},"on-change":e.handleMaxScoreChange,"on-query-change":function(t){return e.handleScoreQueryChange("right",t)}},model:{value:e.value.maxScore,callback:function(t){e.$set(e.value,"maxScore",t)},expression:"value.maxScore"}},e._l(e.rightScores,(function(t){return i("Option",{key:t.value,attrs:{value:t.value,label:String(t.value),disabled:t.disabled}},[e._v("\n          "+e._s(t.value)+"\n        ")])})),1)],1)],1)],1)},__vue_staticRenderFns__$y=[];const __vue_inject_styles__$z=function(e){e&&e("data-v-514fa778_0",{source:".label[data-v-514fa778]{text-align:right;margin-bottom:24px}[data-v-514fa778] .operator .ivu-select-selected-value{height:28px;line-height:28px}",map:void 0,media:void 0})},__vue_scope_id__$z="data-v-514fa778",__vue_module_identifier__$z=void 0,__vue_is_functional_template__$z=!1,__vue_component__$z=normalizeComponent({render:__vue_render__$y,staticRenderFns:__vue_staticRenderFns__$y},__vue_inject_styles__$z,__vue_script__$z,"data-v-514fa778",false,undefined,!1,createInjector,void 0,void 0);var script$A=Vue.extend({name:"condition",mixins:[questionFormMixin],components:{ASSIGN:__vue_component__$x,AUTO:__vue_component__$y,SCORE:__vue_component__$z},props:{type:{type:String,required:!0},value:{type:Object,required:!0},index:{type:Number,required:!0},evaluationItems:{type:Array,required:!0},itemIndex:{type:Number,required:!0}},data:()=>({exprConditionType:"AUTO",exprConditionTypes:["AUTO","ASSIGN","SCORE"]}),methods:{expr(e){this.$emit("expr",this.index,e)}}});const __vue_script__$A=script$A;var __vue_render__$z=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.type,{tag:"component",attrs:{question:e.question,"evaluation-items":e.evaluationItems,"item-index":e.itemIndex,index:e.index},on:{expr:e.expr},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})},__vue_staticRenderFns__$z=[];const __vue_inject_styles__$A=void 0,__vue_scope_id__$A=void 0,__vue_module_identifier__$A=void 0,__vue_is_functional_template__$A=!1,__vue_component__$A=normalizeComponent({render:__vue_render__$z,staticRenderFns:__vue_staticRenderFns__$z},undefined,__vue_script__$A,undefined,false,undefined,!1,void 0,void 0,void 0);var script$B=Vue.extend({name:"if",mixins:[questionFormMixin],components:{Card:Card,Row:Row,Col:Col,Select:Select,Option:Option,Button:Button,Icon:Icon,Condition:__vue_component__$A,FormItem:FormItem,Input:Input$1},props:{value:{type:Array,required:!0},position:{type:Number,required:!0}},data(){return{evaluationItems:this.value,exprConditionType:"AUTO",exprConditionTypes:["AUTO","ASSIGN","SCORE"]}},computed:{totalScore(){return this.$rootComponent.currentSurvey.statistics.maxScore},deletable(){return _$1.size(_$1.filter(this.evaluationItems,(e=>"IF"==e.type)))>1},disableAddConditionBtn(){let e=this.evaluationItems[this.position].conditions,t=_$1.size(_$1.filter(e,(e=>"SCORE"==e.type)));return"SCORE"==this.exprConditionType&&t>0}},methods:{onAdd(){this.evaluationItems.splice(this.position+1,0,{id:`Evaluation-Item-${_$1.now()}-${_$1.random(0,9999999)}`,type:"IF",text:{"zh-CN":""},conditions:[]})},onDelete(){this.evaluationItems.splice(this.position,1)},addCondition(){this.evaluationItems[this.position].conditions||this.$set(this.evaluationItems[this.position],"conditions",[]),this.evaluationItems[this.position].conditions.push({type:this.exprConditionType,payload:this.buildPayloadByType(this.exprConditionType)})},buildPayloadByType:e=>"SCORE"==e?{minScore:null,leftOperator:"<",rightOperator:"<",maxScore:null}:{scope:[],operator:"=",values:[],size:0},removeCondition(e){this.evaluationItems[this.position].conditions.splice(e,1)},expr(e,t){_$1.set(this.evaluationItems[this.position].conditions[e],"expr",t)}}});const __vue_script__$B=script$B;var __vue_render__$A=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Card",{attrs:{"dis-hover":""}},[i("Row",{attrs:{slot:"title",type:"flex",gutter:6},slot:"title"},[i("Col",[i("div",{staticClass:"text"},[e._v("\n        "+e._s(e.t("survey_creator.question.evaluation.condition.if"))+"\n      ")])]),e._v(" "),i("Col",[i("Button",{attrs:{type:"primary",icon:"md-add"},on:{click:e.onAdd}},[e._v("\n        "+e._s(e.t("survey_creator.question.evaluation.condition.add_if_template"))+"\n      ")])],1)],1),e._v(" "),i("a",{directives:[{name:"show",rawName:"v-show",value:e.deletable,expression:"deletable"}],attrs:{slot:"extra",href:"#"},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}},slot:"extra"},[e._v("\n    "+e._s(e.t("survey_creator.common.delete"))+"\n  ")]),e._v(" "),i("Row",{attrs:{type:"flex",justify:"start",align:"middle"}},[i("Col",{attrs:{span:22}},[i("Row",{attrs:{type:"flex",justify:"start",align:"middle"}},[i("Col",{staticClass:"label"},[i("Icon",{attrs:{type:"ios-arrow-forward",color:"#2d8cf0"}}),e._v("\n          "+e._s(e.t("survey_creator.question.evaluation.condition.requirements"))+"\n        ")],1),e._v(" "),i("Col",{attrs:{span:16}},[i("Select",{model:{value:e.exprConditionType,callback:function(t){e.exprConditionType=t},expression:"exprConditionType"}},e._l(e.exprConditionTypes,(function(t){return i("Option",{key:t,attrs:{value:t}},[e._v("\n              "+e._s(e.t("survey_creator.question.evaluation.condition.type."+t))+"\n            ")])})),1)],1)],1)],1),e._v(" "),i("Col",{attrs:{span:2}},[i("Button",{staticClass:"action",attrs:{icon:"md-add",disabled:e.disableAddConditionBtn},on:{click:e.addCondition}})],1)],1),e._v(" "),e._l(e.evaluationItems[e.position].conditions,(function(t,n){return i("Row",{key:n,staticClass:"mt-base",attrs:{type:"flex",justify:"space-between",align:"middle"}},[i("Col",{attrs:{span:22}},[i("condition",{key:n,attrs:{index:n,type:t.type,question:e.question,"evaluation-items":e.evaluationItems,"item-index":e.position},on:{expr:e.expr},model:{value:t.payload,callback:function(i){e.$set(t,"payload",i)},expression:"condition.payload"}})],1),e._v(" "),i("Col",{attrs:{span:2}},[i("Button",{staticClass:"action",staticStyle:{"margin-bottom":"24px"},attrs:{icon:"md-remove"},on:{click:function(t){return e.removeCondition(n)}}})],1)],1)})),e._v(" "),i("Row",{staticClass:"mt-base",attrs:{type:"flex",justify:"end",align:"middle"}},[i("Col",[i("FormItem",{attrs:{prop:"evaluationItems["+e.position+"].text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.evaluation.condition.evaluation_require_tip")}}},[e._v(e._s(e.t("survey_creator.question.evaluation.condition.evaluation_label"))+"\n        "),i("Input",{staticClass:"input",model:{value:e.evaluationItems[e.position].text[e.primaryLanguage],callback:function(t){e.$set(e.evaluationItems[e.position].text,e.primaryLanguage,"string"==typeof t?t.trim():t)},expression:"evaluationItems[position].text[primaryLanguage]"}})],1)],1)],1)],2)},__vue_staticRenderFns__$A=[];const __vue_inject_styles__$B=function(e){e&&e("data-v-5c402eff_0",{source:".mt-base[data-v-5c402eff]{margin-top:12px}.action[data-v-5c402eff]{float:right}.input[data-v-5c402eff]{width:100px}.label[data-v-5c402eff]{text-align:right;padding-right:4px}.text[data-v-5c402eff]{background-color:#ebf7ff;height:32px;padding:8px 18px;font-weight:500;color:#515a6e}[data-v-5c402eff] .ivu-card .ivu-form-item{margin-bottom:4px;margin-top:0}[data-v-5c402eff] .ivu-card .ivu-form-item-error{margin-bottom:24px;margin-top:0}",map:void 0,media:void 0})},__vue_scope_id__$B="data-v-5c402eff",__vue_module_identifier__$B=void 0,__vue_is_functional_template__$B=!1,__vue_component__$B=normalizeComponent({render:__vue_render__$A,staticRenderFns:__vue_staticRenderFns__$A},__vue_inject_styles__$B,__vue_script__$B,"data-v-5c402eff",false,undefined,!1,createInjector,void 0,void 0);var script$C=Vue.extend({name:"else",mixins:[questionFormMixin],components:{Card:Card,Row:Row,Col:Col,FormItem:FormItem,Input:Input$1},props:{value:{type:Array,required:!0},position:{type:Number,required:!0}},data(){return{evaluationItems:this.value}},created(){this.evaluationItems[this.position].conditions=[{expr:"true"}]}});const __vue_script__$C=script$C;var __vue_render__$B=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Card",{staticClass:"mt-base",attrs:{"dis-hover":""}},[i("Row",{attrs:{type:"flex",justify:"space-between",align:"middle"}},[i("Col",[i("div",{staticClass:"text"},[e._v("\n        "+e._s(e.t("survey_creator.question.evaluation.condition.else"))+"\n      ")])]),e._v(" "),i("Col",[i("FormItem",{attrs:{prop:"evaluationItems["+e.position+"].text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.evaluation.condition.evaluation_require_tip")}}},[e._v("\n        "+e._s(e.t("survey_creator.question.evaluation.condition.evaluation_label"))+"\n        "),i("Input",{staticClass:"input",model:{value:e.evaluationItems[e.position].text[e.primaryLanguage],callback:function(t){e.$set(e.evaluationItems[e.position].text,e.primaryLanguage,"string"==typeof t?t.trim():t)},expression:"evaluationItems[position].text[primaryLanguage]"}})],1)],1)],1)],1)},__vue_staticRenderFns__$B=[];const __vue_inject_styles__$C=function(e){e&&e("data-v-41186555_0",{source:".mt-base[data-v-41186555]{margin-top:12px}.action[data-v-41186555]{float:right}.input[data-v-41186555]{width:100px}.text[data-v-41186555]{background-color:#ebf7ff;height:32px;padding:4px 18px;font-weight:500;color:#515a6e}[data-v-41186555] .ivu-card .ivu-form-item{margin-bottom:4px;margin-top:0}[data-v-41186555] .ivu-card .ivu-form-item-error{margin-bottom:24px;margin-top:0}",map:void 0,media:void 0})},__vue_scope_id__$C="data-v-41186555",__vue_module_identifier__$C=void 0,__vue_is_functional_template__$C=!1,__vue_component__$C=normalizeComponent({render:__vue_render__$B,staticRenderFns:__vue_staticRenderFns__$B},__vue_inject_styles__$C,__vue_script__$C,"data-v-41186555",false,undefined,!1,createInjector,void 0,void 0);var script$D=Vue.extend({name:"expr",mixins:[questionFormMixin],components:{IF:__vue_component__$B,ELSE:__vue_component__$C},props:{value:{type:Array,required:!0}}});const __vue_script__$D=script$D;var __vue_render__$C=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",e._l(e.value,(function(t,n){return i(t.type,{key:n,tag:"component",staticClass:"mt-base",attrs:{position:n,question:e.question},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})})),1)},__vue_staticRenderFns__$C=[];const __vue_inject_styles__$D=function(e){e&&e("data-v-8c9afff8_0",{source:"[data-v-8c9afff8] .ivu-card-head{padding:7px 8px}[data-v-8c9afff8] .ivu-card-body{padding:8px}",map:void 0,media:void 0})},__vue_scope_id__$D="data-v-8c9afff8",__vue_module_identifier__$D=void 0,__vue_is_functional_template__$D=!1,__vue_component__$D=normalizeComponent({render:__vue_render__$C,staticRenderFns:__vue_staticRenderFns__$C},__vue_inject_styles__$D,__vue_script__$D,"data-v-8c9afff8",false,undefined,!1,createInjector,void 0,void 0);var script$E=Vue.extend({name:"evaluation-form",components:{Form:Form,FormItem:FormItem,Row:Row,Col:Col,draggable:draggable,Option:Option,Select:Select,Checkbox:Checkbox,Input:Input$1,STAR:__vue_component__$v,EXPR:__vue_component__$D},mixins:[questionFormMixin],data:()=>({labelWidth:80,layoutOptions:["HORIZONTAL","VERTICAL"],evaluationTypes:["STAR","EXPR"],realColumns:[]}),created(){this.initData()},methods:{initData(){this.editQuestion.evaluationItems||this.$set(this.editQuestion,"evaluationItems",[]),this.editQuestion.options.evaluationType||this.$set(this.editQuestion.options,"evaluationType","STAR")},onChange(e){"EXPR"==e&&(_$1.forEach(this.editQuestion.evaluationItems,((e,t)=>{_$1.set(e,"type","IF")})),_$1.set(this.editQuestion.evaluationItems[_$1.size(this.editQuestion.evaluationItems)-1],"type","ELSE"))}}});const __vue_script__$E=script$E;var __vue_render__$D=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Form",{ref:"questionForm",attrs:{model:e.editQuestion,"label-colon":!1}},[i("Row",[i("Form-item",{attrs:{prop:"header.text."+e.primaryLanguage,rules:{required:!0,message:e.t("survey_creator.question.titleRequiredTip")},label:e.t("survey_creator.page.question")}},[i("Checkbox",{model:{value:e.editQuestion.options.required,callback:function(t){e.$set(e.editQuestion.options,"required",t)},expression:"editQuestion.options.required"}},[e._v(e._s(e.t("survey_creator.question.questionRequired"))+"\n      ")]),e._v(" "),i("Row",[i("Col",{attrs:{span:23,offset:-1}},[i("Input",{attrs:{placeholder:e.t("survey_creator.question.titleRequiredTip")},model:{value:e.editQuestion.header.text[e.primaryLanguage],callback:function(t){e.$set(e.editQuestion.header.text,e.primaryLanguage,"string"==typeof t?t.trim():t)},expression:"editQuestion.header.text[primaryLanguage]"}})],1)],1)],1)],1),e._v(" "),i("Row",[i("Form-item",{attrs:{label:e.t("survey_creator.question.evaluation.selectedType"),"label-width":e.labelWidth}},[i("Select",{staticStyle:{width:"200px"},on:{"on-change":e.onChange},model:{value:e.editQuestion.options.evaluationType,callback:function(t){e.$set(e.editQuestion.options,"evaluationType",t)},expression:"editQuestion.options.evaluationType"}},e._l(e.evaluationTypes,(function(t){return i("Option",{key:t,attrs:{value:t}},[e._v(e._s(e.t("survey_creator.question.evaluation.type."+t))+"\n        ")])})),1)],1)],1),e._v(" "),i(e.editQuestion.options.evaluationType,{tag:"component",attrs:{question:e.question},model:{value:e.editQuestion.evaluationItems,callback:function(t){e.$set(e.editQuestion,"evaluationItems",t)},expression:"editQuestion.evaluationItems"}})],1)},__vue_staticRenderFns__$D=[];const __vue_inject_styles__$E=function(e){e&&e("data-v-2a3b164a_0",{source:"[data-v-2a3b164a] .ivu-table-cell-slot .ivu-form-item{margin-bottom:4px;margin-top:0}[data-v-2a3b164a] .ivu-table-cell-slot .ivu-form-item-error{margin-bottom:24px;margin-top:0}[data-v-2a3b164a] .ivu-form-item{width:100%}",map:void 0,media:void 0})},__vue_scope_id__$E="data-v-2a3b164a",__vue_module_identifier__$E=void 0,__vue_is_functional_template__$E=!1,__vue_component__$E=normalizeComponent({render:__vue_render__$D,staticRenderFns:__vue_staticRenderFns__$D},__vue_inject_styles__$E,__vue_script__$E,"data-v-2a3b164a",false,undefined,!1,createInjector,void 0,void 0),QUESTION_OPERATION_TYPE_COPY="copy";var script$F=Vue.extend({name:"question-edit-drawer",components:{Drawer:Drawer,ButtonGroup:ButtonGroup,Button:Button,Card:Card,SINGLE_SELECTION:__vue_component__$p,MULTI_SELECTION:__vue_component__$q,SHORT_ANSWER:__vue_component__$r,FILL_BLANK:__vue_component__$r,MATRIX:__vue_component__$s,SCORING:__vue_component__$t,TEXT_TITLE:__vue_component__$u,EVALUATION:__vue_component__$E},inject:["$rootComponent"],mixins:[LocaleMixin],props:{visible:{type:Boolean,required:!0},question:{type:Object,required:!1},operationType:{type:String,default:"edit"}},model:{prop:"visible",event:"input"},watch:{visible(e){this.visibleDrawer=e},visibleDrawer(e){this.$emit("input",e),e?this.$emit("on-open",e):this.$emit("on-close",e)}},data(){return{visibleDrawer:this.visible,styles:{height:"calc(100% - 85px)",overflow:"auto",position:"static"}}},computed:{isCopy(){return"copy"==this.operationType},questionType(){return _$1.get(this.question,"type")}},methods:{closeDrawer(){this.visibleDrawer=!1},saveQuestion(){const e=this,t=this.$refs.questionComponent;t.$refs.questionForm.validate((i=>{i&&(e.$rootComponent.onQuestionCreateOrUpdate(t.editQuestion,this.operationType),e.closeDrawer())}))},cancel(){this.closeDrawer()}}});const __vue_script__$F=script$F;var __vue_render__$E=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Drawer",{attrs:{styles:e.styles,width:50,closable:!0,"mask-closable":!1},model:{value:e.visibleDrawer,callback:function(t){e.visibleDrawer=t},expression:"visibleDrawer"}},[i("ButtonGroup",{attrs:{slot:"header",shape:"circle"},slot:"header"},[e._m(0),e._v(" "),i("Button",[e._v(e._s(e.t("survey_creator.question.types."+e.questionType)))])],1),e._v(" "),e.visibleDrawer&&e.question?i(e.questionType,{ref:"questionComponent",tag:"component",staticClass:"question-form",attrs:{question:e.question}}):e._e(),e._v(" "),i("div",{staticClass:"drawer-footer"},[i("Button",{attrs:{type:"primary"},on:{click:e.saveQuestion}},[e.isCopy?i("span",[e._v(e._s(e.t("survey_creator.common.copy")))]):i("span",[e._v(e._s(e.t("survey_creator.common.save")))])]),e._v(" "),i("Button",{on:{click:e.cancel}},[e._v(e._s(e.t("survey_creator.common.cancel")))])],1)],1)},__vue_staticRenderFns__$E=[function(){var e=this,t=e.$createElement;return(e._self._c||t)("Button",{attrs:{type:"primary"}},[e._v(e._s(e.t("survey_creator.question.type")))])}];const __vue_inject_styles__$F=function(e){e&&e("data-v-922d9c30_0",{source:".drawer-footer{width:100%;position:absolute;bottom:0;left:0;border-top:1px solid #e8e8e8;padding:10px 16px;text-align:right;background:#fff;z-index:99}.question-form{margin-bottom:53px}",map:void 0,media:void 0})},__vue_scope_id__$F=void 0,__vue_module_identifier__$F=void 0,__vue_is_functional_template__$F=!1,__vue_component__$F=normalizeComponent({render:__vue_render__$E,staticRenderFns:__vue_staticRenderFns__$E},__vue_inject_styles__$F,__vue_script__$F,undefined,false,undefined,!1,createInjector,void 0,void 0);var script$G=Vue.extend({name:"translation-table",components:{Input:Input$1,Table:Table$1},props:["value","languages","primaryLanguage"],mixins:[LocaleMixin,SurveyTranslatorMixin],inject:["$rootComponent"],computed:{data(){return this.value},camelLanguages(){return _$1.map(this.languages,(e=>_$1.camelCase(e)))},columns(){let e=[{title:this.t("survey_creator.translator.table.header_type"),slot:"type",tree:!0},{title:this.t(`survey_creator.translator.table.header_${_$1.camelCase(this.primaryLanguage)}`)+this.t("survey_creator.translator.table.header_primary_name"),slot:"primaryLanguage"}];return _$1.forEach(_$1.map(this.languages,(e=>_$1.camelCase(e))),(t=>{e.push({title:this.t(`survey_creator.translator.table.header_${t}`),slot:t})})),e}},methods:{onChange(e){_$1.merge(this.buildDataMap(this.data)[e.tempId],e)}}});const __vue_script__$G=script$G;var __vue_render__$F=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Table",{staticClass:"survey-translation-table",attrs:{columns:e.columns,data:e.data,"row-key":"tempId",stripe:""},scopedSlots:e._u([{key:"type",fn:function(t){var n=t.row;return[n.type==e.SUB_QUESTION_TYPE?i("span",{staticClass:"ml-base"},[e._v(e._s(e.t("survey_creator.question.sub_questions")))]):n.type?i("span",[e._v(e._s(e.t("survey_creator.question.types."+n.type)))]):i("span",{staticClass:"ml-base"},[e._v(e._s(e.t("survey_creator.question.optional")))])]}},{key:"primaryLanguage",fn:function(t){var n=t.row;return[n.number?i("span",[e._v(e._s(n.number)+".\n      "+e._s(e._f("translate")(n.text,e.primaryLanguage,!0)))]):i("span",[e._v(e._s(e._f("translate")(n.text,e.primaryLanguage,!0)))])]}},e._l(e.camelLanguages,(function(t){return{key:t,fn:function(n){var o=n.row;return[i("Input",{key:t,attrs:{autosize:{minRows:2,maxRows:2},type:"textarea"},on:{"on-change":function(t){return e.onChange(o)}},model:{value:o.text[t],callback:function(i){e.$set(o.text,t,i)},expression:"row.text[language]"}})]}}}))],null,!0)})},__vue_staticRenderFns__$F=[];const __vue_inject_styles__$G=function(e){e&&e("data-v-5004272c_0",{source:".survey-translation-table[data-v-5004272c] .ivu-icon{font-size:14px}.survey-translation-table[data-v-5004272c] .ivu-table-cell-slot{display:inline}",map:void 0,media:void 0})},__vue_scope_id__$G="data-v-5004272c",__vue_module_identifier__$G=void 0,__vue_is_functional_template__$G=!1,__vue_component__$G=normalizeComponent({render:__vue_render__$F,staticRenderFns:__vue_staticRenderFns__$F},__vue_inject_styles__$G,__vue_script__$G,"data-v-5004272c",false,undefined,!1,createInjector,void 0,void 0);var script$H=Vue.extend({name:"survey-translator",components:{TranslationTable:__vue_component__$G},mixins:[LocaleMixin,SurveyTranslatorMixin],props:{survey:{type:Object,required:!0}},data:()=>({primaryLanguage:null,languages:[],data:[],columns:[]}),created(){this.primaryLanguage=this.getPrimaryLanguage(this.survey),this.languages=this.getLanguagesExcludedPrimaryLanguage(this.survey),this.buildData()},watch:{data:{handler(e,t){this.merge(e)},deep:!0}},methods:{buildData(){let e=_$1.cloneDeep(this.survey);_$1.forEach(e.questions,(e=>{let t=e.header;t.tempId=this.buildQuestionId(e),t.type=e.type,t.children=[],t._showChildren=!0,_$1.forEach(e.choices,(i=>{t.children.push(i),i.tempId=this.buildChoiceId(e,i),t.children.type=""})),e.subQuestions&&_$1.forEach(e.subQuestions,(i=>{i.type=this.SUB_QUESTION_TYPE,i.tempId=this.buildSubQuestionId(e,i),t.children.push(i)})),this.data.push(t)}))},merge(e){let t=this.buildDataMap(e);_$1.forEach(this.survey.questions,(e=>{e.header.text=t[this.buildQuestionId(e)].text,_$1.forEach(e.choices,(i=>{i.text=t[this.buildChoiceId(e,i)].text})),e.subQuestions&&_$1.forEach(e.subQuestions,(i=>{i.text=t[this.buildSubQuestionId(e,i)].text}))})),console.log(this.survey)}}}),__$_require_images_empty_box_copy_svg__="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAiIGhlaWdodD0iMjAwIiB2aWV3Qm94PSIwIDAgMjUwIDIwMCI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDYwLjUxNSA4My4wMykiPgogICAgICAgICAgICA8cGF0aCBzdHJva2U9IiMxODkwRkYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIzIiBkPSJNMTE4IDEwNkgxMmMtNi42MjcgMC0xMi01LjM3Mi0xMi0xMlYyNGgxMzB2NzBjMCA2LjYyOC01LjM3MiAxMi0xMiAxMnpNMTMwIDI0SDBMMTUgMGgxMDB6Ii8+CiAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iIzE4OTBGRiIgc3Ryb2tlLXdpZHRoPSIzIiBkPSJNMTUuMTAyIDB2MjQiLz4KICAgICAgICAgICAgPGVsbGlwc2UgY3g9IjExMyIgY3k9Ijc5LjUiIGZpbGw9IiNGRjU1QUIiIGZpbGwtb3BhY2l0eT0iLjEiIHJ4PSIxMSIgcnk9IjUuNSIvPgogICAgICAgICAgICA8cGF0aCBzdHJva2U9IiMxODkwRkYiIHN0cm9rZS13aWR0aD0iMyIgZD0iTTExNC43OTMgMHYyNCIvPgogICAgICAgICAgICA8cGF0aCBmaWxsPSIjMTg5MEZGIiBkPSJNMTAyLjIyMiA2OS4wNWwtMy41MzYtMy41MzVhMiAyIDAgMCAxIDIuODI5LTIuODI5bDMuNTM1IDMuNTM2IDMuNTM1LTMuNTM2YTIgMiAwIDAgMSAyLjgzIDIuODNsLTMuNTM2IDMuNTM0IDMuNTM1IDMuNTM2YTIgMiAwIDEgMS0yLjgyOCAyLjgyOGwtMy41MzYtMy41MzUtMy41MzUgMy41MzVhMiAyIDAgMSAxLTIuODI5LTIuODI4bDMuNTM2LTMuNTM2eiIvPgogICAgICAgICAgICA8ZWxsaXBzZSBjeD0iMTciIGN5PSI3OS41IiBmaWxsPSIjRkY1NUFCIiBmaWxsLW9wYWNpdHk9Ii4xIiByeD0iMTEiIHJ5PSI1LjUiLz4KICAgICAgICAgICAgPHBhdGggZmlsbD0iIzE4OTBGRiIgZD0iTTIyLjEyMSA2OS4wNWwtMy41MzUtMy41MzVhMiAyIDAgMCAxIDIuODI5LTIuODI5bDMuNTM1IDMuNTM2IDMuNTM1LTMuNTM2YTIgMiAwIDAgMSAyLjgyOSAyLjgzbC0zLjUzNiAzLjUzNCAzLjUzNiAzLjUzNmEyIDIgMCAxIDEtMi44MjkgMi44MjhMMjQuOTUgNzEuODhsLTMuNTM2IDMuNTM1YTIgMiAwIDEgMS0yLjgyOC0yLjgyOGwzLjUzNS0zLjUzNnoiLz4KICAgICAgICAgICAgPHBhdGggc3Ryb2tlPSIjMTg5MEZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iNCIgZD0iTTczLjUgOTJjLTEuNzYtMi41NzUtNC45MDQtNC4yOTMtOC41LTQuMjkzLTMuNTk1IDAtNi43NCAxLjcxOC04LjUgNC4yOTMiLz4KICAgICAgICA8L2c+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjMTg5MEZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMi44NDIiIGQ9Ik0xNTYuOTE0IDM0LjA5M2EzIDMgMCAwIDEtMy0zdi0xMmEzIDMgMCAwIDEgNiAwdjEyYTMgMyAwIDAgMS0zIDN6TTE2NS40MTQgMTguMDkzYTYuNSA2LjUgMCAxIDEgMCAxMyA2LjQ5IDYuNDkgMCAwIDEtNS41LTMuMDQ3VjIxLjE0YTYuNDkgNi40OSAwIDAgMSA1LjUtMy4wNDd6TTE0OC40MTQgMTguMDkzYTYuNSA2LjUgMCAxIDAgMCAxMyA2LjQ5IDYuNDkgMCAwIDAgNS41LTMuMDQ3VjIxLjE0YTYuNDkgNi40OSAwIDAgMC01LjUtMy4wNDd6Ii8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjMTg5MEZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik0xNTMuMzQgMTMuMTFsMiAzLjQ2MyIvPgogICAgICAgIDxwYXRoIGZpbGw9IiMxODkwRkYiIGQ9Ik0xNTEuNjkgMTMuMjVhMS41IDEuNSAwIDEgMCAyLjU5OC0xLjUwMSAxLjUgMS41IDAgMCAwLTIuNTk4IDEuNTAxIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjMTg5MEZGIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik0xNjAuNDg5IDEzLjExbC0yIDMuNDYzIi8+CiAgICAgICAgPHBhdGggZmlsbD0iIzE4OTBGRiIgZD0iTTE2Mi4xMzkgMTMuMjVhMS41IDEuNSAwIDEgMS0yLjU5OC0xLjUgMS41IDEuNSAwIDAgMSAyLjU5OCAxLjUiLz4KICAgICAgICA8ZyBzdHJva2U9IiMxODkwRkYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIj4KICAgICAgICAgICAgPHBhdGggZD0iTTE1Ni45MTQgNDAuMzkxdjEiLz4KICAgICAgICAgICAgPHBhdGggc3Ryb2tlLWRhc2hhcnJheT0iMi4wNjksNC4xMzgiIGQ9Ik0xNTYuOTE0IDQ1LjUzVjY1LjQ2YTkuOTU5IDkuOTU5IDAgMCAxLTIuNDA3IDYuNTA4Yy0zLjIyOSAzLjc2NC0xMi45NyA0LjIyNy0xNi45NDMgMS4yNThhNS40NzIgNS40NzIgMCAwIDEtLjU5LS41MDcgNy4wMDEgNy4wMDEgMCAwIDEtMS42MzctNy4zMjgiLz4KICAgICAgICAgICAgPHBhdGggZD0iTTEzNi4zMTggNjMuNTc2YTcuMTQ2IDcuMTQ2IDAgMCAxIDEuNDExLTEuNDEyIi8+CiAgICAgICAgICAgIDxwYXRoIHN0cm9rZS1kYXNoYXJyYXk9IjIuMDU2LDQuMTEyIiBkPSJNMTQxLjU0MSA2MC43OGE2Ljk4NCA2Ljk4NCAwIDAgMSA1LjMzMiAyLjA0YzEuNjAxIDEuNjAyIDIuMzkgMy41ODMgMi42NDYgNS40NTlsLjA5NS45Mjl2Ny4xNTJjMCAxMS43NTktOC43NiAyMS40NzItMjAuMTEgMjIuOTY5Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMjcuNDQ2IDk5LjUwN2MtLjMzMS4wMTQtLjY2NS4wMjEtMSAuMDIxIi8+CiAgICAgICAgPC9nPgogICAgICAgIDxwYXRoIGZpbGw9IiMxODkwRkYiIGQ9Ik0xNi4zNTQgODMuNDMxbC0xLjA2LTEuMDZhLjk5OS45OTkgMCAxIDEgMS40MTMtMS40MTRsMS4wNjEgMS4wNiAxLjA2MS0xLjA2YTEgMSAwIDAgMSAxLjQxNCAxLjQxNGwtMS4wNiAxLjA2IDEuMDYgMS4wNjJhLjk5OS45OTkgMCAxIDEtMS40MTQgMS40MTRsLTEuMDYtMS4wNjItMS4wNjIgMS4wNjJhLjk5OS45OTkgMCAxIDEtMS40MTQtMS40MTRsMS4wNjEtMS4wNjJ6TTE3Ni4yNjggNjMuNzk5bC0xLjA2LTEuMDYxYS45OTkuOTk5IDAgMSAxIDEuNDEzLTEuNDE0bDEuMDYxIDEuMDYgMS4wNjEtMS4wNmExIDEgMCAwIDEgMS40MTQgMS40MTRsLTEuMDYgMS4wNiAxLjA2IDEuMDYyYS45OTkuOTk5IDAgMSAxLTEuNDE0IDEuNDE0bC0xLjA2LTEuMDYxLTEuMDYyIDEuMDZhLjk5OS45OTkgMCAxIDEtMS40MTQtMS40MTNsMS4wNjEtMS4wNjF6Ii8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjMTg5MEZGIiBzdHJva2Utd2lkdGg9IjIiIGQ9Ik0zOS4xOTQgMTA2LjQzMmEzLjUgMy41IDAgMSAxLTcgMCAzLjUgMy41IDAgMSAxIDcgMHoiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjMTg5MEZGIiBkPSJNMjIuNDUzIDY0LjY1MmExLjUgMS41IDAgMSAxLTMgMCAxLjUgMS41IDAgMCAxIDMgMCIvPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzE4OTBGRiIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMTk1LjUwNCA0My42NTRhMy41IDMuNSAwIDEgMS02Ljk5OS4wMDEgMy41IDMuNSAwIDAgMSA3LS4wMDF6Ii8+CiAgICAgICAgPHBhdGggZmlsbD0iIzE4OTBGRiIgZD0iTTIwNy45MDcgMTEzLjQzMmExLjUgMS41IDAgMSAxLTMuMDAyLS4wMDEgMS41IDEuNSAwIDAgMSAzLjAwMi4wMDFNMjMxLjMyIDg5LjI5bC0xLjA2Mi0xLjA2MWExIDEgMCAwIDEgMS40MTUtMS40MTRsMS4wNiAxLjA2IDEuMDYxLTEuMDZhMSAxIDAgMCAxIDEuNDE0IDEuNDE0bC0xLjA2IDEuMDYgMS4wNiAxLjA2MmEuOTk5Ljk5OSAwIDEgMS0xLjQxNCAxLjQxNGwtMS4wNi0xLjA2LTEuMDYxIDEuMDZhMSAxIDAgMSAxLTEuNDE1LTEuNDE0bDEuMDYxLTEuMDYxek05My4xNDUgNjcuNTQyYTEuNSAxLjUgMCAxIDEtMyAwIDEuNSAxLjUgMCAwIDEgMyAwTTYxLjUxNSA3NC43MjNhMS41IDEuNSAwIDEgMS0yLjk5OS4wMDIgMS41IDEuNSAwIDAgMSAyLjk5OS0uMDAyIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjMTg5MEZGIiBzdHJva2Utd2lkdGg9IjIiIGQ9Ik03OC4wMTUgNDguNTMxYTMuNSAzLjUgMCAxIDEtNyAwIDMuNSAzLjUgMCAwIDEgNyAweiIvPgogICAgICAgIDxwYXRoIGZpbGw9IiMxODkwRkYiIGQ9Ik0yMDAuOTA3IDgyLjQzMWExLjUgMS41IDAgMSAxLTMgMCAxLjUgMS41IDAgMCAxIDMgMCIvPgogICAgPC9nPgo8L3N2Zz4K";const __vue_script__$H=script$H;var __vue_render__$G=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e.languages.length>0?i("translation-table",{attrs:{columns:e.columns,languages:e.languages,"primary-language":e.primaryLanguage},model:{value:e.data,callback:function(t){e.data=t},expression:"data"}}):i("div",{staticClass:"fill-width no-data"},[i("Row",[i("img",{staticClass:"empty_box-copy",attrs:{src:__$_require_images_empty_box_copy_svg__}})]),e._v(" "),i("Row",[i("span",{staticClass:"no-data-span"},[e._v(e._s(e.t("survey_creator.message.noSettingLocale")))])])],1)],1)},__vue_staticRenderFns__$G=[];const __vue_inject_styles__$H=function(e){e&&e("data-v-ad0a606c_0",{source:".fill-width[data-v-ad0a606c]{width:100%;text-align:center}.no-data .no-data-span[data-v-ad0a606c]{font-size:24px}.no-data .prompt-text[data-v-ad0a606c]{font-size:16px}.mt[data-v-ad0a606c]{margin-top:16px}",map:void 0,media:void 0})},__vue_scope_id__$H="data-v-ad0a606c",__vue_module_identifier__$H=void 0,__vue_is_functional_template__$H=!1,__vue_component__$H=normalizeComponent({render:__vue_render__$G,staticRenderFns:__vue_staticRenderFns__$G},__vue_inject_styles__$H,__vue_script__$H,"data-v-ad0a606c",false,undefined,!1,createInjector,void 0,void 0);var arrowUpSvg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzYyMzNfMjQxNjgpIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjc1NjIxNCA3LjUxMTI1QzEuMDQ4NzcgNy44MDM1OSAxLjUyMjc4IDcuODAzNTkgMS44MTQ5IDcuNTExMjVMNy4wMTg0OCAyLjMwNzY3TDEyLjIyMTggNy41MTEyNUMxMi41MTQyIDcuODAzNTkgMTIuOTg4MiA3LjgwMzU5IDEzLjI4MDcgNy41MTEyNUMxMy41NzMxIDcuMjE4NjkgMTMuNTczMSA2Ljc0NDY4IDEzLjI4MDcgNi40NTIzNEw3LjU0ODYzIDAuNzIwMjAyQzcuNDAxNzcgMC41NzMxMzggNy4yMTAwMSAwLjUwMDExIDcuMDE4NDggMC41MDAxMUM2LjgyNjczIDAuNTAwMTEgNi42MzUyIDAuNTczMTM4IDYuNDg4OTIgMC43MTk0MTlDNi40ODg0NyAwLjcxOTg2NyA2LjQ4ODI0IDAuNzIwNTM4IDYuNDg3OCAwLjcyMDk4NkwwLjc1NjIxNCA2LjQ1MjM0QzAuNDYzODc4IDYuNzQ0NjggMC40NjM4NzggNy4yMTg2OSAwLjc1NjIxNCA3LjUxMTI1Wk0wLjcxOTI1MiAxMi45Mjg1QzEuMDExODEgMTMuMjIwOCAxLjQ4NTgyIDEzLjIyMDggMS43Nzc5MyAxMi45Mjg1TDYuOTgxNTIgNy43MjQ4N0wxMi4xODQ5IDEyLjkyODVDMTIuNDc3NCAxMy4yMjA4IDEyLjk1MTIgMTMuMjIwOCAxMy4yNDM4IDEyLjkyODVDMTMuNTM2MyAxMi42MzYxIDEzLjUzNjMgMTIuMTYyMSAxMy4yNDM4IDExLjg2OTVMNy41MTE2NyA2LjEzNzQ5QzcuMzY0OCA1Ljk5MDM0IDcuMTczMDUgNS45MTczMSA2Ljk4MTUyIDUuOTE3MzFDNi43ODk3NiA1LjkxNzMxIDYuNTk4MjMgNS45OTAzNCA2LjQ1MjE4IDYuMTM2NjJMMC43MTkyNTIgMTEuODY5NUMwLjQyNjkxNiAxMi4xNjIxIDAuNDI2OTE2IDEyLjYzNjEgMC43MTkyNTIgMTIuOTI4NVoiIGZpbGw9IiM3MzczNzMiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF82MjMzXzI0MTY4Ij4KPHJlY3Qgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0IiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=",arrowDownSvg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzYzNDBfMzk1NSkiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTAuNzU2MjE0IDYuMTM2NDVDMS4wNDg3NyA1Ljg0NDEyIDEuNTIyNzggNS44NDQxMiAxLjgxNDkgNi4xMzY0NUw3LjAxODQ4IDExLjM0TDEyLjIyMTggNi4xMzY0NUMxMi41MTQyIDUuODQ0MTIgMTIuOTg4MiA1Ljg0NDEyIDEzLjI4MDcgNi4xMzY0NUMxMy41NzMxIDYuNDI5MDEgMTMuNTczMSA2LjkwMzAzIDEzLjI4MDcgNy4xOTUzNkw3LjU0ODYzIDEyLjkyNzVDNy40MDE3NyAxMy4wNzQ2IDcuMjEwMDEgMTMuMTQ3NiA3LjAxODQ4IDEzLjE0NzZDNi44MjY3MyAxMy4xNDc2IDYuNjM1MiAxMy4wNzQ2IDYuNDg4OTIgMTIuOTI4M0M2LjQ4ODQ3IDEyLjkyNzggNi40ODgyNCAxMi45MjcyIDYuNDg3OCAxMi45MjY3TDAuNzU2MjE0IDcuMTk1MzZDMC40NjM4NzggNi45MDMwMyAwLjQ2Mzg3OCA2LjQyOTAxIDAuNzU2MjE0IDYuMTM2NDVaTTAuNzE5MjUyIDAuNzE5MjUyQzEuMDExODEgMC40MjY5MTYgMS40ODU4MiAwLjQyNjkxNiAxLjc3NzkzIDAuNzE5MjUyTDYuOTgxNTIgNS45MjI4NEwxMi4xODQ5IDAuNzE5MjUyQzEyLjQ3NzQgMC40MjY5MTYgMTIuOTUxMiAwLjQyNjkxNiAxMy4yNDM4IDAuNzE5MjUyQzEzLjUzNjMgMS4wMTE1OSAxMy41MzYzIDEuNDg1NiAxMy4yNDM4IDEuNzc4MTZMNy41MTE2NyA3LjUxMDIyQzcuMzY0OCA3LjY1NzM2IDcuMTczMDUgNy43MzAzOSA2Ljk4MTUyIDcuNzMwMzlDNi43ODk3NiA3LjczMDM5IDYuNTk4MjMgNy42NTczNiA2LjQ1MjE4IDcuNTExMDhMMC43MTkyNTIgMS43NzgxNkMwLjQyNjkxNiAxLjQ4NTYgMC40MjY5MTYgMS4wMTE1OSAwLjcxOTI1MiAwLjcxOTI1MloiIGZpbGw9IiM3MzczNzMiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF82MzQwXzM5NTUiPgo8cmVjdCB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==",script$I=Vue.extend({name:"previewer-question-row",components:{Checkbox:Checkbox,Row:Row,Col:Col,Divider:Divider,Card:Card,Icon:Icon,Form:Form,QuestionTitle:__vue_component__$4,SINGLE_SELECTION:__vue_component__$8,MULTI_SELECTION:__vue_component__$9,SHORT_ANSWER:__vue_component__$b,FILL_BLANK:__vue_component__$c,TEXT_TITLE:__vue_component__$d,MATRIX:__vue_component__$e,SCORING:__vue_component__$k,EVALUATION:__vue_component__$j},mixins:[LocaleMixin],inject:["$rootComponent"],props:{question:{type:Object,required:!0},survey:{type:Object,required:!0},customQuestion:{type:Object,required:!1},expanded:{type:Boolean,default:!0}},data(){return{enabledSelectQuestion:!1,isSelectedQuestion:!1,currentCustomQuestion:this.customQuestion}},created(){this.enabledSelectQuestion=_$1.get(this.$rootComponent,"options.enabledSelectQuestion",!1),this.enabledQuestionTitleIncompleteTips=_$1.get(this.$rootComponent,"options.enabledQuestionTitleIncompleteTips",!1)},computed:{isPreviewMode(){return _$1.get(this.$rootComponent,"options.isPreviewMode",!1)},getClassStyle(){return this.questionTitleIncomplete?"":"question-incomplete"},questionTitleIncomplete(){if(!this.enabledQuestionTitleIncompleteTips)return!0;let e=this.currentCustomQuestion?.filledTitle;return!!_$1.isEmpty(e)||_$1.every(e,(e=>""!==e.title))}},methods:{getJumpRules(e){this.$emit("singleQuestion",e)},selectQuestion(e){this.isSelectedQuestion=e},onSelectQuestion(e){this.$emit("onSelectQuestion",e,this.question)},toggleExpand(){this.$emit("toggle-expand")}}});const __vue_script__$I=script$I;var __vue_render__$H=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Card",{staticClass:"question-row",attrs:{padding:0,bordered:!1,"dis-hover":!0}},[i("div",{class:["question-row-container",{"question-row--selected":e.isSelectedQuestion},e.getClassStyle]},[e.enabledSelectQuestion?i("div",{staticClass:"question-row-container-left"},[i("Checkbox",{on:{"on-change":e.onSelectQuestion},model:{value:e.isSelectedQuestion,callback:function(t){e.isSelectedQuestion=t},expression:"isSelectedQuestion"}})],1):e._e(),e._v(" "),i("div",{staticClass:"question-row-container-right"},[i("span",{directives:[{name:"show",rawName:"v-show",value:!e.questionTitleIncomplete,expression:"!questionTitleIncomplete"}],staticClass:"incomplete-tips"},[e._v("\n        "+e._s(e.t("survey_creator.question.incomplete_tips"))+"\n      ")]),e._v(" "),i("Divider",{staticClass:"question-type-desc",attrs:{orientation:"left"}},[e._v("\n        "+e._s(e.t("survey_creator.question.types."+e.question.type,e.$rootComponent.currentLanguage))+"\n      ")]),e._v(" "),i("div",{staticClass:"question-title-header"},[i("question-title",{staticStyle:{"align-items":"flex-start",flex:"1"},attrs:{question:e.question,"max-score":!0,"custom-question":e.currentCustomQuestion}}),e._v(" "),e.isPreviewMode?i("Icon",{class:["collapse-toggle",{"collapse-toggle--collapsed":!e.expanded}],attrs:{type:"ios-arrow-up"},on:{click:function(t){return t.stopPropagation(),e.toggleExpand.apply(null,arguments)}}}):e._e()],1),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}],staticClass:"question-row-content"},[i("Form",{attrs:{disabled:e.isPreviewMode}},[i(e.question.type,{tag:"component",staticClass:"question",attrs:{question:e.question,survey:e.survey},on:{singleQuestion:e.getJumpRules}})],1)],1)],1)])])},__vue_staticRenderFns__$H=[];const __vue_inject_styles__$I=void 0,__vue_scope_id__$I=void 0,__vue_module_identifier__$I=void 0,__vue_is_functional_template__$I=!1,__vue_component__$I=normalizeComponent({render:__vue_render__$H,staticRenderFns:__vue_staticRenderFns__$H},undefined,__vue_script__$I,undefined,false,undefined,!1,void 0,void 0,void 0);var script$J=Vue.extend({name:"survey-internal-previewer",components:{Card:Card,Checkbox:Checkbox,PreviewerQuestionRow:__vue_component__$I},mixins:[LocaleMixin],inject:{$rootComponent:{default:null}},props:{survey:{type:Object,required:!0},initQuestionIds:{type:Array,required:!1},surveyCustomQuestions:{type:Array,required:!1}},data(){return{sortQuestions:this.survey.questions,selectedQuestions:[],expandedMap:Object.fromEntries(this.survey.questions.map((e=>[e.id,!0]))),arrowUpSvg:arrowUpSvg,arrowDownSvg:arrowDownSvg}},mounted(){this.initSelectedQuestions()},computed:{questionsSort(){return this.sortQuestions},questionIds(){return this.selectedQuestions.map((e=>e.id))},enabledSelectQuestion(){return _$1.get(this.$rootComponent,"options.enabledSelectQuestion",!1)},showCollapseToggle(){return _$1.get(this.$rootComponent,"options.isPreviewMode",!1)},allExpanded(){return this.sortQuestions.every((e=>!1!==this.expandedMap[e.id]))},allSelected(){return this.sortQuestions.length>0&&this.selectedQuestions.length===this.sortQuestions.length},someSelected(){return this.selectedQuestions.length>0&&this.selectedQuestions.length<this.sortQuestions.length}},methods:{surveyCustomQuestion(e){return _$1.find(this.surveyCustomQuestions,(t=>t.id===e))},setDisabled(e,t){this.$set(e.options,"readonly",t)},handleSelected(e){if(e){let t=this.sortQuestions.find((t=>t.id===e.questionId));if(Array.isArray(t.jumps)&&t.jumps.length>0){let i=t.jumps.find((t=>t.choiceId===e.choiceId)),n=t.jumps.filter((t=>t.choiceId!==e.choiceId)).filter((e=>i.toQuestionId!==e.toQuestionId));if(i){if(this.recordQuestionId===e.questionId){let e=this.sortQuestions.find((e=>e.id===i.toQuestionId));this.setDisabled(e,!1)}let t=this.sortQuestions.find((e=>e.id===i.toQuestionId)),o=this.sortQuestions.findIndex((t=>t.id===e.questionId)),s=[],r=this.sortQuestions.slice(0,o+1);r=r.filter((e=>e.id!==i.toQuestionId));let a=this.sortQuestions.slice(o+1).filter((e=>e.id!==i.toQuestionId));n.length>0&&n.forEach((e=>{let t=this.sortQuestions.find((t=>t.id===e.toQuestionId));this.setDisabled(t,!0)})),s=r,s.push(t),s=s.concat(a),this.sortQuestions=s}}this.recordQuestionId=e.questionId}},initSelectedQuestions(){Array.isArray(this.initQuestionIds)&&this.initQuestionIds.length>0&&(this.initQuestionIds.forEach((e=>{const t=this.sortQuestions.find((t=>t.id===e));t&&this.selectQuestionHandler(!0,t)})),this.sortSelectedQuestions(),this.$emit("selected-question-ids",this.questionIds))},onSelectQuestion(e,t){e?this.selectQuestionHandler(e,t):this.unSelectQuestionHandler(e,t),this.sortSelectedQuestions(),this.$emit("selected-question-ids",this.questionIds)},selectQuestionHandler(e,t){this.$refs[`question${t.id}`][0].selectQuestion(e),this.selectedQuestions.find((e=>e.id===t.id))||this.selectedQuestions.push(t),Array.isArray(t.jumps)&&t.jumps.length>0&&t.jumps.forEach((t=>{const i=this.sortQuestions.find((e=>t.toQuestionId===e.id));i&&!this.selectedQuestions.find((e=>e.id===i.id))&&this.selectQuestionHandler(e,i)}))},unSelectQuestionHandler(e,t){this.$refs[`question${t.id}`][0].selectQuestion(e),_$1.remove(this.selectedQuestions,(e=>e.id===t.id)),this.sortQuestions.forEach((i=>{if(Array.isArray(i.jumps)&&i.jumps.length>0){i.jumps.find((e=>e.toQuestionId===t.id))&&this.selectedQuestions.find((e=>e.id===i.id))&&this.unSelectQuestionHandler(e,i)}}))},toggleSelectAll(e){e?this.sortQuestions.filter((e=>!this.selectedQuestions.find((t=>t.id===e.id)))).forEach((e=>this.selectQuestionHandler(!0,e))):(this.sortQuestions.forEach((e=>this.$refs[`question${e.id}`][0]?.selectQuestion(!1))),this.selectedQuestions.splice(0,1/0)),this.sortSelectedQuestions(),this.$emit("selected-question-ids",this.questionIds)},onToggleExpand(e){this.$set(this.expandedMap,e,!this.expandedMap[e])},toggleAllExpand(){const e=!this.allExpanded;this.sortQuestions.forEach((t=>{this.$set(this.expandedMap,t.id,e)}))},sortSelectedQuestions(){this.selectedQuestions.sort(((e,t)=>e.header.number>t.header.number?1:e.header.number<t.header.number?-1:0))}}});const __vue_script__$J=script$J;var __vue_render__$I=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"survey-internal-previewer-wrapper"},[e.enabledSelectQuestion||e.showCollapseToggle?i("div",{staticClass:"question-selection-counter"},[e.showCollapseToggle?i("img",{staticClass:"collapse-toggle-all",attrs:{src:e.allExpanded?e.arrowUpSvg:e.arrowDownSvg},on:{click:e.toggleAllExpand}}):e._e(),e._v(" "),e.enabledSelectQuestion?i("Checkbox",{attrs:{value:e.allSelected,indeterminate:e.someSelected},on:{"on-change":e.toggleSelectAll}}):e._e(),e._v(" "),e.enabledSelectQuestion?[e._v("\n      "+e._s(e.t("survey_creator.previewer.counter_total",[e.sortQuestions.length]))+"\n      "),i("span",{staticClass:"question-selection-counter__num"},[e._v(e._s(e.selectedQuestions.length))]),e._v("\n      "+e._s(e.t("survey_creator.previewer.counter_suffix"))+"\n    ")]:e._e()],2):e._e(),e._v(" "),e._l(e.sortQuestions,(function(t){return i("previewer-question-row",{key:t.id,ref:"question"+t.id,refInFor:!0,attrs:{question:t,survey:e.survey,expanded:e.expandedMap[t.id],"custom-question":e.surveyCustomQuestion(t.id)},on:{singleQuestion:e.handleSelected,onSelectQuestion:e.onSelectQuestion,"toggle-expand":function(i){return e.onToggleExpand(t.id)}}})}))],2)},__vue_staticRenderFns__$I=[];const __vue_inject_styles__$J=void 0,__vue_scope_id__$J=void 0,__vue_module_identifier__$J=void 0,__vue_is_functional_template__$J=!1,__vue_component__$J=normalizeComponent({render:__vue_render__$I,staticRenderFns:__vue_staticRenderFns__$I},undefined,__vue_script__$J,undefined,false,undefined,!1,void 0,void 0,void 0);var script$K=Vue.extend({name:"editor-options",components:{Row:Row,Col:Col,Icon:Icon,RadioGroup:RadioGroup,Radio:Radio},mixins:[LocaleMixin],inject:["$rootComponent"],props:{survey:{type:Object,required:!0}},data:()=>({layoutOptions:["HORIZONTAL","VERTICAL"]}),computed:{questionCount(){return this.survey.statistics.questionCount},totalScore(){return this.survey.statistics.maxScore}},methods:{onLayoutChange(e){this.$rootComponent.onLayoutChange(e)}}});const __vue_script__$K=script$K;var __vue_render__$J=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Row",{attrs:{type:"flex",justify:"start",align:"middle",gutter:30}},[i("Col",[i("Icon",{attrs:{type:"ios-arrow-forward"}}),e._v("\n    "+e._s(e.t("survey_creator.survey.question_count"))+"：\n    "),i("span",{staticClass:"count"},[e._v(e._s(e.questionCount))])],1),e._v(" "),i("Col",[e._v("\n    "+e._s(e.t("survey_creator.survey.total_score"))+"：\n    "),i("span",{staticClass:"max-score"},[e._v(e._s(e.totalScore))])]),e._v(" "),i("Col",[e._v("\n    "+e._s(e.t("survey_creator.survey.layout"))+"：\n    "),i("RadioGroup",{attrs:{value:e.survey.options.layout?e.survey.options.layout:e.layoutOptions[0]},on:{"on-change":e.onLayoutChange}},e._l(e.layoutOptions,(function(t){return i("Radio",{key:t,attrs:{label:t}},[e._v("\n        "+e._s(e.t("survey_creator.common.layout."+t))+"\n      ")])})),1)],1)],1)},__vue_staticRenderFns__$J=[];const __vue_inject_styles__$K=void 0,__vue_scope_id__$K=void 0,__vue_module_identifier__$K=void 0,__vue_is_functional_template__$K=!1,__vue_component__$K=normalizeComponent({render:__vue_render__$J,staticRenderFns:__vue_staticRenderFns__$J},undefined,__vue_script__$K,undefined,false,undefined,!1,void 0,void 0,void 0);var script$L=Vue.extend({name:"jump-setting-form",components:{Form:Form,FormItem:FormItem,Row:Row,Option:Option,Select:Select,Tooltip:Tooltip$1,Icon:Icon,Button:Button},mixins:[questionFormMixin],props:{toQuestions:{type:Array,required:!0}},computed:{choices(){return _$1.map(this.editQuestion.choices,(e=>({value:e.id,label:e.text[this.$rootComponent.primaryLanguage]})))},questionChoicesIds(){return _$1.map(this.editQuestion.choices,(e=>e.id))},hasSettingChoicesIds(){return _$1.map(this.editQuestion.jumps,(e=>e.choiceId))},showAddBtn(){return!_$1.isEmpty(_$1.filter(this.questionChoicesIds,(e=>!_$1.includes(this.hasSettingChoicesIds,e))))},showDeleteBtn(){return _$1.size(this.editQuestion.jumps)>1},firstEnabledChoiceId(){return _$1.find(this.choices,(e=>!_$1.includes(this.hasSettingChoicesIds,e.value))).value}},methods:{addSetting(){this.showAddBtn&&this.editQuestion.jumps.push({choiceId:this.firstEnabledChoiceId,toQuestionId:null})},disabledChoice(e){return _$1.includes(this.hasSettingChoicesIds,e.value)},deleteJumpItem(e){this.editQuestion.jumps.splice(e,1)},addFirstSetting(){this.editQuestion.jumps=[{choiceId:this.firstEnabledChoiceId,toQuestionId:null}]}}}),__$_require_images_deleted_svg__="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjUiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNSAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTIuODYzMyIgY3k9IjEyIiByPSIxMiIgZmlsbD0iI0YwRjFGMyIvPgo8cGF0aCBkPSJNMTcuNjIzIDcuMjQwMTFMOC4xMDMyOCAxNi43NTk5IiBzdHJva2U9IiM3MDc0OEMiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTguMTAzMjcgNy4yNDAxMUwxNy42MjMgMTYuNzU5OSIgc3Ryb2tlPSIjNzA3NDhDIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=";const __vue_script__$L=script$L;var __vue_render__$K=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.editQuestion.jumps.length>0?i("Form",{ref:"questionForm",attrs:{model:e.editQuestion,"label-colon":!1}},[i("div",{staticClass:"rule"},[e._l(e.editQuestion.jumps,(function(t,n){return i("div",{key:n,staticClass:"rule-item"},[i("div",{staticClass:"left-container"},[i("div",{staticClass:"choice-box"},[i("div",{staticClass:"label"},[e._v("\n            "+e._s(e.t("survey_creator.question.jump.option_is"))+"\n          ")]),e._v(" "),i("div",{staticClass:"content"},[i("div",{staticClass:"select"},[i("FormItem",{attrs:{"label-width":0,prop:"jumps."+n+".choiceId",rules:{required:!0,message:" "}}},[i("Select",{staticClass:"fix-width",model:{value:t.choiceId,callback:function(i){e.$set(t,"choiceId",i)},expression:"item.choiceId"}},e._l(e.choices,(function(t){return i("Option",{key:t.value,attrs:{value:t.value,disabled:e.disabledChoice(t)}},[e._v(e._s(t.label))])})),1)],1)],1)])]),e._v(" "),i("div",{staticClass:"questions-box"},[i("div",{staticClass:"label"},[e._v("\n            "+e._s(e.t("survey_creator.question.jump.jump_to"))+"\n          ")]),e._v(" "),i("div",{staticClass:"content"},[i("div",{staticClass:"select"},[i("FormItem",{attrs:{"label-width":0,prop:"jumps."+n+".toQuestionId",rules:{required:!0,message:" "}}},[i("Select",{staticClass:"fix-width",model:{value:t.toQuestionId,callback:function(i){e.$set(t,"toQuestionId",i)},expression:"item.toQuestionId"}},e._l(e.toQuestions,(function(t){return i("Option",{key:t.id,attrs:{value:t.id}},[e._v(e._s(t.header.number+"."+t.header.text[e.primaryLanguage]))])})),1)],1)],1),e._v(" "),i("div",[e._v("\n              "+e._s(e.t("survey_creator.question.jump.otherwise_to_next"))+"\n            ")])])])]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.showDeleteBtn,expression:"showDeleteBtn"}],staticClass:"right-container",on:{click:function(t){return e.deleteJumpItem(n)}}},[i("img",{attrs:{src:__$_require_images_deleted_svg__}})])])})),e._v(" "),i("Row",{staticClass:"mt-small",attrs:{gutter:16,type:"flex",justify:"start",wrap:!1}},[i("div",{staticClass:"btn-container",on:{click:e.addSetting}},[i("Tooltip",{attrs:{placement:"right",disabled:e.showAddBtn,content:e.t("survey_creator.question.jump.no_option_to_setting")}},[i("div",{staticClass:"icon"},[i("Icon",{attrs:{type:"md-add",color:e.showAddBtn?"#1890FF":"#C5C8CE"}})],1),e._v(" "),i("div",{staticClass:"label",class:e.showAddBtn?"enabled":"disabled"},[e._v("\n            "+e._s(e.t("survey_creator.question.jump.add_setting"))+"\n          ")])])],1)])],2)]):i("div",{staticClass:"no-data"},[i("img",{staticClass:"empty-icon",attrs:{src:__$_require_images_empty_svg__}}),e._v(" "),i("p",{staticClass:"desc",staticStyle:{"margin-bottom":"16px"}},[e._v("\n    "+e._s(e.t("survey_creator.question.jump.no_setting_tips"))+"\n  ")]),e._v(" "),i("Button",{attrs:{icon:"md-add",type:"primary"},on:{click:e.addFirstSetting}},[e._v(e._s(e.t("survey_creator.question.jump.add_setting")))])],1)},__vue_staticRenderFns__$K=[];const __vue_inject_styles__$L=function(e){e&&e("data-v-71a3c2c2_0",{source:"[data-v-71a3c2c2] .ivu-table-cell-slot .ivu-form-item{margin-bottom:4px;margin-top:0}[data-v-71a3c2c2] .ivu-table-cell-slot .ivu-form-item-error{margin-bottom:24px;margin-top:0}[data-v-71a3c2c2] .ivu-form-item{width:100%}.rule .warning-color[data-v-71a3c2c2]{color:#ed4014}.rule .warning-info[data-v-71a3c2c2]{color:#ed4014;font-size:13px}.rule .rule-item[data-v-71a3c2c2]:hover{background-color:#f7f7f7;border-radius:4px}.rule .rule-item[data-v-71a3c2c2]{border:1px solid #dcdee2;border-radius:4px;padding:16px;margin-bottom:8px;display:flex;font-weight:400;font-size:14px;line-height:22px;align-items:center;color:#262833}.rule .rule-item .left-container[data-v-71a3c2c2]{width:90%}.rule .rule-item .left-container .choice-box[data-v-71a3c2c2]{display:flex;flex-direction:row;align-items:center}.rule .rule-item .left-container .questions-box[data-v-71a3c2c2]{display:flex;flex-direction:row;align-items:center;padding-top:10px}.rule .rule-item .left-container .label[data-v-71a3c2c2]{width:20%;text-align:right;padding-right:8px}.rule .rule-item .left-container .content[data-v-71a3c2c2]{width:80%;display:flex;flex-direction:row;align-items:center}.rule .rule-item .left-container .content .select[data-v-71a3c2c2]{margin-right:8px;width:50%}.rule .rule-item .left-container .content .select .ivu-form-item[data-v-71a3c2c2]{margin-bottom:unset}.rule .rule-item .right-container[data-v-71a3c2c2]{width:10%;text-align:right;padding-right:16px}.btn-container[data-v-71a3c2c2]{padding-left:8px}.btn-container .icon[data-v-71a3c2c2]{display:flex;float:left;font-size:18px}.btn-container .label[data-v-71a3c2c2]{display:flex;float:left;align-items:center;font-weight:500;font-size:14px;line-height:22px}.btn-container .disabled[data-v-71a3c2c2]{color:#c5c8ce}.btn-container .enabled[data-v-71a3c2c2]{color:#1890ff;cursor:pointer}.no-data[data-v-71a3c2c2]{margin-top:10%;display:block;text-align:center}.no-data .desc[data-v-71a3c2c2]{font-weight:400;font-size:12px;line-height:17px;color:#70748c}",map:void 0,media:void 0})},__vue_scope_id__$L="data-v-71a3c2c2",__vue_module_identifier__$L=void 0,__vue_is_functional_template__$L=!1,__vue_component__$L=normalizeComponent({render:__vue_render__$K,staticRenderFns:__vue_staticRenderFns__$K},__vue_inject_styles__$L,__vue_script__$L,"data-v-71a3c2c2",false,undefined,!1,createInjector,void 0,void 0);var script$M=Vue.extend({name:"question-jump-setting-drawer",components:{Drawer:Drawer,Button:Button,JumpSettingForm:__vue_component__$L},inject:["$rootComponent"],mixins:[LocaleMixin],props:{visible:{type:Boolean,required:!0},fromQuestion:{type:Object,required:!1},toQuestions:{type:Array,required:!1}},model:{prop:"visible",event:"input"},watch:{visible(e){this.visibleDrawer=e},visibleDrawer(e){this.$emit("input",e),e?this.$emit("on-open",e):this.$emit("on-close",e)}},data(){return{visibleDrawer:this.visible,styles:{height:"calc(100% - 53px)",overflow:"auto",position:"static"},selectedQuestion:null}},created(){let e=_$1.cloneDeep(this.fromQuestion);0===_$1.size(_$1.get(e,"jumps",[]))&&(e.jumps=[]),this.selectedQuestion=e},methods:{closeDrawer(){this.visibleDrawer=!1},saveJumpInfo(){const e=this,t=this.$refs.questionComponent;0!==t.editQuestion.jumps.length?t.$refs.questionForm.validate((i=>{i&&(e.$rootComponent.onQuestionCreateOrUpdate(t.editQuestion,this.operationType),e.closeDrawer())})):e.closeDrawer()},cancel(){this.closeDrawer()}}});const __vue_script__$M=script$M;var __vue_render__$L=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Drawer",{attrs:{styles:e.styles,width:50,closable:!0,"mask-closable":!1},model:{value:e.visibleDrawer,callback:function(t){e.visibleDrawer=t},expression:"visibleDrawer"}},[i("div",{staticClass:"title",attrs:{slot:"header"},slot:"header"},[i("span",[e._v(e._s(e.t("survey_creator.question.jump.title")))])]),e._v(" "),i("div",[i("jump-setting-form",{ref:"questionComponent",staticClass:"question-form",attrs:{question:e.selectedQuestion,"to-questions":e.toQuestions}})],1),e._v(" "),i("div",{staticClass:"drawer-footer"},[i("Button",{attrs:{type:"primary"},on:{click:e.saveJumpInfo}},[i("span",[e._v(e._s(e.t("survey_creator.common.save")))])]),e._v(" "),i("Button",{on:{click:e.cancel}},[e._v(e._s(e.t("survey_creator.common.cancel")))])],1)])},__vue_staticRenderFns__$L=[];const __vue_inject_styles__$M=function(e){e&&e("data-v-18da7b7b_0",{source:".title{font-weight:500;font-size:16px;line-height:24px;color:#262833}.drawer-footer{width:100%;position:absolute;bottom:0;left:0;border-top:1px solid #e8e8e8;padding:10px 16px;text-align:right;background:#fff;z-index:99}.question-form{margin-bottom:53px}",map:void 0,media:void 0})},__vue_scope_id__$M=void 0,__vue_module_identifier__$M=void 0,__vue_is_functional_template__$M=!1,__vue_component__$M=normalizeComponent({render:__vue_render__$L,staticRenderFns:__vue_staticRenderFns__$L},__vue_inject_styles__$M,__vue_script__$M,undefined,false,undefined,!1,createInjector,void 0,void 0);var Mode;!function(e){e[e.EDIT=0]="EDIT",e[e.TRANSLATE=1]="TRANSLATE",e[e.PREVIEW=2]="PREVIEW"}(Mode||(Mode={}));const QUESTION_OPERATION_TYPE_COPY$1="copy",QUESTION_OPERATION_TYPE_CREATE="create",QUESTION_OPERATION_TYPE_UPDATE="update";var script$N=Vue.extend({name:"survey-creator",components:{Card:Card,Row:Row,Col:Col,Button:Button,SurveyEditor:__vue_component__$n,SurveyTranslator:__vue_component__$H,SurveyInternalPreviewer:__vue_component__$J,QuestionEditDrawer:__vue_component__$F,Toolbar:__vue_component__$2,Modal:Modal,Tabs:Tabs,TabPane:TabPane,Icon:Icon,Scroll:Scroll$1,CreateQuestionDropdown:__vue_component__,EditOptions:__vue_component__$K,QuestionJumpSettingDrawer:__vue_component__$M},mixins:[LocaleMixin,SurveyTranslatorMixin],provide(){return{$rootComponent:this}},props:{loading:Boolean,survey:{type:Object,required:!0},showQuestionWhenPageLoad:{type:Boolean,required:!1,default:!1},showQuestionType:{type:String,required:!1,default:"EVALUATION"},saveBtnAlwaysEnabled:{type:Boolean,default:!1},options:{type:Object,required:!1},screenshotData:{type:Object,required:!1}},data:function(){return{height:window.innerHeight-240,operationType:null,copyFromQuestionIndex:null,activeTab:Mode[Mode.EDIT],mode:Mode.EDIT,originSurvey:null,currentSurvey:null,primaryLanguage:null,editingQuestion:null,questionEditDrawerVisible:!1,jumpFromQuestion:null,jumpToQuestions:null,questionJumpDrawerVisible:!1,backHandler:{[Mode.EDIT]:this.onEditModeBack,[Mode.TRANSLATE]:this.onTranslateModeBack,[Mode.PREVIEW]:this.onPreviewModeBack}}},created(){if(this.originSurvey=_$1.cloneDeep(this.survey),this.currentSurvey=_$1.cloneDeep(this.survey),_$1.forEach(this.currentSurvey.questions,(e=>{this.$set(e,"active",!1)})),this.currentSurvey.questions.length>0&&(this.currentSurvey.questions[0].active=!0),this.primaryLanguage=_$1.camelCase(this.currentSurvey.options.primaryLanguage),this.showQuestionWhenPageLoad){const e=_$1.find(this.currentSurvey?.questions,(e=>e.type===this.showQuestionType));_$1.isUndefined(e)?this.createQuestion(this.showQuestionType):this.showQuestionEditDrawer(e)}},computed:{isEditMode(){return this.mode===Mode.EDIT},isTranslateMode(){return this.mode===Mode.TRANSLATE},isPreviewMode(){return this.mode===Mode.PREVIEW},isSaved(){return!this.saveBtnAlwaysEnabled&&0===this.currentSurvey.questions.length}},watch:{survey(e){this.originSurvey=_$1.cloneDeep(e)},screenshotData:{deep:!0,handler(e){Array.isArray(e.urls)&&e.urls.length>0&&EventBus.$emit("screen-shot-urls",e)}}},mounted(){EventBus.$on("get-screen-shot-image",this.getScreenShot)},methods:{getScreenShot(e){this.$emit("getScreenShot",e)},onEditModeBack(){this.$emit("on-back")},onTranslateModeBack(){this.mode=Mode.EDIT},onPreviewModeBack(){this.mode=Mode.EDIT},onBack(){this.$emit("on-back")},onSave(){this.validateData()||this.showQuestionWhenPageLoad?this.$emit("on-save",JSON.stringify(this.getPureSurvey(this.currentSurvey))):Modal.confirm({title:this.t("survey_creator.message.surveyLocaleNoSettingCompleted"),onOk:()=>{this.$emit("on-save",JSON.stringify(this.getPureSurvey(this.currentSurvey)))}})},getPureSurvey(e){let t=_$1.cloneDeep(e);return _$1.forEach(t.questions,(e=>{this.$delete(e,"active")})),t},onTranslate(){this.mode=Mode.TRANSLATE},onPreview(){this.mode=Mode.PREVIEW},showQuestionEditDrawer(e){this.editingQuestion=e,this.questionEditDrawerVisible=!0},showQuestionJumpDrawer(e,t){this.jumpFromQuestion=e,this.jumpToQuestions=t,this.questionJumpDrawerVisible=!0},createQuestion(e){this.operationType="create";let t=QuestionFactory.getInstance(this.primaryLanguage).createQuestion(e);t.options.layout=this.currentSurvey.options.layout,this.showQuestionEditDrawer(t)},onLayoutChange(e){this.currentSurvey.options.layout=e,_$1.forEach(this.currentSurvey.questions,(t=>t.options.layout=e))},onQuestionCopy(e){let t=_$1.findIndex(this.currentSurvey.questions,{id:e});if(-1==t)return;let i=this.currentSurvey.questions[t],n=this.createQuestionFrom(this.currentSurvey,i);this.copyFromQuestionIndex=t,this.operationType="copy",this.showQuestionEditDrawer(n)},onQuestionCreateOrUpdate(e,t){let i=_$1.findIndex(this.currentSurvey.questions,{id:e.id});i>-1?Vue.set(this.currentSurvey.questions,i,e):"copy"==t?this.currentSurvey.questions.splice(this.copyFromQuestionIndex+1,0,e):(this.currentSurvey.questions.push(e),this.$nextTick((()=>{document.getElementById(e.id).scrollIntoView(!0)}))),BaseQuestionModel.refreshSurvey(this.currentSurvey),BaseQuestionModel.setActiveQuestion(e,this.currentSurvey.questions),this.showQuestionWhenPageLoad&&this.onSave()},onQuestionDelete(e){_$1.forEach(this.currentSurvey.questions,((t,i)=>{let n=_$1.cloneDeep(t);_$1.remove(n.jumps,(t=>t.toQuestionId===e)),Vue.set(this.currentSurvey.questions,i,n)})),_$1.remove(this.currentSurvey.questions,(function(t){return t.id===e})),this.currentSurvey.questions=_$1.clone(this.currentSurvey.questions),BaseQuestionModel.refreshSurvey(this.currentSurvey)},onQuestionEdit(e){let t=_$1.cloneDeep(_$1.find(this.currentSurvey.questions,{id:e}));this.operationType="update",this.showQuestionEditDrawer(t)},onQuestionJump(e){let t=_$1.cloneDeep(_$1.find(this.currentSurvey.questions,{id:e}));this.operationType="update";let i=_$1.cloneDeep(_$1.filter(this.currentSurvey.questions,(t=>!(t.id==e||"TEXT_TITLE"===t.type||"EVALUATION"===t.type))));this.showQuestionJumpDrawer(t,i)},createQuestionFrom(e,t){let i=_$1.cloneDeep(t);if(i.id=BaseQuestionModel.createQuestionId(),"MATRIX"===t.type){const e=SubQuestionModel.createSubPrefixId();i.subQuestions.forEach(((t,n)=>{i.subQuestions[n].id=e+n.toString()}))}return i},validateData(){return this.allTranslationIsCompleted(this.currentSurvey)},questionEditDrawOpen(e){this.$emit("question-edit-draw-open")},questionEditDrawClose(e){this.$emit("question-edit-draw-close")}}});const __vue_script__$N=script$N;var __vue_render__$M=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e.showQuestionWhenPageLoad?i("div",[i("question-edit-drawer",{ref:"editDrawer",attrs:{question:e.editingQuestion,"operation-type":e.operationType},on:{"on-close":e.questionEditDrawClose,"on-open":e.questionEditDrawOpen},model:{value:e.questionEditDrawerVisible,callback:function(t){e.questionEditDrawerVisible=t},expression:"questionEditDrawerVisible"}})],1):i("div",{staticClass:"survey-creator-wrapper"},[i("Card",{attrs:{bordered:!1,"dis-hover":""}},[i("Row",{attrs:{align:"middle",justify:"space-between",type:"flex"}},[i("Col",{attrs:{span:"20"}},[i("Icon",{staticClass:"icon-clipboard",attrs:{custom:"i-icon icon-clipboard",size:"24"}}),e._v(" "),i("span",{staticClass:"title"},[e._v("\n        "+e._s(e._f("translate")(e.survey.name.text,!0))+"\n      ")])],1),e._v(" "),i("Col",[i("Button",{attrs:{icon:"ios-arrow-back"},on:{click:e.onBack}},[e._v(e._s(e.t("survey_creator.common.back")))])],1)],1)],1),e._v(" "),e.isPreviewMode?i("survey-internal-previewer",{staticStyle:{height:"calc(100vh - 130px)"},attrs:{options:this.options,survey:this.currentSurvey,"operation-type":e.operationType}}):i("Card",{staticStyle:{height:"calc(100vh - 130px)"},attrs:{bordered:!1,"dis-hover":""}},[i("Tabs",{attrs:{type:"card"},model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[i("TabPane",{attrs:{label:e.t("survey_creator.common.tab.question_setting"),name:"EDIT"}},["EDIT"===e.activeTab?i("div",[i("Row",{staticClass:"survey-operate",attrs:{type:"flex",justify:"space-between",align:"middle",gutter:48}},[i("Col",{staticStyle:{display:"flex","align-items":"center"}},[i("create-question-dropdown",{attrs:{options:e.options}}),e._v(" "),e._t("add-question-extra")],2),e._v(" "),i("Col",[i("edit-options",{staticClass:"edit-option",attrs:{survey:this.currentSurvey}})],1)],1),e._v(" "),i("div",{staticStyle:{width:"100%"}},[e._t("extra")],2),e._v(" "),i("Scroll",{staticClass:"question-content",attrs:{height:e.height}},[i("survey-editor",{attrs:{options:this.options,survey:this.currentSurvey}})],1)],1):e._e()]),e._v(" "),i("TabPane",{attrs:{label:e.t("survey_creator.common.tab.language"),name:"TRANSLATE"}},["TRANSLATE"===e.activeTab?i("survey-translator",{attrs:{options:this.options,survey:this.currentSurvey}}):e._e()],1)],1)],1),e._v(" "),i("question-edit-drawer",{ref:"editDrawer",attrs:{question:e.editingQuestion,"operation-type":e.operationType},model:{value:e.questionEditDrawerVisible,callback:function(t){e.questionEditDrawerVisible=t},expression:"questionEditDrawerVisible"}}),e._v(" "),e.questionJumpDrawerVisible?i("div",{staticStyle:{height:"100%"}},[i("question-jump-setting-drawer",{ref:"jumpDrawer",attrs:{"from-question":e.jumpFromQuestion,"to-questions":e.jumpToQuestions,"operation-type":e.operationType},model:{value:e.questionJumpDrawerVisible,callback:function(t){e.questionJumpDrawerVisible=t},expression:"questionJumpDrawerVisible"}})],1):e._e(),e._v(" "),i("div",{staticClass:"save-card"},[i("Button",{attrs:{loading:e.loading,type:"primary",disabled:e.isSaved},on:{click:e.onSave}},[e._v(e._s(e.t("survey_creator.common.save"))+"\n            ")])],1)],1)])},__vue_staticRenderFns__$M=[];const __vue_inject_styles__$N=void 0,__vue_scope_id__$N=void 0,__vue_module_identifier__$N=void 0,__vue_is_functional_template__$N=!1,__vue_component__$N=normalizeComponent({render:__vue_render__$M,staticRenderFns:__vue_staticRenderFns__$M},undefined,__vue_script__$N,undefined,false,undefined,!1,void 0,void 0,void 0);var script$O=Vue.extend({name:"survey-previewer",mixins:[LocaleMixin],components:{Card:Card,Row:Row,Col:Col,Button:Button,Toolbar:__vue_component__$2,SurveyInternalPreviewer:__vue_component__$J},provide(){return{$rootComponent:this}},props:{survey:{type:Object,required:!0},options:{type:Object,required:!0},initQuestionIds:{type:Array,required:!1},surveyCustom:{type:Object,required:!1}},data(){return{currentSurvey:this.survey,currentLanguage:Vue.$surveyLanguage||this.survey.options.primaryLanguage,currentSurveyCustom:this.surveyCustom}},created(){this.setSurveyLanguage(this.survey),this.prepareSurveyCustomQuestions()},methods:{onBack(){this.$emit("on-back")},onChangeLanguage(e){this.currentSurvey=_$1.cloneDeep(this.survey),Vue.$surveyLanguage=e,this.currentLanguage=e},selectedQuestionIds(e){this.$emit("selected-question-ids",e)},prepareSurveyCustomQuestions(){_$1.isEmpty(this.currentSurveyCustom)&&(this.currentSurveyCustom={surveyId:this.survey.id,questions:[]}),_$1.isEmpty(this.currentSurveyCustom?.questions)&&(_$1.set(this.currentSurveyCustom,"questions",[]),_$1.each(this.survey.questions,(e=>{let t=[],i=formatTitle(e,Vue.$surveyLanguage);_$1.each(i,((e,i)=>{if(CUSTOM_INPUT_REG.test(e)){let e={title:"",index:i};t.push(e)}}));let n={id:e.id,surveyId:this.survey.id,filledTitle:t};this.currentSurveyCustom.questions.push(n)})))}}});const __vue_script__$O=script$O;var __vue_render__$N=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.currentSurvey?i("div",{staticClass:"survey-preview-wrapper"},[i("Row",{attrs:{type:"flex",justify:"space-between",align:"middle"}},[i("Col",[e.options.back?i("Button",{attrs:{icon:"ios-arrow-back"},on:{click:e.onBack}},[e._v("\n        "+e._s(e.t("survey_creator.common.back"))+"\n      ")]):e._e()],1),e._v(" "),i("Col",[i("toolbar",{attrs:{survey:e.currentSurvey,"create-question":!1,preview:!1,"change-language":e.options.changeLanguage}})],1)],1),e._v(" "),i("div",{staticClass:"survey-editor-wrapper"},[i("survey-internal-previewer",{attrs:{survey:e.currentSurvey,"init-question-ids":e.initQuestionIds,"survey-custom-questions":e.currentSurveyCustom.questions},on:{"selected-question-ids":e.selectedQuestionIds}})],1)],1):e._e()},__vue_staticRenderFns__$N=[];const __vue_inject_styles__$O=void 0,__vue_scope_id__$O=void 0,__vue_module_identifier__$O=void 0,__vue_is_functional_template__$O=!1,__vue_component__$O=normalizeComponent({render:__vue_render__$N,staticRenderFns:__vue_staticRenderFns__$N},undefined,__vue_script__$O,undefined,false,undefined,!1,void 0,void 0,void 0);class SurveyCreatorOptions{locale;i18n}class SurveyCreatorPlugin{static install(e,t){locale.use(t.locale),locale.i18n(t.i18n),e.$surveyLanguage=t.locale,e.component("survey-creator",__vue_component__$N),e.component("survey-previewer",__vue_component__$O),e.component("question-edit-drawer",__vue_component__$F)}}export default SurveyCreatorPlugin;export{__vue_component__$N as SurveyCreator,SurveyCreatorOptions};
//# sourceMappingURL=/sm/ade0749f4f3ead881b2f7f2f0ee5acb787877cf222e229ba2fbfbb3a4ea8ab46.map