(self.webpackChunkweb_toolbox=self.webpackChunkweb_toolbox||[]).push([[183],{32376:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(9950),o=n(69935),c=n(10226),a=n(67243),i=n.n(a),s=n(77671);const l=t=>{let{data:e,isDisabled:n,hoverMessage:a,feedbackMessage:l,Icon:u=o.A,...f}=t;const{setToasterState:d}=(0,s.dq)();return r.createElement(c.A,Object.assign({disabled:!e||n,title:null!==a&&void 0!==a?a:"Copy to clipboard",variant:"contained","data-testid":"copy-to-clipboard",color:"primary"},f,{onClick:()=>{if(!e)return;const t=null!==l&&void 0!==l?l:"Content copied into clipboard: ".concat(e.substring(0,25)," \u2026");i()(e,{format:"text/plain"}),d({open:!0,message:t,type:"success",autoHideDuration:2e3})}}),r.createElement(u,null))}},50057:(t,e,n)=>{"use strict";n.d(e,{n:()=>s});var r=n(9950),o=n(25131),c=n(72772),a=n(73931);const i=(0,o.A)((t=>({root:{margin:t.spacing(1)}}))),s=t=>{let{title:e,iconType:n,children:o}=t;const s=i();return r.createElement(r.Fragment,null,r.createElement(c.m,{titleTemplate:"Web Toolbox - %s",defaultTitle:"Web Toolbox",title:e}),r.createElement("div",{className:s.root},r.createElement(a.A,{iconType:n,title:e}),o))}},73931:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(9950),o=n(82053);const c=(0,n(25131).A)((t=>({title:{wordBreak:"break-word"},titleWithIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginBottom:t.spacing(1)},icon:{height:"40px",width:"40px",marginRight:t.spacing(1)}}))),a=t=>{let{title:e,iconType:n}=t;const a=c();return r.createElement("div",{className:a.titleWithIcon},r.createElement(n,{className:a.icon}),r.createElement(o.A,{variant:"h5",className:a.title},e))}},44183:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>kt,mapDispatchToProps:()=>Tt,mapStateToProps:()=>xt});var r=n(9950),o=n(92098),c=n(90988),a=n(83239),i=n(16491),s=n(10226),l=n(8145),u=n(25131),f=n(10300),d=n(58042),h=n(33602),p=n(32376),A=n(50057),g=n(73649),m=n(62160),b=n(1810);class C extends Error{constructor(t,e){super("".concat(t," at position ").concat(e)),this.position=e}}const v=123,w=125,y=93,E=32,x=10,T=9,k=13,R=8,S=12,j=34,O=39,N=48,L=57,I=44,M=65,U=97,$=70,B=102,H=160,D=8192,J=8202,_=8239,W=8287,q=12288,z=8220,F=8221,P=8216,V=8217,X=96,Z=180;function G(t){return t>=N&&t<=L}function Q(t){return t>=32&&t<=1114111}function K(t){return Y.test(t)}const Y=/^[,:[\]/{}()\n+]$/,tt=/^[,[\]/{}\n+]$/,et=/^[a-zA-Z_$]$/,nt=/^[a-zA-Z_$0-9]$/,rt=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,ot=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function ct(t){return tt.test(t)}function at(t){return it.test(t)||t&&ft(t.charCodeAt(0))}const it=/^[[{\w-]$/;function st(t){return t===x||t===k||t===T||t===R||t===S}function lt(t){return t===E||t===x||t===T||t===k}function ut(t){return t===E||t===T||t===k}function ft(t){return dt(t)||pt(t)}function dt(t){return t===j||t===z||t===F}function ht(t){return t===j}function pt(t){return t===O||t===P||t===V||t===X||t===Z}function At(t){return t===O}function gt(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=t.lastIndexOf(e);return-1!==r?t.substring(0,r)+(n?"":t.substring(r+1)):t}function mt(t,e){let n=t.length;if(!lt(t.charCodeAt(n-1)))return t+e;for(;lt(t.charCodeAt(n-1));)n--;return t.substring(0,n)+e+t.substring(n)}function bt(t,e,n){return t.substring(0,e)+t.substring(e+n)}const Ct={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},vt={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function wt(t){let e=0,n="";o()||function(){throw new C("Unexpected end of json string",t.length)}();const r=s(I);for(r&&c(),at(t[e])&&function(t){return/[,\n][ \t\r]*$/.test(t)}(n)?(r||(n=mt(n,",")),function(){let t=!0,e=!0;for(;e;){if(t)t=!1;else{s(I)||(n=mt(n,","))}e=o()}e||(n=gt(n,","));n="[\n".concat(n,"\n]")}()):r&&(n=gt(n,","));t.charCodeAt(e)===w||93===t.charCodeAt(e);)e++,c();if(e>=t.length)return n;function o(){c();const r=function(){if(t.charCodeAt(e)===v){n+="{",e++,c(),l(I)&&c();let r=!0;for(;e<t.length&&t.charCodeAt(e)!==w;){let a;r?(a=!0,r=!1):(a=s(I),a||(n=mt(n,",")),c()),u();if(!(f()||p(!0))){t.charCodeAt(e)===w||t.charCodeAt(e)===v||93===t.charCodeAt(e)||91===t.charCodeAt(e)||void 0===t[e]?n=gt(n,","):E();break}c();const i=s(58),l=e>=t.length;i||(at(t[e])||l?n=mt(n,":"):T());o()||(i||l?n+="null":T())}return t.charCodeAt(e)===w?(n+="}",e++):n=mt(n,"}"),!0}return!1}()||function(){if(91===t.charCodeAt(e)){n+="[",e++,c(),l(I)&&c();let r=!0;for(;e<t.length&&t.charCodeAt(e)!==y;){if(r)r=!1;else{s(I)||(n=mt(n,","))}u();if(!o()){n=gt(n,",");break}}return t.charCodeAt(e)===y?(n+="]",e++):n=mt(n,"]"),!0}return!1}()||f()||function(){const r=e;if(45===t.charCodeAt(e)){if(e++,g())return m(r),!0;if(!G(t.charCodeAt(e)))return e=r,!1}for(;G(t.charCodeAt(e));)e++;if(46===t.charCodeAt(e)){if(e++,g())return m(r),!0;if(!G(t.charCodeAt(e)))return e=r,!1;for(;G(t.charCodeAt(e));)e++}if(101===t.charCodeAt(e)||69===t.charCodeAt(e)){if(e++,45!==t.charCodeAt(e)&&43!==t.charCodeAt(e)||e++,g())return m(r),!0;if(!G(t.charCodeAt(e)))return e=r,!1;for(;G(t.charCodeAt(e));)e++}if(!g())return e=r,!1;if(e>r){const o=t.slice(r,e),c=/^0\d/.test(o);return n+=c?'"'.concat(o,'"'):o,!0}return!1}()||h("true","true")||h("false","false")||h("null","null")||h("True","true")||h("False","false")||h("None","null")||p(!1)||function(){if("/"===t[e]){const r=e;for(e++;e<t.length&&("/"!==t[e]||"\\"===t[e-1]);)e++;return e++,n+='"'.concat(t.substring(r,e),'"'),!0}}();return c(),r}function c(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=e;let r=a(t);do{r=i(),r&&(r=a(t))}while(r);return e>n}function a(r){const o=r?lt:ut;let c="";for(;;){const n=t.charCodeAt(e);if(o(n))c+=t[e],e++;else{if(!((a=n)===H||a>=D&&a<=J||a===_||a===W||a===q))break;c+=" ",e++}}var a;return c.length>0&&(n+=c,!0)}function i(){if(47===t.charCodeAt(e)&&42===t.charCodeAt(e+1)){for(;e<t.length&&!yt(t,e);)e++;return e+=2,!0}if(47===t.charCodeAt(e)&&47===t.charCodeAt(e+1)){for(;e<t.length&&t.charCodeAt(e)!==x;)e++;return!0}return!1}function s(r){return t.charCodeAt(e)===r&&(n+=t[e],e++,!0)}function l(n){return t.charCodeAt(e)===n&&(e++,!0)}function u(){return c(),46===t.charCodeAt(e)&&46===t.charCodeAt(e+1)&&46===t.charCodeAt(e+2)&&(e+=3,c(),l(I),!0)}function f(){let r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,a=92===t.charCodeAt(e);if(a&&(e++,a=!0),ft(t.charCodeAt(e))){const s=ht(t.charCodeAt(e))?ht:At(t.charCodeAt(e))?At:pt(t.charCodeAt(e))?pt:dt,u=e,h=n.length;let p='"';for(e++;;){if(e>=t.length){const o=A(e-1);return!r&&K(t.charAt(o))?(e=u,n=n.substring(0,h),f(!0)):(p=mt(p,'"'),n+=p,!0)}if(e===o)return p=mt(p,'"'),n+=p,!0;if(s(t.charCodeAt(e))){const o=e,a=p.length;if(p+='"',e++,n+=p,c(!1),r||e>=t.length||K(t.charAt(e))||ft(t.charCodeAt(e))||G(t.charCodeAt(e)))return d(),!0;const i=A(o-1),s=t.charAt(i);if(","===s)return e=u,n=n.substring(0,h),f(!1,i);if(K(s))return e=u,n=n.substring(0,h),f(!0);n=n.substring(0,h),e=o+1,p="".concat(p.substring(0,a),"\\").concat(p.substring(a))}else{if(r&&ct(t[e])){if(58===t.charCodeAt(e-1)&&rt.test(t.substring(u+1,e+2)))for(;e<t.length&&ot.test(t[e]);)p+=t[e],e++;return p=mt(p,'"'),n+=p,d(),!0}if(92===t.charCodeAt(e)){const n=t.charAt(e+1);if(void 0!==vt[n])p+=t.slice(e,e+2),e+=2;else if("u"===n){let n=2;for(;n<6&&((i=t.charCodeAt(e+n))>=N&&i<=L||i>=M&&i<=$||i>=U&&i<=B);)n++;6===n?(p+=t.slice(e,e+6),e+=6):e+n>=t.length?e=t.length:k()}else p+=n,e+=2}else{const n=t.charAt(e),r=t.charCodeAt(e);r===j&&92!==t.charCodeAt(e-1)?(p+="\\".concat(n),e++):st(r)?(p+=Ct[n],e++):(Q(r)||b(n),p+=n,e++)}}a&&l(92)}}var i;return!1}function d(){let r=!1;for(c();43===t.charCodeAt(e);){r=!0,e++,c(),n=gt(n,'"',!0);const t=n.length,o=f();n=o?bt(n,t,1):mt(n,'"')}return r}function h(r,o){return t.slice(e,e+r.length)===r&&(n+=o,e+=r.length,!0)}function p(r){const c=e;if(et.test(t[e])){for(;e<t.length&&nt.test(t[e]);)e++;let n=e;for(;lt(t.charCodeAt(n));)n++;if("("===t[n])return e=n+1,o(),41===t.charCodeAt(e)&&(e++,59===t.charCodeAt(e)&&e++),!0}for(;e<t.length&&!ct(t[e])&&!ft(t.charCodeAt(e))&&(!r||58!==t.charCodeAt(e));)e++;if(58===t.charCodeAt(e-1)&&rt.test(t.substring(c,e+2)))for(;e<t.length&&ot.test(t[e]);)e++;if(e>c){for(;lt(t.charCodeAt(e-1))&&e>0;)e--;const r=t.slice(c,e);return n+="undefined"===r?"null":JSON.stringify(r),t.charCodeAt(e)===j&&e++,!0}}function A(e){let n=e;for(;n>0&&lt(t.charCodeAt(n));)n--;return n}function g(){return e>=t.length||K(t[e])||lt(t.charCodeAt(e))}function m(r){n+="".concat(t.slice(r,e),"0")}function b(t){throw new C("Invalid character ".concat(JSON.stringify(t)),e)}function E(){throw new C("Object key expected",e)}function T(){throw new C("Colon expected",e)}function k(){const n=t.slice(e,e+6);throw new C('Invalid unicode character "'.concat(n,'"'),e)}!function(){throw new C("Unexpected character ".concat(JSON.stringify(t[e])),e)}()}function yt(t,e){return"*"===t[e]&&"/"===t[e+1]}const Et=(0,u.A)((t=>({formatted:{borderColor:t.palette.text.disabled,borderStyle:"solid",borderWidth:1,borderRadius:t.shape.borderRadius,maxHeight:"500px",width:"100%",overflow:"auto"},toolbar:{margin:0,padding:0}})));function xt(t){return{inputText:t.textInputs.lastJSONRepairedValue}}function Tt(t){return{storeInputText:(e,n)=>t((0,h.s)(e,n))}}const kt=(0,f.Ng)(xt,Tt)((t=>{let{inputText:e,storeInputText:n}=t;const u=Et(),f=(0,b.Pb)("md"),h=(0,g.c)(),[C,v]=r.useState("");r.useEffect((()=>{if(e)try{v(wt(e))}catch(t){console.error(t)}}),[e]);return r.createElement(A.n,{iconType:c.A,title:"JSON Repair"},r.createElement("form",{noValidate:!0,autoComplete:"off"},r.createElement("div",null,r.createElement(l.A,{autoFocus:f,label:"JSON Content",placeholder:"Paste or type the json content here",multiline:!0,minRows:10,maxRows:f?20:10,variant:"outlined",margin:"normal",fullWidth:!0,value:e,inputProps:{spellCheck:!1},onChange:t=>n("lastJSONRepairedValue",t.target.value)}))),r.createElement(a.A,{className:u.toolbar},r.createElement(i.A,{component:"div",flexGrow:1}),r.createElement(p.A,{data:C,sx:{mr:1}}),r.createElement(s.A,{endIcon:r.createElement(o.A,null),disabled:!C,variant:"contained",color:"primary",onClick:t=>{t.preventDefault(),m.Q(C)}},"Save As\u2026")),r.createElement(d.A,{style:h,language:"json",className:u.formatted},C))}))},73649:(t,e,n)=>{"use strict";n.d(e,{c:()=>a});var r=n(32284),o=n(71830),c=n(90038);const a=()=>{const{isDark:t}=(0,c.CX)();return t?r.A:o.A}},62160:(t,e,n)=>{"use strict";n.d(e,{Q:()=>o});var r=n(34691);function o(t){if(window.require){window.require("electron").ipcRenderer.send("saveJsonAs",t)}else{const e=new Blob([t],{type:"application/json"});(0,r.saveAs)(e,"data.json")}}},92098:(t,e,n)=>{"use strict";var r=n(24994);e.A=void 0;var o=r(n(79526)),c=n(44414);e.A=(0,o.default)((0,c.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save")},34691:function(t,e,n){var r,o,c;o=[],void 0===(c="function"===typeof(r=function(){"use strict";function e(t,e){return"undefined"==typeof e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}function r(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){s(r.response,e,n)},r.onerror=function(){console.error("could not download file")},r.send()}function o(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function c(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(r){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,i=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!i?function(t,e,n){var i=a.URL||a.webkitURL,s=document.createElement("a");e=e||t.name||"download",s.download=e,s.rel="noopener","string"==typeof t?(s.href=t,s.origin===location.origin?c(s):o(s.href)?r(t,e,n):c(s,s.target="_blank")):(s.href=i.createObjectURL(t),setTimeout((function(){i.revokeObjectURL(s.href)}),4e4),setTimeout((function(){c(s)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,n,a){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(e(t,a),n);else if(o(t))r(t,n,a);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout((function(){c(i)}))}}:function(t,e,n,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return r(t,e,n);var c="application/octet-stream"===t.type,s=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||c&&s||i)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var t=u.result;t=l?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location=t,o=null},u.readAsDataURL(t)}else{var f=a.URL||a.webkitURL,d=f.createObjectURL(t);o?o.location=d:location.href=d,o=null,setTimeout((function(){f.revokeObjectURL(d)}),4e4)}});a.saveAs=s.saveAs=s,t.exports=s})?r.apply(e,o):r)||(t.exports=c)}}]);