jscrewit 2.32.0 → 2.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-doc/.nojekyll +1 -0
- package/api-doc/interfaces/FeatureAll.md +69 -78
- package/api-doc/interfaces/FeatureConstructor.md +69 -82
- package/lib/feature-all.d.ts +3 -6
- package/lib/jscrewit.js +146 -77
- package/lib/jscrewit.min.js +2 -2
- package/package.json +2 -2
- package/ui/ui.js +1 -1
package/ui/ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";function i(e){var t=typeof e;return"object"==t&&null!==e||"undefined"==t&&void 0!==e}function o(n,o,r,a){return function(t){function e(e){t[a](e,o,r)}Array.isArray(n)?n.forEach(e):e(n)}}function c(e){e.removeAttribute("tabindex")}function x(e){e.setAttribute("tabindex",0)}function _(e){function t(){u.className="button focusable",i("off")}function n(e){e.target!==u&&r()&&t()}function o(e){!e.relatedTarget&&r()&&t()}function r(){return/\bactive\b/.test(u.className)}function a(){return!u.hasAttribute("tabindex")}function i(e){e=V[e],V(document,e("mousemove",n),e("mouseout",o))}var u=V("SPAN",{className:"button focusable",get disabled(){return a()},set disabled(e){(e=!!e)!==a()&&(e?(V(u,c),r()&&(document.releaseCapture(),i("off")),u.blur()):V(u,x),u.className="",u.className="button focusable")}},x,V.on("click",function(e){a()&&e.stopImmediatePropagation(),e.preventDefault()}),V.on("keydown",function(e){13===e.keyCode&&(u.click(),e.preventDefault())}),V.on("keyup",function(e){32===e.keyCode&&(u.click(),e.preventDefault())}),V.on("mouseup",function(e){0===e.button&&r()&&(document.releaseCapture(),t())}),V("SPAN",e),V("SPAN"));return u.setCapture&&(u.firstChild.setAttribute("unselectable","on"),V(u,V.on("mousedown",function(e){0!==e.button||a()||r()||(u.setCapture(),u.className="active button focusable",i("on"))}))),u}function D(e,t){function n(){var e=document.body;e.removeChild(u),V(e,V.off("keydown",a),V.off("focus",r,!0)),void 0!==t&&t()}function o(){i.focus()}function r(e){i.contains(e.target)||o()}function a(e){var t=e.keyCode;13!==t&&27!==t||!(t=document.activeElement).contains(i)&&t.contains(e.target)||(n(),e.preventDefault())}var i=V("DIV",{style:{borderRadius:"25px",display:"inline-block",maxWidth:"500px",width:"100%"}},x,V("DIV",{className:"focusable",id:"modalBox",style:{background:"whitesmoke",border:"10px solid blue",borderRadius:"23px",margin:"2px"}},V("DIV",{style:{margin:"1.5em 1.5em .25em",overflow:"hidden"}},e,V("DIV",{style:{margin:"1.25em 0"}},V(_("OK"),{style:{maxWidth:"5em",width:"100%"}},V.on("click",n)))))),u=V("DIV",{style:{background:"rgba(0, 0, 0, .25)",overflow:"auto",position:"fixed",textAlign:"center",left:"0",top:"0",bottom:"0",width:"100%"}},V("DIV",{style:{display:"table",tableLayout:"fixed",width:"100%",height:"100%"}},V("DIV",{style:{display:"table-cell",verticalAlign:"middle"}},i)));V(document.body,u,V.on("focus",r,!0),V.on("keydown",a)),setTimeout(o)}function r(e){var t,n=typeof e;try{t="string"==n?'"'+e+'"':0===e&&1/e<0?"-0":Array.isArray(e)?e.length?"[…]":"[]":"bigint"==n?e+"n":"symbol"!=n?String(e):e.toString()}catch(e){}return t}function n(){(J=new Worker(N)).onmessage=e}function a(){URL.revokeObjectURL(N),N=void 0}function T(){var e,t=u();try{e=JScrewIt.encode(inputArea.value,t)}catch(e){return m(),void b(String(e))}v(e)}function R(){var e=u(),e={input:inputArea.value,options:e};t&&(J.terminate(),n(),e.url=g),J.postMessage(e),m(),p(!0),inputArea.onkeyup=null}function u(){return{features:j.canonicalNames}}function s(e){9!==e.keyCode&&R()}function O(e){var t;L(e)&&(e=outputArea.value.length,0===outputArea.selectionStart&&outputArea.selectionEnd===e||(outputArea.selectionStart=0,outputArea.selectionEnd=e,"scrollTopMax"in outputArea&&(t=outputArea.scrollTop,V(outputArea,V.on("scroll",function(){outputArea.scrollTop=t},{once:!0})))))}function l(){H.disabled=!1;var e=this.result;null!=e&&(inputArea.value=e),inputArea.oninput(),inputArea.disabled=!1}function M(){var e,t,n,o;try{t=(0,eval)(outputArea.value)}catch(e){n=V("P",String(e))}void 0!==t&&(e=function(e){var t;if(Array.isArray(e))try{t="["+e.map(r).join(", ")+"]"}catch(e){}else t=r(e);return t}(t),t=function(e){var t;if(null!==e){var n=typeof e;if("function"==n||"object"==n||"undefined"==n){var o=Object.getPrototypeOf(e);if(o===Array.prototype)switch(e.length){case 0:t="an empty array";break;case 1:t="a one element array";break;default:t="an array"}else t=o===Date.prototype?"a date":o===RegExp.prototype?"a regular expression":"function"==n?"a function":"an object"}}return t}(t),n=e?V("DIV",V("P",t?"Evaluation result is "+t+":":"Evaluation result is"),V("P",{style:{overflowX:"auto"}},V("DIV",{style:{display:"inline-block",textAlign:"left",whiteSpace:"pre"}},e))):V("DIV",V("P","Evaluation result is "+t+"."))),null!=n&&(o=this,D(n,function(){o.focus()}))}function e(e){var t=e.data;(e=t.error)?b(e):v(t.output),p(!1)}function L(e){var t,n,o=e.target;return(n="runtimeStyle"in o?(n=o.lastMainMouseButtonEventTimeStamp,t=0===e.button?e.timeStamp:void 0,(o.lastMainMouseButtonEventTimeStamp=t)-n<=500):2<=e.detail&&0===e.button)&&e.preventDefault(),n}function d(){function n(){var e=+new Date;0<=((d=c+(e-s)*l/250)-i)*l&&(d=i,o()),r.height=1===d?"":t.scrollHeight*d+"px",a.display=0===d?"none":""}function o(){clearInterval(u),u=null,l=0}document.querySelector("main>div").style.display="block",inputArea.value=inputArea.defaultValue,V(outputArea,V.on("mousedown",O),V.on("mouseup",L),V.on("input",F)),V(stats.parentNode,V(_("Run this"),{style:{bottom:"0",fontSize:"10pt",position:"absolute",right:"0"}},V.on("click",M))),g=W.COMPACT,j=W.AUTO.includes(g)?g:W.BROWSER,compMenu.value=j.name,compMenu.previousIndex=compMenu.selectedIndex,J?(A=R)():(g=V(_("Encode"),V.on("click",T)),V(controls,g),A=P,outputArea.value=""),"undefined"!=typeof File&&(e=V("INPUT",{accept:".js",style:{display:"none"},type:"file"},V.on("change",C)),k=HTMLInputElement.prototype.click.bind(e),H=V(_("Load file…"),V.on("click",k)),V(controls,H,e)),inputArea.oninput=A;var t,r,a,i,u,c,s,l,d,e,f,m,p,b,v,y,h,g,A,N,k=function(){var e=compMenu.selectedIndex,t=compMenu.options[e].value,n=t?W[t]:U.feature;!B&&W.areEqual(n,j)||(j=n,this()),e!==compMenu.previousIndex&&(compMenu.previousIndex=e,q.rollTo(+!t))}.bind(A);function S(e,t){return V("LABEL",{style:{display:"inline-table"}},V("SPAN",{style:{display:"table-cell",verticalAlign:"middle"}},V("INPUT",{style:{margin:"0 .25em 0 0"},type:"checkbox"},t)),V("SPAN",{style:{display:"table-cell"}},e))}function w(e){var t=V("DIV",{className:"help-text"});return t.innerHTML=e,V("SPAN",{className:"focusable",style:{background:"black",borderRadius:"1em",color:"white",cursor:"pointer",display:"inline-table",fontSize:"8pt",fontWeight:"bold",lineHeight:"10.5pt",position:"relative",textAlign:"center",top:"-1.5pt",width:"10.5pt"},title:"Learn more…"},"?",x,V.on("click",function(){D(t)}))}function E(){var t=f.checked;Array.prototype.forEach.call(p,function(e){e.checked=t})}function I(){var t=JScrewIt.Feature,e=Array.prototype.filter.call(p,function(e){return e.checked}).map(function(e){return++n,t[e.featureName]}),n=e.length;f.checked=n,f.indeterminate=n&&n<p.length,m=t.commonOf.apply(null,e)||t.DEFAULT,v.checked&&(m=m.restrict("web-worker",e)),b.checked&&(m=m.restrict("forced-strict-mode",e))}V(compMenu,V.on("change",k)),U=V((y=V(S("Select/deselect all"),{style:{margin:"0 0 .5em"}},V.on("change",E),V.on(["keyup","mouseup"],function(){setTimeout(function(){f.indeterminate||E()})})),h=V("TABLE",{style:{borderSpacing:"0",width:"100%"}}),g=S("Generate strict mode code"),A=S("Support web workers"),N=V("FIELDSET",{className:"engine-selection-box",get feature(){return m}},V("DIV",V("P",{style:{margin:".25em 0 .75em"}},"Select the engines you want your code to support."),y,h,V("HR"),V("DIV",A," ",w("<p>Web workers are part of a standard HTML technology used to perform background tasks in JavaScript.<p>Check the option <dfn>Support web workers</dfn> only if your code needs to run inside a web worker. To create or use a web worker in your code, this option is not required.")),V("DIV",g," ",w('<p>The option <dfn>Generate strict mode code</dfn> instructs JScrewIt to avoid optimizations that don\'t work in strict mode JavaScript code. Check this option only if your environment disallows non-strict code. You may want to do this for example in one of the following circumstances.<ul><li>To encode a string or a number and embed it in a JavaScript file in a place where strict mode code is expected, like in a scope containing a <code>"use strict"</code> statement or in a class body.<li>To encode a script and run it in Node.js with the option <code>--use_strict</code>.<li>To encode an ECMAScript module. Note that module support in JSFuck is <em>very</em> limited, as <code>import</code> and <code>export</code> statements don\'t work at all. If your module doesn\'t contain these statements, you can encode it using this option.</ul><p>In most other cases, this option is not required, not even to encode a script that contains a top level <code>"use strict"</code> statement.')),V.on("change",function(){var e;I(),(e=document.createEvent("Event")).initEvent("input",!0,!1),N.dispatchEvent(e)}))),[{name:"Chrome",versions:[{featureName:"CHROME_92",number:"92+"}]},{name:"Edge",versions:[{featureName:"CHROME_92",number:"92+"}]},{name:"Firefox",versions:[{featureName:"FF_78",number:"78–82"},{featureName:"FF_83",number:"83–89"},{featureName:"FF_90",number:"90+"}]},{name:"Internet Explorer",versions:[{featureName:"IE_9",number:"9"},{featureName:"IE_10",number:"10"},{featureName:"IE_11",number:"11"},{featureName:"IE_11_WIN_10",number:"11 (W10)"}]},{name:"Safari",versions:[{featureName:"SAFARI_7_0",number:"7.0"},{featureName:"SAFARI_7_1",number:"7.1–8"},{featureName:"SAFARI_9",number:"9"},{featureName:"SAFARI_10",number:"10–11"},{featureName:"SAFARI_12",number:"12"},{featureName:"SAFARI_13",number:"13–14.0.0"},{featureName:"SAFARI_14_0_1",number:"14.0.1–14.0.3"},{featureName:"SAFARI_14_1",number:"14.1+"}]},{name:"Opera",versions:[{featureName:"CHROME_92",number:"78+"}]},{name:"Android Browser",versions:[{featureName:"ANDRO_4_0",number:"4.0"},{featureName:"ANDRO_4_1",number:"4.1–4.3"},{featureName:"ANDRO_4_4",number:"4.4"}]},{name:"Node.js",versions:[{featureName:"NODE_0_10",number:"0.10"},{featureName:"NODE_0_12",number:"0.12"},{featureName:"NODE_4",number:"4"},{featureName:"NODE_5",number:"5–9"},{featureName:"NODE_10",number:"10"},{featureName:"NODE_11",number:"11"},{featureName:"NODE_12",number:"12"},{featureName:"NODE_13",number:"13–14"},{featureName:"NODE_15",number:"15"},{featureName:"NODE_16_0",number:"16.0–16.5"},{featureName:"NODE_16_6",number:"16.6+"}]}].forEach(function(e,t){for(var n,o=e.versions,r=1&t?{className:"even-field"}:null,a=(o.length+2)/3^0,i=3*a,u=0;u<i;++u){var c=o[u];u%3||(n=V("TR",r),u||V(n,V("TD",{rowSpan:a,style:{padding:"0 .5em 0 0"}},e.name)),V(h,n)),c=c?S(c.number,{checked:!0,featureName:c.featureName}):null,V(n,V("TD",{style:{padding:"0 0 0 .5em",width:"6em"}},c))}}),f=y.querySelector("INPUT"),p=h.querySelectorAll("INPUT"),b=g.querySelector("INPUT"),v=A.querySelector("INPUT"),I(),N),V.on("input",k)),d=l=0,e=V("DIV"),(a=e.style).display="none",t=V("DIV",e,{container:e,rollTo:function(e){var t;e===d?o():((t=d<e?1:-1)!==l&&(c=d,s=+new Date,l=t),i=e,u=u||setInterval(n,0))}}),(r=t.style).height="0",r.overflowY="hidden",q=t,k="Custom Compatibility Selection","open"in(e=document.createElement("DETAILS"))?(V(e,{open:!0},V("SUMMARY",{dir:"rtl"},V("SPAN",{style:{float:"left"}},k))),V.css("details.frame:not([open])>:first-child",{"margin-bottom":"initial"})):e=V("DIV",V("SPAN",k)),V(q.container,V(e,{className:"frame"},U)),V(controls.parentNode,q),inputArea.selectionStart=2147483647,inputArea.focus()}function f(){document.addEventListener("DOMContentLoaded",d)}function C(){var e,t=this.files[0];t&&(inputArea.disabled=!0,inputArea.value="",H.disabled=!0,(e=new FileReader).addEventListener("loadend",l),e.readAsText(t))}function P(){A&&F(!0)}function m(){A=!1,outputArea.value="",stats.textContent="…"}function p(e){t=e,outputArea.disabled=e}function b(e){D(V("P",e))}function v(e){outputArea.value=e,F()}function F(e){var t=1===(t=outputArea.value.length)?"1 char":t+" chars";B=!!e,e&&(J&&(inputArea.onkeyup=s),t+=" – <i>out of sync</i>"),A=!0,stats.innerHTML=t}var y,h=Object,V=function(e){for(var t=e instanceof Node?e:"function"==typeof e?e.call(V):document.createElement(e),n=arguments.length,o=0;++o<n;){var r=arguments[o];r instanceof Node?t.appendChild(r):i(r)?function o(r,a){h.keys(a).forEach(function(e){var t,n=h.getOwnPropertyDescriptor(a,e);"value"in n?(t=n.value,e in r&&i(t)?o(r[e],t):r[e]=t):h.defineProperty(r,e,n)})}(t,r):"function"==typeof r?r.call(V,t):null!=r&&(r=document.createTextNode(r),t.appendChild(r))}return t};V.off=function(e,t,n){return o(e,t,n,"removeEventListener")},V.on=function(e,t,n){return o(e,t,n,"addEventListener")},V.css=function(e,t){var n,o=t;t=e=e+"{"+h.keys(n=o).map(function(e){return e+":"+n[e]}).join(";")+"}",y||(e=V("STYLE"),V(document.head,e),y=e.sheet),y.insertRule(t,y.cssRules.length)},V.css(".button",{background:"#e0e0e0",color:"#212121",cursor:"default",display:"inline-block",position:"relative"}),V.css(".button, .button>:last-child",{"border-radius":".1em"}),V.css(".button.active, .button[tabindex]:active",{background:"#29b3e5"}),V.css(".button.active>:first-child, .button[tabindex]:active>:first-child",{left:".1em",top:".1em"}),V.css(".button.active>:last-child, .button[tabindex]:active>:last-child",{"border-color":"#0088b6"}),V.css(".button:not([tabindex])",{background:"#e9e9e9",color:"#707070"}),V.css(".button:not([tabindex])>:last-child",{"border-color":"#bababa"}),V.css(".button>:first-child",{display:"inline-block",margin:".15em .5em",position:"relative","user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-webkit-user-select":"none"}),V.css(".button>:last-child",{"border-color":"#707070","border-style":"solid","border-width":"1px",display:"inline-block",position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}),V.css(".button[tabindex]:hover:not(.active):not(:active)",{background:"#a3f4ff"}),V.css(".button[tabindex]:hover:not(.active):not(:active)>:last-child",{"border-color":"#189fdd"}),V.css("#modalBox p:first-child",{"margin-top":"0"}),V.css("#modalBox p:last-child",{"margin-bottom":"0"}),V.css(".engine-selection-box",{background:"#f0f0f0"}),V.css(".engine-selection-box .even-field",{background:"#fff"}),V.css(".help-text",{"font-size":"11pt","text-align":"justify"}),V.css(".help-text code",{"white-space":"pre"}),V.css(".help-text dfn",{"font-style":"normal","font-weight":"bold"}),V.css(".help-text li",{margin:".5em 0"});var j,U,g,H,B,A,q,t,J,N,k="application/javascript",W=JScrewIt.Feature;!function(){var t;try{(t=new XMLHttpRequest).open("GET","lib/jscrewit.min.js",!0)}catch(e){t=void 0}if(t&&"undefined"!=typeof Worker){N=URL.createObjectURL(new Blob(['"use strict";self.onmessage=function(t){var r=t.data,t=r.url;null!=t&&importScripts(t);t=r.input;if(null!=t){try{e={output:JScrewIt.encode(t,r.options)}}catch(t){var e={error:String(t)}}postMessage(e)}};'],{type:k}));try{n()}catch(e){a()}}J?(t.onerror=function(){J.terminate(),J=void 0,a()},t.onload=function(){t.status<400?(g=URL.createObjectURL(t.response),J.postMessage({url:g})):this.onerror()},t.onloadend=function(){("loading"===document.readyState?f:d)()},t.overrideMimeType(k),t.responseType="blob",t.send()):f()}()}();
|
|
1
|
+
!function(){"use strict";function a(e){var t=typeof e;return"object"==t&&null!==e||"undefined"==t&&void 0!==e}function o(n,o,i,r){return function(t){function e(e){t[r](e,o,i)}Array.isArray(n)?n.forEach(e):e(n)}}function u(e){e.removeAttribute("tabindex")}function E(e){e.setAttribute("tabindex",0)}function N(e){function t(){c.className="button focusable",a("off")}function n(e){e.target!==c&&i()&&t()}function o(e){!e.relatedTarget&&i()&&t()}function i(){return/\bactive\b/.test(c.className)}function r(){return!c.hasAttribute("tabindex")}function a(e){e=O[e],O(document,e("mousemove",n),e("mouseout",o))}var c=O("SPAN",{className:"button focusable",get disabled(){return r()},set disabled(e){(e=!!e)!==r()&&(e?(O(c,u),i()&&(document.releaseCapture(),a("off")),c.blur()):O(c,E),c.className="",c.className="button focusable")}},E,O.on("click",function(e){r()&&e.stopImmediatePropagation(),e.preventDefault()}),O.on("keydown",function(e){13===e.keyCode&&(c.click(),e.preventDefault())}),O.on("keyup",function(e){32===e.keyCode&&(c.click(),e.preventDefault())}),O.on("mouseup",function(e){0===e.button&&i()&&(document.releaseCapture(),t())}),O("SPAN",e),O("SPAN"));return c.setCapture&&(c.firstChild.setAttribute("unselectable","on"),O(c,O.on("mousedown",function(e){0!==e.button||r()||i()||(c.setCapture(),c.className="active button focusable",a("on"))}))),c}function D(e,t){function n(){var e=document.body;e.removeChild(c),O(e,O.off("keydown",r),O.off("focus",i,!0)),void 0!==t&&t()}function o(){a.focus()}function i(e){a.contains(e.target)||o()}function r(e){var t=e.keyCode;13!==t&&27!==t||!(t=document.activeElement).contains(a)&&t.contains(e.target)||(n(),e.preventDefault())}var a=O("DIV",{style:{borderRadius:"25px",display:"inline-block",maxWidth:"500px",width:"100%"}},E,O("DIV",{className:"focusable",id:"modalBox",style:{background:"whitesmoke",border:"10px solid blue",borderRadius:"23px",margin:"2px"}},O("DIV",{style:{margin:"1.5em 1.5em .25em",overflow:"hidden"}},e,O("DIV",{style:{margin:"1.25em 0"}},O(N("OK"),{style:{maxWidth:"5em",width:"100%"}},O.on("click",n)))))),c=O("DIV",{style:{background:"rgba(0, 0, 0, .25)",overflow:"auto",position:"fixed",textAlign:"center",left:"0",top:"0",bottom:"0",width:"100%"}},O("DIV",{style:{display:"table",tableLayout:"fixed",width:"100%",height:"100%"}},O("DIV",{style:{display:"table-cell",verticalAlign:"middle"}},a)));O(document.body,c,O.on("focus",i,!0),O.on("keydown",r)),setTimeout(o)}function i(e){var t,n=typeof e;try{t="string"==n?'"'+e+'"':0===e&&1/e<0?"-0":Array.isArray(e)?e.length?"[…]":"[]":"bigint"==n?e+"n":"symbol"!=n?String(e):e.toString()}catch(e){}return t}function n(){(W=new Worker(k)).onmessage=e}function r(){URL.revokeObjectURL(k),k=void 0}function M(){var e,t=c();try{e=JScrewIt.encode(inputArea.value,t)}catch(e){return f(),void b(String(e))}v(e)}function L(){var e=c(),e={input:inputArea.value,options:e};t&&(W.terminate(),n(),e.url=g),W.postMessage(e),f(),m(!0),inputArea.onkeyup=null}function c(){return{features:B.canonicalNames}}function l(e){9!==e.keyCode&&L()}function P(e){var t;R(e)&&(e=outputArea.value.length,0===outputArea.selectionStart&&outputArea.selectionEnd===e||(outputArea.selectionStart=0,outputArea.selectionEnd=e,"scrollTopMax"in outputArea&&(t=outputArea.scrollTop,O(outputArea,O.on("scroll",function(){outputArea.scrollTop=t},{once:!0})))))}function s(){J.disabled=!1;var e=this.result;null!=e&&(inputArea.value=e),inputArea.oninput(),inputArea.disabled=!1}function C(){var e,t,n,o;try{t=(0,eval)(outputArea.value)}catch(e){n=O("P",String(e))}void 0!==t&&(e=function(e){var t;if(Array.isArray(e))try{t="["+e.map(i).join(", ")+"]"}catch(e){}else t=i(e);return t}(t),t=function(e){var t;if(null!==e){var n=typeof e;if("function"==n||"object"==n||"undefined"==n){var o=Object.getPrototypeOf(e);if(o===Array.prototype)switch(e.length){case 0:t="an empty array";break;case 1:t="a one element array";break;default:t="an array"}else t=o===Date.prototype?"a date":o===RegExp.prototype?"a regular expression":"function"==n?"a function":"an object"}}return t}(t),n=e?O("DIV",O("P",t?"Evaluation result is "+t+":":"Evaluation result is"),O("P",{style:{overflowX:"auto"}},O("DIV",{style:{display:"inline-block",textAlign:"left",whiteSpace:"pre"}},e))):O("DIV",O("P","Evaluation result is "+t+"."))),null!=n&&(o=this,D(n,function(){o.focus()}))}function e(e){var t=e.data;(e=t.error)?b(e):v(t.output),m(!1)}function R(e){var t,n,o=e.target;return(n="runtimeStyle"in o?(n=o.lastMainMouseButtonEventTimeStamp,t=0===e.button?e.timeStamp:void 0,(o.lastMainMouseButtonEventTimeStamp=t)-n<=500):2<=e.detail&&0===e.button)&&e.preventDefault(),n}function d(){function n(){var e=+new Date;0<=((d=u+(e-l)*s/250)-a)*s&&(d=a,o()),i.height=1===d?"":t.scrollHeight*d+"px",r.display=0===d?"none":""}function o(){clearInterval(c),c=null,s=0}document.querySelector("main>div").style.display="block",inputArea.value=inputArea.defaultValue,O(outputArea,O.on("mousedown",P),O.on("mouseup",R),O.on("input",U)),O(stats.parentNode,O(N("Run this"),{style:{bottom:"0",fontSize:"10pt",position:"absolute",right:"0"}},O.on("click",C))),g=z.COMPACT,B=z.AUTO.includes(g)?g:z.BROWSER,compMenu.value=B.name,compMenu.previousIndex=compMenu.selectedIndex,W?(A=L)():(g=O(N("Encode"),O.on("click",M)),O(controls,g),A=j,outputArea.value=""),"undefined"!=typeof File&&(e=O("INPUT",{accept:".js",style:{display:"none"},type:"file"},O.on("change",V)),w=HTMLInputElement.prototype.click.bind(e),J=O(N("Load file…"),O.on("click",w)),O(controls,J,e)),inputArea.oninput=A;var t,i,r,a,c,u,l,s,d,e,p,f,m,b,v,y,h,g,A,k,w=function(){var e=compMenu.selectedIndex,t=compMenu.options[e].value,n=t?z[t]:F.feature;!q&&z.areEqual(n,B)||(B=n,this()),e!==compMenu.previousIndex&&(compMenu.previousIndex=e,H.rollTo(+!t))}.bind(A);function S(e,t){return O("LABEL",{style:{display:"inline-table"}},O("SPAN",{style:{display:"table-cell",verticalAlign:"middle"}},O("INPUT",{style:{margin:"0 .25em 0 0"},type:"checkbox"},t)),O("SPAN",{style:{display:"table-cell"}},e))}function x(e){var t=O("DIV",{className:"help-text"});return t.innerHTML=e,O("SPAN",{className:"focusable",style:{background:"black",borderRadius:"1em",color:"white",cursor:"pointer",display:"inline-table",fontSize:"8pt",fontWeight:"bold",lineHeight:"10.5pt",position:"relative",textAlign:"center",top:"-1.5pt",width:"10.5pt"},title:"Learn more…"},"?",E,O.on("click",function(){D(t)}))}function I(){var t=p.checked;Array.prototype.forEach.call(m,function(e){e.checked=t})}function T(){var t=JScrewIt.Feature,e=Array.prototype.filter.call(m,function(e){return e.checked}).map(function(e){return++n,t[e.featureName]}),n=e.length;p.checked=n,p.indeterminate=n&&n<m.length,f=t.commonOf.apply(null,e)||t.DEFAULT,v.checked&&(f=f.restrict("web-worker",e)),b.checked&&(f=f.restrict("forced-strict-mode",e))}O(compMenu,O.on("change",w)),F=O((y=O(S("Select/deselect all"),{style:{margin:"0 0 .5em"}},O.on("change",I),O.on(["keyup","mouseup"],function(){setTimeout(function(){p.indeterminate||I()})})),h=O("TABLE",{style:{borderSpacing:"0",width:"100%"}}),g=S("Generate strict mode code"),A=S("Support web workers"),k=O("FIELDSET",{className:"engine-selection-box",get feature(){return f}},O("DIV",O("P",{style:{margin:".25em 0 .75em"}},"Select the engines you want your code to support."),y,h,O("HR"),O("DIV",A," ",x("<p>Web workers are part of a standard HTML technology used to perform background tasks in JavaScript.<p>Check the option <dfn>Support web workers</dfn> only if your code needs to run inside a web worker. To create or use a web worker in your code, this option is not required.")),O("DIV",g," ",x('<p>The option <dfn>Generate strict mode code</dfn> instructs JScrewIt to avoid optimizations that don\'t work in strict mode JavaScript code. Check this option only if your environment disallows non-strict code. You may want to do this for example in one of the following circumstances.<ul><li>To encode a string or a number and embed it in a JavaScript file in a place where strict mode code is expected, like in a scope containing a <code>"use strict"</code> statement or in a class body.<li>To encode a script and run it in Node.js with the option <code>--use_strict</code>.<li>To encode an ECMAScript module. Note that module support in JSFuck is <em>very</em> limited, as <code>import</code> and <code>export</code> statements don\'t work at all. If your module doesn\'t contain these statements, you can encode it using this option.</ul><p>In most other cases, this option is not required, not even to encode a script that contains a top level <code>"use strict"</code> statement.')),O.on("change",function(){var e;T(),(e=document.createEvent("Event")).initEvent("input",!0,!1),k.dispatchEvent(e)}))),["Chrome","Edge","Firefox","Internet Explorer","Safari","Opera","Android Browser","Node.js"].forEach(function(e,t){for(var n,o=JScrewIt.Feature.FAMILIES[e],i=1&t?{className:"even-field"}:null,r=(o.length+2)/3^0,a=3*r,c=0;c<a;++c){var u=o[c];c%3||(n=O("TR",i),c||O(n,O("TD",{rowSpan:r,style:{padding:"0 .5em 0 0"}},e)),O(h,n));var l,s,d,p,f=null;u&&(null==(d=(l=u.version).value)&&(s=l.from,d=null==(p=l.to)?s+"+":s+"–"+p),null!=(p=u.shortTag)&&(d+=" ("+p+")"),f=S(d,{checked:!0,featureName:u.featureName})),O(n,O("TD",{style:{padding:"0 0 0 .5em",width:"6em"}},f))}}),p=y.querySelector("INPUT"),m=h.querySelectorAll("INPUT"),b=g.querySelector("INPUT"),v=A.querySelector("INPUT"),T(),k),O.on("input",w)),d=s=0,e=O("DIV"),(r=e.style).display="none",t=O("DIV",e,{container:e,rollTo:function(e){var t;e===d?o():((t=d<e?1:-1)!==s&&(u=d,l=+new Date,s=t),a=e,c=c||setInterval(n,0))}}),(i=t.style).height="0",i.overflowY="hidden",H=t,w="Custom Compatibility Selection","open"in(e=document.createElement("DETAILS"))?(O(e,{open:!0},O("SUMMARY",{dir:"rtl"},O("SPAN",{style:{float:"left"}},w))),O.css("details.frame:not([open])>:first-child",{"margin-bottom":"initial"})):e=O("DIV",O("SPAN",w)),O(H.container,O(e,{className:"frame"},F)),O(controls.parentNode,H),inputArea.selectionStart=2147483647,inputArea.focus()}function p(){document.addEventListener("DOMContentLoaded",d)}function V(){var e,t=this.files[0];t&&(inputArea.disabled=!0,inputArea.value="",J.disabled=!0,(e=new FileReader).addEventListener("loadend",s),e.readAsText(t))}function j(){A&&U(!0)}function f(){A=!1,outputArea.value="",stats.textContent="…"}function m(e){t=e,outputArea.disabled=e}function b(e){D(O("P",e))}function v(e){outputArea.value=e,U()}function U(e){var t=1===(t=outputArea.value.length)?"1 char":t+" chars";q=!!e,e&&(W&&(inputArea.onkeyup=l),t+=" – <i>out of sync</i>"),A=!0,stats.innerHTML=t}var y,h=Object,O=function(e){for(var t=e instanceof Node?e:"function"==typeof e?e.call(O):document.createElement(e),n=arguments.length,o=0;++o<n;){var i=arguments[o];i instanceof Node?t.appendChild(i):a(i)?function o(i,r){h.keys(r).forEach(function(e){var t,n=h.getOwnPropertyDescriptor(r,e);"value"in n?(t=n.value,e in i&&a(t)?o(i[e],t):i[e]=t):h.defineProperty(i,e,n)})}(t,i):"function"==typeof i?i.call(O,t):null!=i&&(i=document.createTextNode(i),t.appendChild(i))}return t};O.off=function(e,t,n){return o(e,t,n,"removeEventListener")},O.on=function(e,t,n){return o(e,t,n,"addEventListener")},O.css=function(e,t){var n,o=t;t=e=e+"{"+h.keys(n=o).map(function(e){return e+":"+n[e]}).join(";")+"}",y||(e=O("STYLE"),O(document.head,e),y=e.sheet),y.insertRule(t,y.cssRules.length)},O.css(".button",{background:"#e0e0e0",color:"#212121",cursor:"default",display:"inline-block",position:"relative"}),O.css(".button, .button>:last-child",{"border-radius":".1em"}),O.css(".button.active, .button[tabindex]:active",{background:"#29b3e5"}),O.css(".button.active>:first-child, .button[tabindex]:active>:first-child",{left:".1em",top:".1em"}),O.css(".button.active>:last-child, .button[tabindex]:active>:last-child",{"border-color":"#0088b6"}),O.css(".button:not([tabindex])",{background:"#e9e9e9",color:"#707070"}),O.css(".button:not([tabindex])>:last-child",{"border-color":"#bababa"}),O.css(".button>:first-child",{display:"inline-block",margin:".15em .5em",position:"relative","user-select":"none","-moz-user-select":"none","-ms-user-select":"none","-webkit-user-select":"none"}),O.css(".button>:last-child",{"border-color":"#707070","border-style":"solid","border-width":"1px",display:"inline-block",position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}),O.css(".button[tabindex]:hover:not(.active):not(:active)",{background:"#a3f4ff"}),O.css(".button[tabindex]:hover:not(.active):not(:active)>:last-child",{"border-color":"#189fdd"}),O.css("#modalBox p:first-child",{"margin-top":"0"}),O.css("#modalBox p:last-child",{"margin-bottom":"0"}),O.css(".engine-selection-box",{background:"#f0f0f0"}),O.css(".engine-selection-box .even-field",{background:"#fff"}),O.css(".help-text",{"font-size":"11pt","text-align":"justify"}),O.css(".help-text code",{"white-space":"pre"}),O.css(".help-text dfn",{"font-style":"normal","font-weight":"bold"}),O.css(".help-text li",{margin:".5em 0"});var B,F,g,J,q,A,H,t,W,k,w="application/javascript",z=JScrewIt.Feature;!function(){var t;try{(t=new XMLHttpRequest).open("GET","lib/jscrewit.min.js",!0)}catch(e){t=void 0}if(t&&"undefined"!=typeof Worker){k=URL.createObjectURL(new Blob(['"use strict";self.onmessage=function(t){var r=t.data,t=r.url;null!=t&&importScripts(t);t=r.input;if(null!=t){try{e={output:JScrewIt.encode(t,r.options)}}catch(t){var e={error:String(t)}}postMessage(e)}};'],{type:w}));try{n()}catch(e){r()}}W?(t.onerror=function(){W.terminate(),W=void 0,r()},t.onload=function(){t.status<400?(g=URL.createObjectURL(t.response),W.postMessage({url:g})):this.onerror()},t.onloadend=function(){("loading"===document.readyState?p:d)()},t.overrideMimeType(w),t.responseType="blob",t.send()):p()}()}();
|