Server : Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6 System : Windows NT USER-PC 6.1 build 7601 (Windows 7 Professional Edition Service Pack 1) AMD64 User : User ( 0) PHP Version : 7.4.6 Disable Function : NONE Directory : C:/Program Files/Avast Software/Avast/gui_resources/default_av/ |
//{"name":"FeedbackForm","version":"1.2.165","created":"2021-03-09T09:30:18.022Z"} import e from"./ractive.js";import{windowApi as t,serviceRequest as r,eventer as n}from"./napi.js";import{productModel as o,settingsService as s}from"./napiExtensions.js";import{nls as i,format as a}from"./i18n.js";import{modals as l}from"./ractiveComponents.js";import{stringUtils as c}from"./libs.js";var d=".ffo {\n text-align: center;\n}\n.ffo.disabled .h2,\n.ffo.disabled .h4,\n.ffo.disabled label {\n opacity: 0.3;\n}\n.ffo .ffo_form {\n width: 80%;\n margin: 0 auto;\n max-width: 500px;\n padding: 2rem 0;\n}\n.ffo .ffo_form input[type='text'],\n.ffo .ffo_form textarea {\n display: block;\n width: 100%;\n resize: none;\n white-space: break-spaces;\n}\n.ffo .ffo_radios {\n text-align: start;\n margin-bottom: 20px;\n}\n.ffo .ffo_error {\n min-height: 2em;\n}\n.ffo .ffo_submit {\n min-height: 4rem;\n}\n";const f=e.extend({template:{v:3,t:[{t:7,e:"div",a:{class:["ffo ",{t:2,x:{r:["state"],s:'_0!="ready"?"disabled":""'}}]},f:[{t:7,e:"h2",a:{class:"h2 -margins"},f:[{t:3,x:{r:["nls"],s:'_0("feedbackForm.submit")'}}]}," ",{t:7,e:"h4",a:{class:"h4"},f:[{t:3,x:{r:["nls"],s:'_0("feedbackForm.subtitle")'}}]}," ",{t:7,e:"fieldset",m:[{t:2,x:{r:["state"],s:'_0!="ready"?"disabled":""'}}],f:[{t:7,e:"form",a:{name:"form",class:"ffo_form"},f:[{t:7,e:"div",a:{class:"ffo_radios"},f:[{t:7,e:"input",a:{id:"bug",type:"radio",class:"radio",name:[{t:2,r:"feedbackType"}],value:"bug"}}," ",{t:7,e:"label",a:{class:"radio__label",for:"bug"},f:[{t:3,x:{r:["nls"],s:'_0("feedbackForm.report.bug")'}}]}," ",{t:7,e:"br"}," ",{t:7,e:"input",a:{id:"feedback",type:"radio",class:"radio g-margin-top--5",name:[{t:2,r:"feedbackType"}],value:"feedback"}}," ",{t:7,e:"label",a:{class:"radio__label",for:"feedback"},f:[{t:3,x:{r:["nls"],s:'_0("feedbackForm.report.feedback")'}}]}]}," ",{t:7,e:"textarea",o:"eventHandler",a:{class:["input ",{t:2,x:{r:["invalidReport"],s:'_0?"-error":""'}}],placeholder:[{t:3,x:{r:["nls"],s:'_0("feedbackForm.report.placeholder")'}}],rows:"6",value:[{t:2,r:"userReport"}]},v:{focus:"clearError",blur:{n:"validateReport",d:[{t:2,r:"userReport"}]}}}," ",{t:7,e:"div",a:{class:"form__error ffo_error"},f:[{t:4,f:[{t:7,e:"kin-icon",a:{name:"badge-critical",size:"16"}}," ",{t:3,x:{r:["nls"],s:'_0("feedbackForm.report.error")'}}],n:50,r:"invalidReport"}]}]}]}," ",{t:7,e:"div",a:{class:"ffo_submit"},f:[{t:4,f:[{t:7,e:"p",a:{class:"p"},f:[{t:7,e:"kin-icon",a:{name:"circle-ok",size:"24",class:"g-margin-right--5"}}," ",{t:3,x:{r:["nls"],s:'_0("feedbackForm.sending.success")'}}]}],n:50,x:{r:["state"],s:'_0==="sendingSuccess"'}},{t:4,n:51,f:[{t:4,n:50,x:{r:["state"],s:'_0==="sendingError"'},f:[{t:7,e:"p",a:{class:"p"},f:[{t:7,e:"kin-icon",a:{name:"circle-critical",size:"24",class:"g-margin-right--5"}}," ",{t:3,x:{r:["nls"],s:'_0("feedbackForm.sending.error")'}}]}]},{t:4,n:50,x:{r:["state"],s:'(!(_0==="sendingError"))&&(_0==="sendingInProgress")'},f:[" ",{t:7,e:"Button",a:{cssCls:"-loading"},f:[{t:3,x:{r:["nls"],s:'_0("feedbackForm.submit")'}}]}]},{t:4,n:50,x:{r:["state"],s:'(!(_0==="sendingError"))&&(!(_0==="sendingInProgress"))'},f:[" ",{t:7,e:"Button",v:{domClick:"sendFeedback"},f:[{t:3,x:{r:["nls"],s:'_0("feedbackForm.submit")'}}]}]}],x:{r:["state"],s:'_0==="sendingSuccess"'}}]}," ",{t:7,e:"div",a:{class:"text -tiny g-margin-top--10"},f:[{t:3,r:"footnoteText"}]}]}]},css:d,data:()=>({feedbackType:"bug",userReport:"",invalidReport:!1,state:"ready",footnoteText:""}),oninit(){const e=t.getUrlParams();this.set("feedbackType",e.feedbackType||"bug"),this.observe("state",(e=>this.fire("feedbackFormStateChanged",e))),this.on("sendFeedback",this._sendFeedback),this.on("validateReport",((e,t)=>{this._validateReport(t)})),this.on("clearError",(()=>{this.set("invalidReport",!1)})),this._prepareFootnoteText()},_validateReport(e){this.set("invalidReport",!e.match(/\w+|\d+/g))},_sendFeedback(){const e=this.get("userReport"),t=this.get("feedbackType");this._validateReport(e),this.get("invalidReport")||(this.set("state","sendingInProgress"),r("app.utils.SubmitFeedback",{type:t,content:e}).then((()=>{this._feedbackSent()})).catch((e=>{this.set("state","sendingError"),console.error("app.utils.SubmitFeedback error",JSON.stringify(e))})))},_feedbackSent(){this.set("state","sendingSuccess"),this.closeDialogTimeout||(this.closeDialogTimeout=setTimeout((()=>{this._clearCloseDialogTimeout(),this.fire("feedbackFormClose")}),2e3))},_clearCloseDialogTimeout(){this.closeDialogTimeout&&(clearTimeout(this.closeDialogTimeout),this.closeDialogTimeout=null)},_prepareFootnoteText(){const e=this._getSupportUrl(),t=this._urlToText(i("feedbackForm.footnote.text"),e);this.set("footnoteText",t)},_getSupportUrl(){const e=o.getProduct(),t=o.getUserConfig().language;let r="avast";"avg_business"===e?r="avg_smb":0===e.indexOf("avg_")?r="avg":0===e.indexOf("business")&&(r="avast_smb");return{avast:"https://support.avast.com/?l="+t,avast_smb:"https://www.avast.com/business-support",avg:"https://support.avg.com/?l="+t,avg_smb:"https://support.avg.com/business"}[r]},_urlToText:(e,t)=>e.replace(new RegExp("{URL_START}(.+?){URL_END}"),"<a onclick=\"NAPI.track.event('Feedback', 'Click', 'SupportCenter');NAPI.request('av.command', 'shell_exec:open:"+t+'\')" class="a">$1</a>'),onteardown(){this._clearCloseDialogTimeout()}}),p=e.extend({template:{v:3,t:[{t:7,e:"header",a:{class:"nui_titlebar -toaster nui_caption"},f:[{t:7,e:"h1",a:{class:"nui_logo"},f:[{t:7,e:"span",a:{class:"logo -white -width-70"}}]}," ",{t:7,e:"div",a:{class:"nui_controls"},f:[{t:7,e:"button",a:{disabled:[{t:2,r:"preventClose"}],"data-test":"feedback-modal-close",class:"nui_controls__item -close nui_caption_client",title:[{t:2,x:{r:["nls"],s:'_0("global.close")'}}]},v:{click:"Modal.close"},f:[{t:7,e:"Icon",a:{name:"titlebar-close"}}]}]}]}," ",{t:7,e:"section",a:{class:"nui_main -toaster"},f:[{t:7,e:"Form"}]}]},css:d,components:{Form:f},data:()=>({windowWidth:570,windowHeight:490,preventClose:!1}),oninit(){this.on("Modal.close",this._closeModal),this.on("Form.feedbackFormClose",this._closeModal),this.on("Form.feedbackFormStateChanged",(e=>{this.set("preventClose","sendingInProgress"===e)}))},_closeModal(){t.close()}});const u=e.extend({template:{v:3,t:[{t:7,e:"div",a:{class:[{t:2,x:{r:["isModal"],s:'!_0?"window-content":""'}}]},o:"observeMutation",f:[{t:4,f:[{t:7,e:"header",a:{class:"nui_titlebar -toaster nui_caption"},f:[{t:7,e:"h1",a:{class:"nui_logo"},f:[{t:7,e:"span",a:{class:"logo -white -width-70"}}]}," ",{t:7,e:"div",a:{class:"nui_controls"},f:[{t:7,e:"button",a:{disabled:[{t:2,x:{r:["state"],s:'_0!=="ready"'}}],class:"nui_controls__item -close nui_caption_client","data-test":"close",title:[{t:3,x:{r:["nls"],s:'_0("global.close")'}}]},v:{click:"Modal.close"},f:[{t:7,e:"Icon",a:{name:"titlebar-close"}}]}]}]}],n:50,x:{r:["isModal"],s:"!_0"}}," ",{t:7,e:"div",a:{class:["ffo ",{t:2,x:{r:["isModal"],s:'!_0?"-toaster":""'}}]},f:[{t:4,f:[{t:7,e:"h2",a:{class:"h2 -margins"},f:[{t:3,x:{r:["nls"],s:'_0("sendAnalysis.title")'}}]}," ",{t:7,e:"h4",a:{class:"h4"},f:[{t:2,r:"currentThreat.filePath"}]}," ",{t:7,e:"fieldset",a:{disabled:[{t:2,x:{r:["state"],s:'_0!=="ready"'}}]},f:[{t:7,e:"form",a:{name:"form",class:"ffo_form"},f:[{t:7,e:"div",a:{class:"ffo_radios"},f:[{t:7,e:"input",a:{id:"bug",type:"radio",class:"radio",name:[{t:2,r:"analysisType"}],value:"0"}}," ",{t:7,e:"label",a:{class:"radio__label",for:"bug"},f:[{t:3,x:{r:["nls"],s:'_0("sendAnalysis.radio.option0")'}}]}," ",{t:7,e:"br"}," ",{t:7,e:"input",a:{id:"feedback",type:"radio",class:"radio g-margin-top--5",name:[{t:2,r:"analysisType"}],value:"1"}}," ",{t:7,e:"label",a:{class:"radio__label",for:"feedback"},f:[{t:3,x:{r:["nls"],s:'_0("sendAnalysis.radio.option1")'}}]}]}," ",{t:7,e:"textarea",o:"eventHandler",a:{class:["input ",{t:2,x:{r:["invalidReport"],s:'_0?"-error":""'}}],placeholder:[{t:3,x:{r:["nls"],s:'_0("sendAnalysis.textarea.caption")'}}],rows:"6",value:[{t:2,r:"userReport"}]},v:{focus:{n:"clearError",a:"report"},blur:{n:"validateReport",d:[{t:2,r:"userReport"}]}}}," ",{t:7,e:"div",a:{class:"form__error ffo_error"},f:[{t:4,f:[{t:7,e:"kin-icon",a:{name:"badge-critical",size:"16"}}," ",{t:3,x:{r:["nls"],s:'_0("feedbackForm.report.error")'}}],n:50,r:"invalidReport"}]}]}]}," ",{t:7,e:"div",a:{class:"ffo_submit"},f:[{t:4,f:[{t:7,e:"p",a:{class:"color-ok -text"},f:[{t:7,e:"Icon",a:{name:"tick",cssCls:"ffo_result"}}," ",{t:3,x:{r:["nls"],s:'_0("global.sent")'}}," ",{t:4,f:[{t:7,e:"button",a:{class:"btn -secondary disabled g-margin-left--10",disabled:"disabled"},f:[{t:3,x:{r:["nls"],s:'_0("global.skip")'}}]}],n:50,r:"threats.length"}," ",{t:7,e:"button",a:{class:"btn -secondary disabled g-margin-left--10",disabled:"disabled"},f:[{t:3,x:{r:["nls"],s:'_0("global.cancel")'}}]}]}],n:50,x:{r:["state"],s:'_0==="sendingSuccess"'}},{t:4,n:51,f:[{t:4,n:50,x:{r:["state"],s:'_0==="sendingError"'},f:[{t:7,e:"p",a:{class:"color-critical -text"},f:[{t:7,e:"Icon",a:{name:"exclamation",cssCls:"ffo_result"}}," ",{t:3,x:{r:["nls"],s:'_0("feedbackForm.sending.error")'}}]}]},{t:4,n:50,x:{r:["state"],s:'!(_0==="sendingError")'},f:[" ",{t:7,e:"button",v:{click:"send"},a:{class:["btn ",{t:2,x:{r:["state"],s:'_0==="sendingInProgress"?"-loading":""'}}],disabled:[{t:2,x:{r:["state"],s:'_0==="sendingInProgress"'}}]},f:[{t:3,x:{r:["nls"],s:'_0("global.send")'}}]}," ",{t:4,f:[{t:7,e:"button",v:{click:"skip"},a:{class:"btn -secondary g-margin-left--10"},f:[{t:3,x:{r:["nls"],s:'_0("global.skip")'}}]}],n:50,r:"threats.length"}," ",{t:7,e:"button",v:{click:"close"},a:{class:"btn -secondary g-margin-left--10"},f:[{t:3,x:{r:["nls"],s:'_0("global.cancel")'}}]}]}],x:{r:["state"],s:'_0==="sendingSuccess"'}}]}],n:50,r:"currentThreat"},{t:4,n:51,f:[{t:7,e:"h3",a:{class:"h3 modal__title -text"},f:[{t:3,x:{r:["nls"],s:'_0("sendAnalysis.modal.title")'}}]}," ",{t:7,e:"p",a:{class:"p"},f:[{t:3,x:{r:["nls","threatsSent"],s:'_0("sendAnalysis.modal.subtitle",_1)'}}]}," ",{t:7,e:"div",a:{class:"modal__actions"},f:[{t:7,e:"button",a:{type:"button",class:"btn -secondary -small"},v:{click:"close"},f:[{t:3,x:{r:["nls"],s:'_0("global.close")'}}]}]}],r:"currentThreat"}]}]}]},css:".ffo {\n text-align: center;\n}\n.ffo .h4 {\n word-break: break-all;\n}\n.ffo .ffo_form {\n width: 80%;\n margin: 20px auto;\n max-width: 500px;\n}\n.ffo .ffo_form input[type='text'],\n.ffo .ffo_form textarea {\n display: block;\n width: 100%;\n resize: none;\n}\n.ffo .ffo_form:disabled {\n opacity: 0.3;\n}\n.ffo .ffo_radios {\n text-align: left;\n margin-bottom: 20px;\n}\n.ffo .ffo_error {\n min-height: 2em;\n}\n.ffo .ffo_submit {\n min-height: 4rem;\n}\n.ffo .ffo_submit button {\n margin-right: 5px;\n}\n.ffo .ffo_submit button:last-child {\n margin-right: 0;\n}\n.ffo .ffo_result {\n font-size: 20px;\n border-radius: 100px;\n border: solid 1px;\n width: 33px;\n height: 33px;\n line-height: 30px;\n text-align: center;\n}\n.window-content .modal__actions,\n.window-content .ffo_submit {\n margin-bottom: 20px;\n}\n",data:()=>({windowWidth:570,windowHeight:430,state:"ready",analysisType:1,threatsSent:0,userReport:""}),decorators:{observeMutation:function(e){const t=new MutationObserver(this.adjustWindowHeight.bind(this));return t.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),this.adjustWindowHeight(),{teardown:function(){t.disconnect()}}}},adjustWindowHeight(){const e=this.find(".window-content");e&&this.set("windowHeight",e.scrollHeight)},onconfig(){const e=this.get("params")||{},t=void 0===e.analysisType?this.get("analysisType"):+e.analysisType,r="string"==typeof e.threats?JSON.parse(decodeURIComponent(e.threats)):e.threats,n=!!e.isModal;this.set({analysisType:t>=0&&t<=1?t:1,threats:r,isModal:n}),this._showNextThreat()},oninit(){this.timeout="",this._setListeners()},_setListeners(){this.on("send",this._sendForAnalysis),this.on("skip",this._showNextThreat),this.on("Modal.close",this._closeModal),this.on("close",this._closeModal),this.on("clearError",(()=>{this.set("invalidReport",!1)}))},_closeModal(){"sendingInProgress"!==this.get("state")&&(this.get("isModal")?this.fire("AnalysisClose"):t.close())},_sendForAnalysis(){const e=this.get("userReport"),t=this.get("currentThreat");e.match(/\w+|\d+/g)?(this.set({state:"sendingInProgress"}),r("app.utils.SendFileForAnalysis",{analysisType:+this.get("analysisType"),userContent:e,threat:{itemUID:t.itemUID,filePath:t.filePath}}).catch((e=>{console.error("[Feedback] {analyis} Submit failed:",JSON.stringify(e))})).then((()=>{this.set({state:"sendingSuccess"}),this.add("threatsSent"),this.timeout=setTimeout((()=>{this.set({state:"ready"}),this._showNextThreat()}),2e3)}))):this.set({invalidReport:!0})},_showNextThreat(){const e=this.get("threats").pop();e&&e.dirPath&&(e.filePath=e.dirPath+"\\"+e.name),this.set({currentThreat:e,userReport:""})},onteardown(){clearTimeout(this.timeout)}});function m(){}function h(e){return e()}function g(){return Object.create(null)}function b(e){e.forEach(h)}function _(e){return"function"==typeof e}function v(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function x(e,t){e.appendChild(t)}function y(e,t,r){e.insertBefore(t,r||null)}function k(e){e.parentNode.removeChild(e)}function w(e){return document.createElement(e)}function R(e){return document.createTextNode(e)}function T(){return R(" ")}function $(e,t,r,n){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}function F(e,t,r){null==r?e.removeAttribute(t):e.getAttribute(t)!==r&&e.setAttribute(t,r)}function C(e,t,r){t in e?e[t]=r:F(e,t,r)}function S(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function M(e,t){e.value=null==t?"":t}class E{constructor(e=null){this.a=e,this.e=this.n=null}m(e,t,r=null){this.e||(this.e=w(t.nodeName),this.t=t,this.h(e)),this.i(r)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)y(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(k)}}let I;function P(e){I=e}function j(e){(function(){if(!I)throw new Error("Function called outside component initialization");return I})().$$.on_destroy.push(e)}const N=[],D=[],A=[],z=[],O=Promise.resolve();let H=!1;function W(e){A.push(e)}let L=!1;const U=new Set;function B(){if(!L){L=!0;do{for(let e=0;e<N.length;e+=1){const t=N[e];P(t),G(t.$$)}for(P(null),N.length=0;D.length;)D.pop()();for(let e=0;e<A.length;e+=1){const t=A[e];U.has(t)||(U.add(t),t())}A.length=0}while(N.length);for(;z.length;)z.pop()();H=!1,L=!1,U.clear()}}function G(e){if(null!==e.fragment){e.update(),b(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(W)}}const J=new Set;function q(e,t){-1===e.$$.dirty[0]&&(N.push(e),H||(H=!0,O.then(B)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function V(e,t,r,n,o,s,i=[-1]){const a=I;P(e);const l=t.props||{},c=e.$$={fragment:null,ctx:null,props:s,update:m,not_equal:o,bound:g(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:[]),callbacks:g(),dirty:i,skip_bound:!1};let d=!1;if(c.ctx=r?r(e,l,((t,r,...n)=>{const s=n.length?n[0]:r;return c.ctx&&o(c.ctx[t],c.ctx[t]=s)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](s),d&&q(e,t)),r})):[],c.update(),d=!0,b(c.before_update),c.fragment=!!n&&n(c.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);c.fragment&&c.fragment.l(e),e.forEach(k)}else c.fragment&&c.fragment.c();t.intro&&((f=e.$$.fragment)&&f.i&&(J.delete(f),f.i(p))),function(e,t,r){const{fragment:n,on_mount:o,on_destroy:s,after_update:i}=e.$$;n&&n.m(t,r),W((()=>{const t=o.map(h).filter(_);s?s.push(...t):b(t),e.$$.on_mount=[]})),i.forEach(W)}(e,t.target,t.anchor),B()}var f,p;P(a)}var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Z=/^\s+|\s+$/g,K=/^[-+]0x[0-9a-f]+$/i,Q=/^0b[01]+$/i,X=/^0o[0-7]+$/i,ee=parseInt,te="object"==typeof Y&&Y&&Y.Object===Object&&Y,re="object"==typeof self&&self&&self.Object===Object&&self,ne=te||re||Function("return this")(),oe=Object.prototype.toString,se=Math.max,ie=Math.min,ae=function(){return ne.Date.now()};function le(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ce(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==oe.call(e)}(e))return NaN;if(le(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=le(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Z,"");var r=Q.test(e);return r||X.test(e)?ee(e.slice(2),r?2:8):K.test(e)?NaN:+e}var de=function(e,t,r){var n,o,s,i,a,l,c=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function u(t){var r=n,s=o;return n=o=void 0,c=t,i=e.apply(s,r)}function m(e){return c=e,a=setTimeout(g,t),d?u(e):i}function h(e){var r=e-l;return void 0===l||r>=t||r<0||f&&e-c>=s}function g(){var e=ae();if(h(e))return b(e);a=setTimeout(g,function(e){var r=t-(e-l);return f?ie(r,s-(e-c)):r}(e))}function b(e){return a=void 0,p&&n?u(e):(n=o=void 0,i)}function _(){var e=ae(),r=h(e);if(n=arguments,o=this,l=e,r){if(void 0===a)return m(l);if(f)return a=setTimeout(g,t),u(l)}return void 0===a&&(a=setTimeout(g,t)),i}return t=ce(t)||0,le(r)&&(d=!!r.leading,s=(f="maxWait"in r)?se(ce(r.maxWait)||0,t):s,p="trailing"in r?!!r.trailing:p),_.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=l=o=a=void 0},_.flush=function(){return void 0===a?i:b(ae())},_};function fe(e){let t,r,n,o,s;return{c(){t=w("button"),r=w("kin-icon"),C(r,"name","minimize"),C(r,"size","16"),F(t,"class","nui_controls__item -minimize nui_caption_client"),F(t,"title",n=i("global.minimize"))},m(n,i){y(n,t,i),x(t,r),o||(s=$(t,"click",e[15]),o=!0)},p:m,d(e){e&&k(t),o=!1,s()}}}function pe(e){let t,r,n,o,s,a,l,c,d,f,p,u,m,h,g,_,v,S,I,P,j,N,D,A,z,O,H,W,L,U,B,G=i("performanceReporter.desc",e[8])+"",J=i("performanceReporter.whatWeRecord.tooltip.list")+"",q=i("performanceReporter.whatWeDontRecord.tooltip.list")+"",V=i("performanceReporter.startRecording")+"",Y=e[4]&&be(e);return{c(){t=w("h2"),t.textContent=`${i("performanceReporter.title")}`,r=T(),n=w("div"),s=T(),a=w("kin-tooltip"),l=w("div"),c=w("button"),c.textContent=`${i("performanceReporter.whatDoWeRecord")}`,d=T(),f=w("div"),p=w("p"),p.textContent=`${i("performanceReporter.whatWeRecord.tooltip.title")}`,u=T(),m=w("ul"),h=T(),g=w("p"),g.textContent=`${i("performanceReporter.whatWeDontRecord.tooltip.title")}`,_=T(),v=w("ul"),S=T(),I=w("form"),P=w("textarea"),N=T(),D=w("div"),Y&&Y.c(),A=T(),z=w("div"),O=w("kin-button"),H=R(V),W=T(),L=w("div"),L.textContent=`${i("performanceReporter.footnote")}`,F(t,"class","h2 -margins"),o=new E(s),F(c,"class","a"),F(l,"slot","tooltip-activator"),F(p,"class","p g-margin-top--20 g-font--bold -small"),F(m,"class","list"),F(g,"class","p g-margin-top--20 g-font--bold -small"),F(v,"class","list"),F(f,"slot","tooltip"),F(n,"class","p"),F(P,"class","input svelte-15uir2i"),F(P,"placeholder",j=i("performanceReporter.describeYourProblemHere")),F(P,"rows","6"),F(D,"class","form__error pre_error svelte-15uir2i"),F(I,"name","form"),F(I,"class","pre_form svelte-15uir2i"),C(O,"processing",e[7]),F(z,"class","pre_submit svelte-15uir2i"),F(L,"class","text -tiny pre_footnote svelte-15uir2i")},m(i,b){y(i,t,b),y(i,r,b),y(i,n,b),o.m(G,n),x(n,s),x(n,a),x(a,l),x(l,c),x(a,d),x(a,f),x(f,p),x(f,u),x(f,m),m.innerHTML=J,x(f,h),x(f,g),x(f,_),x(f,v),v.innerHTML=q,y(i,S,b),y(i,I,b),x(I,P),M(P,e[0]),x(I,N),x(I,D),Y&&Y.m(D,null),y(i,A,b),y(i,z,b),x(z,O),x(O,H),y(i,W,b),y(i,L,b),U||(B=[$(P,"input",e[18]),$(O,"click",e[14])],U=!0)},p(e,t){256&t[0]&&G!==(G=i("performanceReporter.desc",e[8])+"")&&o.p(G),1&t[0]&&M(P,e[0]),e[4]?Y?Y.p(e,t):(Y=be(e),Y.c(),Y.m(D,null)):Y&&(Y.d(1),Y=null),128&t[0]&&C(O,"processing",e[7])},d(e){e&&k(t),e&&k(r),e&&k(n),e&&k(S),e&&k(I),Y&&Y.d(),e&&k(A),e&&k(z),e&&k(W),e&&k(L),U=!1,b(B)}}}function ue(e){let t,r,n,o,s,a,l,c,d,f;return{c(){t=w("kin-icon"),r=T(),n=w("h2"),n.textContent=`${i("performanceReporter.recordingSent.title")}`,o=T(),s=w("p"),s.textContent=`${i("performanceReporter.recordingSent.desc")}`,a=T(),l=w("div"),c=w("kin-button"),c.textContent=`${i("global.done")}`,C(t,"name","circle-ok"),C(t,"size","54"),C(t,"class","g-margin-top--20 g-margin-bottom--20"),F(n,"class","h2 -margins"),F(s,"class","p"),F(l,"class","g-margin-top--20 g-margin-bottom--20")},m(i,p){y(i,t,p),y(i,r,p),y(i,n,p),y(i,o,p),y(i,s,p),y(i,a,p),y(i,l,p),x(l,c),d||(f=$(c,"click",e[17]),d=!0)},p:m,d(e){e&&k(t),e&&k(r),e&&k(n),e&&k(o),e&&k(s),e&&k(a),e&&k(l),d=!1,f()}}}function me(e){let t,r,n,o,s,a,l,c,d,f,p,u,m,h,g,_,v=i("global.send")+"";return{c(){t=w("h2"),t.textContent=`${i("performanceReporter.recordingFinished.title")}`,r=T(),n=w("p"),n.textContent=`${i("performanceReporter.recordingFinished.desc")}`,o=T(),s=w("form"),a=w("kin-input"),d=T(),f=w("div"),p=w("kin-button"),u=R(v),m=T(),h=w("kin-button"),h.textContent=`${i("performanceReporter.discardRecording")}`,F(t,"class","h2 -margins"),F(n,"class","p"),C(a,"placeholder",l=i("performanceReporter.addEmail.label")),C(a,"value",e[2]),C(a,"error",c=e[3]?i("global.invalidEmailError"):null),F(s,"onsubmit","return false"),F(s,"class","form -simple g-margin-top--20"),C(p,"processing",e[7]),C(h,"type","secondary"),C(h,"class","g-margin-left--5"),F(f,"class","g-margin-top--20 g-margin-bottom--20")},m(i,l){y(i,t,l),y(i,r,l),y(i,n,l),y(i,o,l),y(i,s,l),x(s,a),y(i,d,l),y(i,f,l),x(f,p),x(p,u),x(f,m),x(f,h),g||(_=[$(a,"input",e[16]),$(p,"click",e[12]),$(h,"click",e[11])],g=!0)},p(e,t){4&t[0]&&C(a,"value",e[2]),8&t[0]&&c!==(c=e[3]?i("global.invalidEmailError"):null)&&C(a,"error",c),128&t[0]&&C(p,"processing",e[7])},d(e){e&&k(t),e&&k(r),e&&k(n),e&&k(o),e&&k(s),e&&k(d),e&&k(f),g=!1,b(_)}}}function he(e){let t;function r(e,t){return e[4]?ve:_e}let n=r(e),o=n(e);return{c(){o.c(),t=R("")},m(e,r){o.m(e,r),y(e,t,r)},p(e,s){n===(n=r(e))&&o?o.p(e,s):(o.d(1),o=n(e),o&&(o.c(),o.m(t.parentNode,t)))},d(e){o.d(e),e&&k(t)}}}function ge(e){let t,r,n,o,s,a,l,c,d,f,p,u=i("performanceReporter.finishRecording")+"";function m(e,t){return e[8]<=0?ye:xe}let h=m(e),g=h(e);return{c(){t=w("h2"),t.textContent=`${i("performanceReporter.recordingInProgress")}`,r=T(),n=w("p"),g.c(),o=T(),s=w("div"),a=w("kin-progress"),l=T(),c=w("kin-button"),d=R(u),F(t,"class","h2 -margins"),F(n,"class","p"),C(a,"percentage",e[6]),F(s,"class","g-margin-top--20 g-margin-bottom--40"),C(c,"processing",e[7])},m(i,u){y(i,t,u),y(i,r,u),y(i,n,u),g.m(n,null),y(i,o,u),y(i,s,u),x(s,a),y(i,l,u),y(i,c,u),x(c,d),f||(p=$(c,"click",e[13]),f=!0)},p(e,t){h===(h=m(e))&&g?g.p(e,t):(g.d(1),g=h(e),g&&(g.c(),g.m(n,null))),64&t[0]&&C(a,"percentage",e[6]),128&t[0]&&C(c,"processing",e[7])},d(e){e&&k(t),e&&k(r),e&&k(n),g.d(),e&&k(o),e&&k(s),e&&k(l),e&&k(c),f=!1,p()}}}function be(e){let t,r,n;return{c(){t=w("kin-icon"),r=T(),n=R(e[4]),C(t,"name","badge-critical"),C(t,"size","16")},m(e,o){y(e,t,o),y(e,r,o),y(e,n,o)},p(e,t){16&t[0]&&S(n,e[4])},d(e){e&&k(t),e&&k(r),e&&k(n)}}}function _e(e){let t,r,n,o,s;return{c(){t=w("h2"),t.textContent=`${i("performanceReporter.discarding.title")}`,r=T(),n=w("p"),n.textContent=`${i("performanceReporter.discarding.desc")}`,o=T(),s=w("div"),s.innerHTML='<kin-progress percentage="-1"></kin-progress>',F(t,"class","h2 -margins"),F(n,"class","p"),F(s,"class","g-margin-top--20 g-margin-bottom--40")},m(e,i){y(e,t,i),y(e,r,i),y(e,n,i),y(e,o,i),y(e,s,i)},p:m,d(e){e&&k(t),e&&k(r),e&&k(n),e&&k(o),e&&k(s)}}}function ve(e){let t,r,n,o,s,a,l,c,d;return{c(){t=w("h2"),t.textContent=`${i("performanceReporter.discarding.error.title")}`,r=T(),n=w("div"),o=w("p"),s=R(e[4]),a=T(),l=w("kin-button"),l.textContent=`${i("global.close")}`,F(t,"class","h2 -margins"),F(o,"class","p color-critical -text g-margin-bottom--40"),F(n,"class","g-margin-top--20")},m(i,f){y(i,t,f),y(i,r,f),y(i,n,f),x(n,o),x(o,s),x(n,a),x(n,l),c||(d=$(l,"click",e[11]),c=!0)},p(e,t){16&t[0]&&S(s,e[4])},d(e){e&&k(t),e&&k(r),e&&k(n),c=!1,d()}}}function xe(e){let t,r=i("performanceReporter.secRemaining",e[8])+"";return{c(){t=R(r)},m(e,r){y(e,t,r)},p(e,n){256&n[0]&&r!==(r=i("performanceReporter.secRemaining",e[8])+"")&&S(t,r)},d(e){e&&k(t)}}}function ye(e){let t,r=i("performanceReporter.processing")+"";return{c(){t=R(r)},m(e,r){y(e,t,r)},p:m,d(e){e&&k(t)}}}function ke(e){let t,r,n,o,s,a,l,c,d,f,p,u,h,g,v="recording"===e[5]&&fe(e);function R(e,t){return"recording"===e[5]?ge:"discarding"===e[5]?he:"recordingFinished"===e[5]?me:"recordingSent"===e[5]?ue:e[1]?void 0:pe}let C=R(e),S=C&&C(e);return{c(){var e,u,m;t=w("div"),r=w("div"),n=w("h1"),n.innerHTML='<span class="logo -white -width-70"></span>',o=T(),s=w("div"),v&&v.c(),a=T(),l=w("button"),d=T(),f=w("div"),p=w("div"),S&&S.c(),F(n,"class","nui_logo"),F(l,"class","nui_controls__item -close nui_caption_client"),F(l,"title",c=i("global.closeModalWindow")),F(s,"class","nui_controls"),F(r,"class","nui_titlebar -toaster nui_caption"),F(p,"class","pre svelte-15uir2i"),F(f,"class","nui_main -toaster"),F(t,"class","sve_toaster -detection"),e="width",u=we+"px",t.style.setProperty(e,u,m?"important":"")},m(i,c){var b;y(i,t,c),x(t,r),x(r,n),x(r,o),x(r,s),v&&v.m(s,null),x(s,a),x(s,l),x(t,d),x(t,f),x(f,p),S&&S.m(p,null),h||(g=[$(l,"click",e[11]),(b=u=e[9].call(null,t),b&&_(b.destroy)?b.destroy:m)],h=!0)},p(e,t){"recording"===e[5]?v?v.p(e,t):(v=fe(e),v.c(),v.m(s,a)):v&&(v.d(1),v=null),C===(C=R(e))&&S?S.p(e,t):(S&&S.d(1),S=C&&C(e),S&&(S.c(),S.m(p,null)))},i:m,o:m,d(e){e&&k(t),v&&v.d(),S&&S.d(),h=!1,b(g)}}}const we=570;function Re(e,o,d){let f,p="",u=!0,m="",h=!1,g=null,b="ready",_=0,v=!1,x=0,y=0,k=0,w=null;const R=[];function T(e){t.resize(we,Math.max(e.scrollHeight,300))}function $(e){d(2,m=e),f()}function F(){if(""===m)return d(3,h=!1),!0;const e=c.isEmailValid(m);return d(3,h=!e),e}function C(){const e=25e3*x;return{raw:e,formatted:a.formatBytes(e,0,1e3)}}function S(){w&&(clearInterval(w),w=null)}f=de(F,1e3),s.getValueCached("avcfg://settings/PerfRecorder/MaxRecordingSeconds").then((e=>{d(8,k=parseInt(e)||20),y=1e3*k,x=y})).then((()=>{d(1,u=!1)})),j((()=>{S(),R.forEach((e=>e()))}));return[p,u,m,h,g,b,_,v,k,function(e){T(e);const t=new MutationObserver(T.bind(this,e));return t.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),{destroy:t.disconnect.bind(t)}},$,function(){if("recording"===b||"recordingFinished"===b){let e="performanceReporter.closeConfirm.recording.desc",n="performanceReporter.closeConfirm.recording.title",o="performanceReporter.closeConfirm.recording.confirm.btn",s="performanceReporter.closeConfirm.recording.cancel.btn";"recordingFinished"===b&&(e="performanceReporter.closeConfirm.recordingFinished.desc",n="performanceReporter.closeConfirm.recordingFinished.title",o="performanceReporter.closeConfirm.recordingFinished.confirm.btn",s="performanceReporter.closeConfirm.recordingFinished.cancel.btn"),l.confirm(i(e),{title:i(n),ok:i(o),cancel:i(s)}).then((()=>{d(7,v=!0),d(5,b="discarding"),r("app.perf_recorder.Cancel").then((()=>{t.close()})).catch((e=>{console.error("app.perf_recorder.Cancel",e),d(4,g=i("performanceReporter.discarding.error.desc"))})).finally((()=>{d(7,v=!1)}))})).catch((()=>{console.log("Window close cancelled")}))}else t.close()},function(){F()&&(d(7,v=!0),r("app.perf_recorder.Send",{email:m}).catch((e=>{console.error("app.perf_recorder.Send",e),d(4,g=e.description)})).finally((()=>{d(7,v=!1),d(5,b="recordingSent")})))},function(){d(7,v=!0),r("app.perf_recorder.Stop").catch((e=>{console.error("app.perf_recorder.Stop",e),d(4,g=e.description)})).finally((()=>{d(7,v=!1)}))},function(){d(4,g=null),p?(d(7,v=!0),r("app.utils.GetGlobalMemoryStatus").then((e=>{if(e&&e.available_physical){const t=e.available_physical,r=C();t&&t<r.raw/1e6&&d(4,g=i("performanceReporter.error.notEnoughMemory",r.formatted))}})).catch((e=>{console.log("app.utils.GetGlobalMemoryStatus",e)})).then((()=>{g?d(7,v=!1):r("app.perf_recorder.Start",{description:p}).then((()=>{R.push(n.on("asw.perf_recorder.Stopped",(()=>{d(7,v=!1),d(5,b="recordingFinished"),t.open({url:location.origin+"/MainWindow.html?module=Feedback&view=performanceReporter",windowType:"window",showTitlebar:!1})}))),d(5,b="recording"),w=setInterval((()=>{y-=100,d(8,k=Math.floor(y/1e3)),d(6,_=100-y/x*100),y<=0&&(S(),d(6,_=-1))}),100)})).catch((e=>{1===e.code?(d(4,g=i("performanceReporter.error.recordingNotFinished")),d(7,v=!0),R.push(n.on("asw.perf_recorder.Finished",(()=>{setTimeout((()=>{d(7,v=!1),d(4,g=null)}),2e3)})))):8===e.code?d(4,g=i("performanceReporter.error.notEnoughMemory")):112===e.code?d(4,g=i("performanceReporter.error.notEnoughDiskSpace",C().formatted)):d(4,g=i("performanceReporter.error.cannotStartGeneric"))})).finally((()=>{d(7,v=!1)}))}))):d(4,g=i("performanceReporter.error.missingDesc"))},()=>t.minimize(),e=>$(e.target.value),()=>t.close(),function(){p=this.value,d(0,p)}]}class Te extends class{$destroy(){!function(e,t){const r=e.$$;null!==r.fragment&&(b(r.on_destroy),r.fragment&&r.fragment.d(t),r.on_destroy=r.fragment=null,r.ctx=[])}(this,1),this.$destroy=m}$on(e,t){const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(t),()=>{const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}{constructor(e){var t;super(),document.getElementById("svelte-15uir2i-style")||((t=w("style")).id="svelte-15uir2i-style",t.textContent=".pre.svelte-15uir2i.svelte-15uir2i{text-align:center;margin-left:4rem;margin-right:4rem}.pre.svelte-15uir2i .pre_form.svelte-15uir2i{margin:2rem auto 0}.pre.svelte-15uir2i .pre_form textarea.svelte-15uir2i{display:block;width:100%;resize:none}.pre.svelte-15uir2i .pre_error.svelte-15uir2i{min-height:5rem;margin-top:1rem}.pre.svelte-15uir2i .pre_submit.svelte-15uir2i{min-height:4rem}.pre.svelte-15uir2i .pre_footnote.svelte-15uir2i{margin:2rem 6rem}",x(document.head,t)),V(this,e,Re,ke,v,{},[-1,-1])}}export default p;export{u as analysis,f as form,Te as performanceReporter};const $e={name:"FeedbackForm",version:"1.2.165",created:"2021-03-09T09:30:18.022Z"};export{$e as metadata};