(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5a766c00"],{"3869e":function(e,t,r){"use strict";r("58a9")},"58a9":function(e,t,r){},91807:function(e,t,r){"use strict";r.r(t);var n=r("8336"),i=r("b0af"),o=r("99d9"),a=r("cc20"),s=r("62ad"),c=r("a523"),u=r("8fea"),l=r("169a"),d=r("132d"),f=r("da13"),p=r("5d23"),v=r("490a"),y=r("8e36"),h=r("0fd9"),m=r("2fa4"),g=r("8654"),b=r("71d9"),S=r("3a2f"),x=function(){var e=this,t=e._self._c;return t(c["a"],{attrs:{fluid:""}},[t(f["a"],{attrs:{"three-line":""}},[t(p["g"],[t("p",{staticClass:"display-1 text--primary"},[e._v(" "+e._s(e.$t("menu.survey"))+" ")])])],1),t(u["a"],{staticClass:"agTable",attrs:{headers:e.headers,items:e.surveyTemplateList,loading:e.loading,search:e.search,"sort-by":"id","no-results-text":e.$t("general.ui.not_search_found"),"no-data-text":e.$t("general.ui.not_data_found"),"loading-text":e.$t("general.notification.loadData"),"footer-props":{itemsPerPageText:e.$t("general.table.itemsPerPageText"),pageText:"{0}-{1} "+e.$t("general.table.pageText")+" {2}"}},scopedSlots:e._u([{key:"top",fn:function(){return[t(b["a"],{attrs:{flat:"",color:"white"}},[t(h["a"],{staticClass:"d-flex justify-space-between align-baseline"},[t(s["a"],{staticClass:"pl-0",attrs:{lg:"4",md:"4",sm:"6",xl:"4",cols:"6"}},[t(g["a"],{attrs:{onkeypress:"return (event.charCode != 34)",dense:"",filled:"",rounded:"",color:"primary","append-icon":"mdi-magnify",label:e.$t("general.titles.filter"),clearable:!0,"single-line":"","hide-details":""},on:{keyup:[function(t){return t.type.indexOf("key")||86===t.keyCode?e.replace.apply(null,arguments):null},function(t){return(t.type.indexOf("key")||86===t.keyCode)&&t.ctrlKey?e.replace.apply(null,arguments):null}]},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}})],1),t(m["a"]),t(s["a"],{staticClass:"text-end",attrs:{lg:"4",md:"4",sm:"4",xl:"4",cols:"4"}},[e.check([{domain:"surveyAdm",permisions:["Write"]}])?t(n["a"],{staticStyle:{"border-radius":"1.5em"},attrs:{small:"",tile:"",elevation:0,color:"gray"},on:{click:function(t){return e.addItem()}}},[t(d["a"],{attrs:{small:"",color:"neuter",left:""}},[e._v("mdi-plus")]),e._v(" "+e._s(e.$t("general.buttons.new"))+" ")],1):e._e()],1)],1)],1)]},proxy:!0},{key:"item.surveyStateTypeName",fn:function(r){var n=r.item;return["EDITING"===n.surveyStateType?t("span",[t(a["a"],{attrs:{small:"",color:"disabled","text-color":"t-bw-disabled"}},[e._v(" "+e._s(n.surveyStateTypeName)+" ")])],1):e._e(),"PUBLISHED"===n.surveyStateType?t("span",[t(a["a"],{attrs:{small:""}},[e._v(" "+e._s(n.surveyStateTypeName)+" ")])],1):e._e()]}},{key:"item.blockedBy",fn:function(r){var n=r.item;return[n.isBlocked?t(a["a"],{attrs:{small:"",color:"disabled","text-color":"t-bw-disabled"}},[t(d["a"],{attrs:{color:"neuter",small:"",left:""}},[e._v(" "+e._s(n.isBlocked?"mdi-lock-outline":"mdi-lock-open-variant-outline")+" ")]),e._v(" "+e._s(n.blockedBy.name.toUpperCase())+" ")],1):t("span",[e._v(" - ")])]}},{key:"item.action",fn:function(r){var n=r.item;return[t("div",{staticClass:"d-flex justify-end align-center"},[t(S["a"],{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on;return["EDITING"===n.surveyStateType&&e.check([{domain:"surveyAdm",permisions:["Update"]}])?t(d["a"],e._g({staticClass:"mr-2",attrs:{color:"neuter",small:""},on:{click:function(t){return e.publish(n)}}},i),[e._v(" mdi-book-check-outline ")]):e._e()]}}],null,!0)},[t("span",[e._v(" "+e._s(e.$t("general.buttons.publish"))+" "),t("span",{staticStyle:{"font-size":"12px",color:"#AAAAAA"}},[e._v(" "+e._s(e.$t("menu.survey"))+" ")])])]),t(S["a"],{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on;return["EDITING"===n.surveyStateType&&e.check([{domain:"surveyAdm",permisions:["Update"]}])?t(d["a"],e._g({attrs:{color:"neuter",small:""},on:{click:function(t){return e.editItem(n)}}},i),[e._v(" mdi-square-edit-outline ")]):e._e()]}}],null,!0)},[t("span",[e._v(" "+e._s(e.$t("general.buttons.edit"))+" "),t("span",{staticStyle:{"font-size":"12px",color:"#AAAAAA"}},[e._v(" "+e._s(e.$t("menu.survey"))+" ")])])]),t(S["a"],{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on;return["PUBLISHED"===n.surveyStateType&&e.check([{domain:"surveyAdm",permisions:["Update"]}])?t(d["a"],e._g({attrs:{color:"neuter",small:"",disabled:n.blockedBy&&n.blockedBy.id!==e.profile.id&&!e.checkAdmin()},on:{click:function(t){return e.blockItem(n)}}},i),[e._v(" "+e._s(n.isBlocked?"mdi-lock-open-variant-outline":"mdi-lock-outline")+" ")]):e._e()]}}],null,!0)},[t("span",[e._v(" "+e._s(n.isBlocked?e.$t("general.buttons.unlock"):e.$t("general.buttons.lock"))+" "),t("span",{staticStyle:{"font-size":"12px",color:"#AAAAAA"}},[e._v(" "+e._s(e.$t("menu.survey"))+" ")])])]),e.check([{domain:"surveyAdm",permisions:["Update"]}])?t("ConfirmDialog",{attrs:{item:n,"is-icon":!0,"is-tooltip":!0,"is-btn":!1,title:e.$t("general.titles.information"),"dialog-text":e.$t("survey.notification.duplicateSurvey"),"tp-text":e.$t("general.buttons.duplicate"),"ts-text":e.$t("menu.survey"),tooltip:!0,"btn-title":"","btn-icon":"mdi-content-copy",color:"neuter",action:"initiateSurveyDuplication",styles:"mx-2"}}):e._e(),"PUBLISHED"===n.surveyStateType&&e.check([{domain:"surveyAdm",permisions:["Update"]}])?t("ConfirmDialog",{attrs:{item:n,"is-icon":!0,"is-tooltip":!0,"is-btn":!1,title:e.$t("general.titles.information"),"dialog-text":e.$t("survey.notification.versioningSurvey"),"tp-text":e.$t("general.buttons.versioning"),"ts-text":e.$t("menu.survey"),tooltip:!0,valid:n.isBlocked,"btn-title":"","btn-icon":"mdi-content-duplicate",color:"neuter",action:"initiateSurveyVersioning",styles:"mr-2"}}):e._e(),"EDITING"!==n.surveyStateType&&"PUBLISHED"!==n.surveyStateType||!e.check([{domain:"surveyAdm",permisions:["Delete"]}])?e._e():t("ConfirmDialog",{attrs:{item:n,"is-icon":!0,"is-tooltip":!0,"is-btn":!1,title:e.$t("general.titles.alert"),"dialog-text":e.$t("general.notification.deleteItems"),"tp-text":e.$t("general.buttons.delete"),"ts-text":e.$t("menu.survey"),tooltip:!0,valid:n.isBlocked,"btn-title":"","btn-icon":"mdi-trash-can-outline",action:"deleteItem",frBtnProps:{small:!0,color:"error",textColor:"t-bw-error--text",elevation:0,text:!1}}})],1)]}}])}),t(l["a"],{attrs:{"max-width":"640px",persistent:""},model:{value:e.dialogDuplicateVisible,callback:function(t){e.dialogDuplicateVisible=t},expression:"dialogDuplicateVisible"}},[t(i["a"],[t(o["e"],{staticClass:"headline secondary t-bw-secondary--text"},[e._v(e._s(e.$t("survey.titles.duplicatingTemplate")))]),t(o["c"],{staticClass:"d-flex justify-start align-center"},[e._v(" "+e._s(e.currentStatus)+" "),e.isFetchingSurvey?t(v["a"],{staticClass:"mx-2",attrs:{dark:"",size:"12",width:"2",indeterminate:""}}):e._e()],1),t(o["d"],{staticClass:"pa-6"},[t(y["a"],{staticStyle:{"border-radius":".2em"},attrs:{value:e.progress,color:"primary",stream:"","buffer-value":"100",height:"25"},scopedSlots:e._u([{key:"default",fn:function(r){var n=r.value;return[t("span",{staticStyle:{color:"#F2F2F2"}},[e._v(e._s(e.currentStep)+" / "+e._s(e.totalSteps)+" "),t("strong",[e._v("("+e._s(Math.ceil(n))+"%)")])])]}}])}),t("div",{staticClass:"my-1"},[t("strong",[e._v(e._s(e.$t("survey.fields.section"))+": ")]),e._v(" "+e._s(e.currentSectionIndex)+" "),t("strong",[e._v("de")]),e._v(" "+e._s(e.totalSections)+" "),t("div",{key:e.currentSectionStep,staticClass:"text-subtitle-1"},[e._v(" "+e._s(e.currentSectionStatus)+" ")])]),t("div",{staticClass:"my-1"},[t("strong",[e._v(e._s(e.$t("survey.fields.question"))+": ")]),e._v(" "+e._s(e.currentQuestionIndex)+" "),t("strong",[e._v("de")]),e._v(" "+e._s(e.totalQuestions)+" "),t("div",{key:e.currentQuestionStep,staticClass:"text-subtitle-1"},[e._v(" "+e._s(e.currentQuestionStatus)+" ")])])],1)],1)],1),t(l["a"],{attrs:{"max-width":"640px",persistent:""},model:{value:e.dialogVersionVisible,callback:function(t){e.dialogVersionVisible=t},expression:"dialogVersionVisible"}},[t(i["a"],[t(o["e"],{staticClass:"headline secondary t-bw-secondary--text"},[e._v(" "+e._s(e.$t("survey.titles.generateVersion"))+" ")]),t(o["d"],{staticClass:"pa-6"},[t("div",{staticClass:"d-flex justify-start align-center align-content-center py-4"},[e._v(" "+e._s(e.currentStatus)+" "),e.isFetchingSurvey?t(v["a"],{staticClass:"mx-2",attrs:{dark:"",size:"12",width:"2",indeterminate:""}}):e._e()],1),t(y["a"],{staticStyle:{"border-radius":".2em"},attrs:{value:e.progress,color:"primary",stream:"","buffer-value":"100",height:"25"},scopedSlots:e._u([{key:"default",fn:function(r){var n=r.value;return[t("span",{staticStyle:{color:"#F2F2F2"}},[e._v(e._s(e.currentStep)+" / "+e._s(e.totalSteps)+" "),t("strong",[e._v("("+e._s(Math.ceil(n))+"%)")])])]}}])}),t("div",{staticClass:"my-1"},[t("strong",[e._v(e._s(e.$t("survey.fields.section"))+": ")]),e._v(" "+e._s(e.currentSectionIndex)+" "),t("strong",[e._v("de")]),e._v(" "+e._s(e.totalSections)+" "),t("div",{key:e.currentSectionStep,staticClass:"text-subtitle-1"},[e._v(" "+e._s(e.currentSectionStatus)+" ")])]),t("div",{staticClass:"my-1"},[t("strong",[e._v(e._s(e.$t("survey.fields.question"))+": ")]),e._v(" "+e._s(e.currentQuestionIndex)+" "),t("strong",[e._v("de")]),e._v(" "+e._s(e.totalQuestions)+" "),t("div",{key:e.currentQuestionStep,staticClass:"text-subtitle-1"},[e._v(" "+e._s(e.currentQuestionStatus)+" ")])])],1)],1)],1),t(l["a"],{attrs:{"max-width":"500px",persistent:""},model:{value:e.dialogNameCheckVisible,callback:function(t){e.dialogNameCheckVisible=t},expression:"dialogNameCheckVisible"}},[t(i["a"],[t(o["d"],{staticClass:"pa-6"},[t(g["a"],{attrs:{color:"primary",dense:"",label:e.$t("survey.titles.enterNewName"),outlined:"","error-messages":e.nameErrorMessages},on:{input:e.checkSurveyNameUniqueness},model:{value:e.newSurveyName,callback:function(t){e.newSurveyName=t},expression:"newSurveyName"}})],1),t(o["b"],{staticClass:"pa-6"},[t(m["a"]),t(n["a"],{attrs:{small:"",color:"neuter",text:""},on:{click:function(t){return e.cancelCheckNameDialog()}}},[e._v(" "+e._s(e.$t("general.buttons.cancel"))+" ")]),t(n["a"],{staticClass:"t-bw-primary--text",attrs:{small:"",color:"primary",elevation:"0",disabled:!e.isNameUnique},on:{click:function(t){return e.duplicateItem()}}},[e._v(" "+e._s(e.$t("general.buttons.duplicate"))+" ")])],1)],1)],1)],1)},w=[],k=r("fe0b"),I=r("2f62"),$=r("eb7f"),T=r("7eef"),O=r("96ec");function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function D(e){return q(e)||j(e)||A(e)||C()}function C(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function q(e){if(Array.isArray(e))return P(e)}function N(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=A(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function A(e,t){if(e){if("string"==typeof e)return P(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function L(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */L=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),s=new C(n||[]);return i(a,"_invoke",{value:$(e,r,s)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var f="suspendedStart",p="suspendedYield",v="executing",y="completed",h={};function m(){}function g(){}function b(){}var S={};u(S,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(j([])));_&&_!==r&&n.call(_,a)&&(S=_);var w=b.prototype=m.prototype=Object.create(S);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function r(i,o,a,s){var c=d(e[i],e,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==E(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function $(t,r,n){var i=f;return function(o,a){if(i===v)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=T(s,n);if(c){if(c===h)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var u=d(t,r,n);if("normal"===u.type){if(i=n.done?y:p,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=y,n.method="throw",n.arg=u.arg)}}}function T(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=d(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,h;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function j(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(E(t)+" is not iterable")}return g.prototype=b,i(w,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,u(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},k(I.prototype),u(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new I(l(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=j,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;D(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function B(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function V(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){B(o,n,i,a,s,"next",e)}function s(e){B(o,n,i,a,s,"throw",e)}a(void 0)}))}}function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach((function(t){U(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function U(e,t,r){return(t=G(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G(e){var t=R(e,"string");return"symbol"==E(t)?t:t+""}function R(e,t){if("object"!=E(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var H={name:"Survey",components:{AddOrEditSurvey:T["default"],ConfirmDialog:O["a"]},data:function(){return{expanded:[],profile:null,survey:[],search:"",title:"Información",dialogText:"Añada un texto a este dialogo",deletingItem:{},editingItem:{},confirmAction:null,dialogDuplicateVisible:!1,dialogVersionVisible:!1,progress:0,currentStatus:"",currentSectionStatus:"",currentQuestionStatus:"",totalSteps:0,currentStep:0,currentQuestionStep:0,currentSectionStep:0,currentSectionIndex:0,currentQuestionIndex:0,totalSections:0,totalQuestions:0,isFetchingSurvey:!1,dialogNameCheckVisible:!1,newSurveyName:"",surveySelected:null,isNameUnique:!1,nameErrorMessages:[]}},mounted:function(){var e=this;this.$root.$on("deleteItem",(function(t){e.deleteItem(t)})),this.$root.$on("initiateSurveyDuplication",(function(t){e.initiateSurveyDuplication(t)})),this.$root.$on("initiateSurveyVersioning",(function(t){e.initiateSurveyVersioning(t)})),this.$root.$on("changePublishStage",(function(t){e.changePublishStage(t)}))},computed:F(F({},Object(I["c"])({loading:"survey/loading",requireAndMaxRules:"general/requireAndMaxRules",requireRules:"general/requireRules",surveyEdit:"survey/surveyEdit",surveyTemplateList:"survey/surveyTemplateList",error:"survey/error"})),{},{headers:function(){return[{text:k["a"].t("survey.fields.name"),value:"name"},{text:k["a"].t("survey.fields.state"),value:"surveyStateTypeName"},{text:k["a"].t("survey.fields.blockedBy"),value:"blockedBy"},{text:k["a"].t("general.fields.action"),value:"action",width:120,sortable:!1,align:"center"}]}}),created:function(){var e=this;return V(L().mark((function t(){return L().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.profile=JSON.parse(localStorage.getItem("profile")),t.next=3,e.getSurveyTemplate();case 3:case"end":return t.stop()}}),t)})))()},methods:F(F({},Object(I["b"])({fetchSurveyById:"survey/fetchSurveyById",blockSurveyTemplate:"survey/blockSurveyTemplate",saveSurvey:"survey/saveSurvey",saveSection:"survey/saveSection",saveQuestion:"survey/saveQuestion",fetchListSurveyTemplate:"survey/fetchListSurveyTemplate",deleteSurvey:"survey/deleteSurvey",change_state:"survey/change_state",errorOFF:"survey/errorOFF"})),{},{getSurveyTemplate:function(){var e=this;return V(L().mark((function t(){var r;return L().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r={surveyStateType:["PUBLISHED","EDITING"],checkAccess:!1},t.next=3,e.fetchListSurveyTemplate([r,e.$toast]);case 3:case"end":return t.stop()}}),t)})))()},addItem:function(){localStorage.removeItem("survey"),this.$router.push({name:"surveyAdd"})},editItem:function(e){localStorage.setItem("survey",JSON.stringify(e.id)),localStorage.setItem("sameSession",JSON.stringify(!1)),this.$router.push({name:"surveyAdd"})},blockItem:function(e){var t=this;return V(L().mark((function r(){return L().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,t.blockSurveyTemplate([e.id,t.$toast]);case 2:return r.next=4,t.getSurveyTemplate();case 4:case"end":return r.stop()}}),r)})))()},handleDuplicateSurvey:function(){var e=arguments,t=this;return V(L().mark((function r(){var n,i,o,a,s,c,u,l,d,f,p,v,y,h,m,g,b,S,x,w,I,$,T;return L().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return n=e.length>0&&void 0!==e[0]&&e[0],r.prev=1,i=Object.assign({},t.surveyEdit),o=Object.assign({},t.surveyEdit),delete o.id,n||delete o.integrityId,o.name=t.newSurveyName,t.totalSteps=i.questionSectionList.reduce((function(e,t){return e+t.questions.length+1}),1),t.totalSections=i.questionSectionList.length,t.totalQuestions=0,t.currentStep=0,t.currentSectionIndex=0,t.currentQuestionIndex=0,r.next=15,t.saveSurvey([o,-1,null,null,t.$toast,!1]).catch((function(e){n?t.dialogVersionVisible=!1:t.dialogDuplicateVisible=!1,console.error("Error duplicating survey:",e)}));case 15:if(a=r.sent,a){r.next=18;break}throw new Error("Survey creation failed");case 18:s=new Map,c=N(i.questionSectionList),r.prev=20,c.s();case 22:if((u=c.n()).done){r.next=74;break}return l=u.value,t.currentSectionIndex++,t.totalQuestions=l.questions.length,t.currentQuestionIndex=0,d=Object.assign({},l),delete d.id,d.surveyId=a.id,d.questions=[],d.responsables=D(l.responsables),t.currentSectionStatus="".concat(k["a"].t("survey.titles.duplicatingSurvey")," ").concat(l.name),t.currentStep++,t.currentSectionStep++,t.progress=t.currentStep/t.totalSteps*100,r.next=38,t.saveSection([d,-1,t.$toast,!1]).catch((function(e){n?t.dialogVersionVisible=!1:t.dialogDuplicateVisible=!1,console.error("Error duplicating section:",e)}));case 38:if(f=r.sent,f){r.next=41;break}throw new Error("Section creation failed");case 41:p=N(l.questions),r.prev=42,p.s();case 44:if((v=p.n()).done){r.next=64;break}return y=v.value,t.currentQuestionIndex++,h=_.cloneDeep(y),delete h.id,h.questionSectionId=f.id,t.currentQuestionStatus="".concat(k["a"].t("survey.titles.duplicatingQuestion")," ").concat(y.question),t.currentStep++,t.currentQuestionStep++,t.progress=t.currentStep/t.totalSteps*100,r.next=56,t.saveQuestion([F(F({},h),{},{company:{id:t.profile.company_id}}),-1,t.$toast,!1]).catch((function(e){n?t.dialogVersionVisible=!1:t.dialogDuplicateVisible=!1,console.error("Error duplicating question:",e)}));case 56:if(m=r.sent,!m){r.next=61;break}s.set(y.id,m.id),r.next=62;break;case 61:throw new Error("Question creation failed");case 62:r.next=44;break;case 64:r.next=69;break;case 66:r.prev=66,r.t0=r["catch"](42),p.e(r.t0);case 69:return r.prev=69,p.f(),r.finish(69);case 72:r.next=22;break;case 74:r.next=79;break;case 76:r.prev=76,r.t1=r["catch"](20),c.e(r.t1);case 79:return r.prev=79,c.f(),r.finish(79);case 82:return r.next=84,t.fetchSurveyById([a.id,t.$toast]).catch((function(e){console.error("Error fetching duplicated survey:",e)}));case 84:if(t.surveyEdit&&t.surveyEdit.questionSectionList){r.next=86;break}throw new Error("Failed to fetch duplicated survey or survey structure is incorrect");case 86:g=N(t.surveyEdit.questionSectionList),r.prev=87,g.s();case 89:if((b=g.n()).done){r.next=117;break}S=b.value,x=N(S.questions),r.prev=92,x.s();case 94:if((w=x.n()).done){r.next=107;break}if(I=w.value,!I.extraQuestionFatherRef){r.next=105;break}if($=I.extraQuestionFatherRef.id,T=s.get($),!T){r.next=105;break}return I.possibleAnswer&&(I.possibleAnswer=I.possibleAnswer.map((function(e,t){return F(F({},e),{},{id:t+1})}))),I.extraQuestionFatherRef.id=T,t.currentQuestionStatus="".concat(k["a"].t("survey.titles.updatingQuestionFatherRef"),": ").concat(I.question),r.next=105,t.saveQuestion([F(F({},I),{},{company:{id:t.profile.company_id}}),I.id,t.$toast,!1]).catch((function(e){console.error("Error updating question with new father reference:",e)}));case 105:r.next=94;break;case 107:r.next=112;break;case 109:r.prev=109,r.t2=r["catch"](92),x.e(r.t2);case 112:return r.prev=112,x.f(),r.finish(112);case 115:r.next=89;break;case 117:r.next=122;break;case 119:r.prev=119,r.t3=r["catch"](87),g.e(r.t3);case 122:return r.prev=122,g.f(),r.finish(122);case 125:return n?t.dialogVersionVisible=!1:t.dialogDuplicateVisible=!1,t.clearHandleSurveyForm(),t.surveySelected=null,t.$store.commit("survey/SET_SURVEY_BY_ID",null),r.abrupt("return",a.id);case 132:r.prev=132,r.t4=r["catch"](1),console.error("Error handling survey duplication:",r.t4),t.dialogDuplicateVisible=!1,n&&(t.dialogVersionVisible=!1);case 137:case"end":return r.stop()}}),r,null,[[1,132],[20,76,79,82],[42,66,69,72],[87,119,122,125],[92,109,112,115]])})))()},clearHandleSurveyForm:function(){this.progress=0,this.currentStatus="",this.currentSectionStatus="",this.currentQuestionStatus="",this.totalSteps=0,this.currentStep=0,this.currentQuestionStep=0,this.currentSectionStep=0,this.currentSectionIndex=0,this.currentQuestionIndex=0,this.totalSections=0,this.totalQuestions=0,this.isFetchingSurvey=!1},checkSurveyNameUniqueness:function(){var e=this,t=this.surveyTemplateList.some((function(t){return t.name===e.newSurveyName}));this.isNameUnique=!t,this.nameErrorMessages=t?[k["a"].t("survey.titles.duplicatedSurveyName")]:[],this.dialogNameCheckVisible=!0},initiateSurveyDuplication:function(e){this.surveySelected=F({},e),this.newSurveyName="".concat(e.name),this.checkSurveyNameUniqueness()},initiateSurveyVersioning:function(e){this.surveySelected=F({},e),this.newSurveyName="".concat(e.name),this.versioningItem()},cancelCheckNameDialog:function(){this.dialogNameCheckVisible=!1,this.nameErrorMessages=[],this.newSurveyName="",this.isNameUnique=!1},duplicateItem:function(){var e=this;return V(L().mark((function t(){return L().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.dialogNameCheckVisible=!1,e.dialogDuplicateVisible=!0,e.isFetchingSurvey=!0,e.currentStatus="".concat(e.$t("survey.titles.fetchingTemplate")," ").concat(e.surveySelected.name),t.next=6,e.fetchSurveyById([e.surveySelected.id,e.$toast]).finally((function(){e.isFetchingSurvey=!1}));case 6:return e.currentStatus="".concat(e.$t("survey.titles.initializedProcess")," ").concat(e.surveySelected.name),t.next=9,e.handleDuplicateSurvey(!1);case 9:return t.next=11,e.getSurveyTemplate();case 11:case"end":return t.stop()}}),t)})))()},versioningItem:function(){var e=this;return V(L().mark((function t(){var r;return L().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.dialogVersionVisible=!0,e.isFetchingSurvey=!0,e.currentStatus="".concat(e.$t("survey.titles.fetchingTemplate")," ").concat(e.surveySelected.name),t.next=5,e.fetchSurveyById([e.surveySelected.id,e.$toast]).finally((function(){e.isFetchingSurvey=!1}));case 5:return e.currentStatus="".concat(e.$t("survey.titles.initializedProcess")," ").concat(e.surveySelected.name),t.next=8,e.handleDuplicateSurvey(!0);case 8:r=t.sent,console.log(r),e.editItem({id:r});case 11:case"end":return t.stop()}}),t)})))()},deleteItem:function(e){var t=this;return V(L().mark((function r(){return L().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,t.deleteSurvey([e.id,t.$toast]);case 2:return r.next=4,t.getSurveyTemplate();case 4:case"end":return r.stop()}}),r)})))()},publish:function(e){var t=this;return V(L().mark((function r(){var n;return L().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return n={surveyStateType:"PUBLISHED",surveyId:e.id},r.next=3,t.changeStateSurvey(n,"save");case 3:return r.next=5,t.getSurveyTemplate();case 5:case"end":return r.stop()}}),r)})))()},changePublishStage:function(e){var t=this,r={surveyStateType:"EDITING",surveyId:e.id};this.changeStateSurvey(r,"save").finally((function(){t.error?t.errorOFF():t.editItem(e)}))},changeStateSurvey:function(e,t){var r=this;return V(L().mark((function n(){return L().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,r.change_state([e,r.$toast,t]);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})))()},check:function(e){return $["a"].check(e)},checkAdmin:function(){return $["a"].checkAdmin()},dialogShow:function(e){this.title=e.title,this.dialogText=e.dialogText,this.$refs.dialogConfirm.openDialog()},dialogClose:function(){this.$refs.dialogConfirm.dialogClose()},replace:function(e){e.currentTarget.value=e.currentTarget.value.toString().replaceAll('"',""),this.search=e.currentTarget.value.toString().replaceAll('"',"")}}),destroyed:function(){this.$root.$off("deleteItem"),this.$root.$off("initiateSurveyDuplication"),this.$root.$off("initiateSurveyVersioning"),this.$root.$off("changePublishStage")}},M=H,z=(r("3869e"),r("2877")),J=Object(z["a"])(M,x,w,!1,null,"78b0e8ea",null);t["default"]=J.exports},"96ec":function(e,t,r){"use strict";var n=r("8336"),i=r("b0af"),o=r("99d9"),a=r("169a"),s=r("132d"),c=r("2fa4"),u=r("3a2f");function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){p(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e,t,r){return(t=v(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(e){var t=y(e,"string");return"symbol"==l(t)?t:t+""}function y(e,t){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var h=function(){var e=this,t=e._self._c;return t(a["a"],{attrs:{persistent:"",width:"540px"},scopedSlots:e._u([{key:"activator",fn:function(r){var i=r.on;return[e.isBtn?t(n["a"],e._g(e._b({class:"".concat(e.styles),attrs:{disabled:e.valid,loading:e.loading,icon:e.isIcon,tile:e.tile,block:e.block,"max-height":e.maxHeight,height:e.height,"x-small":e.xSmall,fab:e.fab}},"v-btn",e.frBtnProps,!1),i),[e.wIcon?t(s["a"],{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],attrs:{small:e.iSmall,left:e.iLeft,right:e.iRight,color:e.iColor}},[e._v(" "+e._s(e.btnIcon)+" ")]):e._e(),e._v(" "+e._s(e.btnTitle)+" ")],1):e.isTooltip&&e.isIcon?t(u["a"],{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(r){var n=r.on;return[e.loading?e._e():t(s["a"],e._g({directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],class:"".concat(e.styles),attrs:{small:"",left:e.iLeft,right:e.iRight,color:e.iColor,disabled:e.valid}},f(f({},i),n)),[e._v(" "+e._s(e.btnIcon)+" ")]),e._t("loading")]}}],null,!0)},[t("span",[e._v(" "+e._s(e.tpText)+" "),t("span",{staticStyle:{"font-size":"12px",color:"#aaaaaa"}},[e._v(" "+e._s(e.tsText)+" ")])])]):e.isIcon?t(s["a"],e._g({attrs:{small:"",left:e.iLeft,right:e.iRight,color:e.iColor}},i),[e._v(" "+e._s(e.btnIcon)+" ")]):e._e()]}}]),model:{value:e.showDialog,callback:function(t){e.showDialog=t},expression:"showDialog"}},[t(i["a"],[t(o["e"],{staticClass:"headline secondary t-bw-secondary--text"},[e._v(e._s(e.title))]),t(o["d"],{staticClass:"pa-6"},[e._v(e._s(e.dialogText))]),t(o["b"],{staticClass:"pa-6"},[t(c["a"]),t(n["a"],{attrs:{small:"",text:"",color:"neuter"},on:{click:function(t){return e.closeDialog()}}},[e._v(" "+e._s(e.$t("general.buttons.cancel"))+" ")]),t(n["a"],e._b({attrs:{small:""},on:{click:function(t){return e.confirmDialog()}}},"v-btn",e.frBtnProps,!1),[e._v(" "+e._s(e.$t("general.buttons.confirm"))+" ")])],1)],1)],1)},m=[],g=r("fe0b"),b={name:"ConfirmDialog",props:{item:{type:Object,required:!1},items:{type:Array,required:!1},show:{type:Boolean,required:!1,default:!0},btnIcon:{type:String,required:!1},iLeft:{type:Boolean,default:!1},iRight:{type:Boolean,default:!1},iColor:{type:String,default:"neuter"},isIcon:{type:Boolean,required:!1},wIcon:{type:Boolean,required:!1},text:{type:Boolean,required:!1,default:!0},isBtn:{type:Boolean,required:!0},tpText:{type:String,required:!1},tsText:{type:String,required:!1},isTooltip:{type:Boolean,required:!1},btnTitle:{type:String,require:!1},frBtnProps:{type:Object,required:!1,default:function(){return{small:!0,color:"primary",textColor:"t-bw-primary--text",elevation:0,text:!1}}},styles:{type:String,required:!1},title:{type:String,required:!1,default:g["a"].t("general.titles.titleGenericDialog")},dialogText:{type:String,required:!1,default:g["a"].t("general.titles.descriptionGenericDialog")},action:{type:String,required:!0},loading:{type:Boolean,required:!1},valid:{type:Boolean,required:!1},tile:{type:Boolean,required:!1},xSmall:{type:Boolean,required:!1},iSmall:{type:Boolean,required:!1},small:{type:Boolean,required:!1},elevation:{type:Number,required:!1},block:{type:Boolean,required:!1},fab:{type:Boolean,required:!1},maxHeight:{type:String,required:!1},height:{type:String,required:!1}},data:function(){return{showDialog:!1}},methods:{openDialog:function(){this.showDialog=!0},closeDialog:function(){this.showDialog=!1},confirmDialog:function(){console.log(this.action),this.$root.$emit(this.action,this.item||this.items),this.closeDialog()}}},S=b,x=r("2877"),_=Object(x["a"])(S,h,m,!1,null,null,null);t["a"]=_.exports}}]);
//# sourceMappingURL=chunk-5a766c00.fffaff1e.js.map