!function(e){"use strict";var t=function(){var e=8,t=2048,n={"extension/installer/unzip":"unzip","extension/installer/ftp":"ftp","extension/installer/localcopy":"localcopy","extension/installer/local_copy":"localcopy","extension/installer/php":"php","extension/installer/xml":"xml","extension/installer/remove":"remove"};function r(e){var t=new Error(e);throw t.code=e,t}function a(e){var t={route:0,token:0};e.searchParams.forEach(function(e,n){Object.prototype.hasOwnProperty.call(t,n)||r("native_route_rejected"),t[n]++}),1===t.route&&1===t.token||r("native_route_rejected")}function o(e,t){var o;try{o=new URL(String(e||""),t.origin)}catch(e){r("native_route_rejected")}(!/^https?:$/.test(o.protocol)||o.origin!==t.origin||o.pathname!==t.pathname||o.username||o.password||o.hash||o.searchParams.get("token")!==t.searchParams.get("token"))&&r("native_route_rejected"),a(o);var i=String(o.searchParams.get("route")||"");return Object.prototype.hasOwnProperty.call(n,i)||r("native_route_rejected"),{url:o.href,route:i,kind:n[i]}}function i(e,t){var n;try{n=new URL(String(e||""),String(t||""))}catch(e){r("native_route_rejected")}return(!/^https?:$/.test(n.protocol)||n.origin!==String(t||n.origin)||n.username||n.password||n.hash||"extension/installer/upload"!==n.searchParams.get("route")||!/^[A-Za-z0-9_-]{16,128}$/.test(String(n.searchParams.get("token")||"")))&&r("native_route_rejected"),a(n),n}function s(e){var t=String(e||"");return/^temp-[A-Za-z0-9]{32}$/.test(t)||r("native_path_rejected"),t}function c(e){var t=String(e||"").replace(/\\/g,"/");return!(!t||"/"===t.charAt(0)||-1!==t.indexOf("\0")||-1!==t.split("/").indexOf(".."))&&[/^admin\/controller\/extension\/module\/easychat(?:\.php|\/)/,/^admin\/language\/[A-Za-z0-9_-]+\/extension\/module\/easychat\.php$/,/^admin\/view\/javascript\/easychat\//,/^admin\/view\/template\/extension\/module\/easychat(?:[_.\/])/,/^catalog\/controller\/extension\/module\/easychat(?:\.php|\/)/,/^catalog\/view\/theme\/[A-Za-z0-9_-]+\/template\/extension\/module\/easychat(?:\.tpl|\.twig)$/,/^system\/library\/easychat(?:_|\/)/].some(function(e){return e.test(t)})}function l(e){(!Array.isArray(e)||e.length>t)&&r("native_package_scope_rejected"),e.forEach(function(e){"string"==typeof e&&c(e)||r("native_package_scope_rejected")})}function p(t,n,a){t&&"object"==typeof t&&Array.isArray(t.step)&&Array.isArray(t.overwrite)||r("native_response_invalid"),(t.step.length<5||t.step.length>e)&&r("native_response_invalid");var c=i(n,a);l(t.overwrite);var p="",u=t.step.map(function(e){e&&"object"==typeof e||r("native_response_invalid");var t=s(e.path);p?p!==t&&r("native_path_rejected"):p=t;var n=o(e.url,c);return n.path=p,n}),h=u.map(function(e){return e.kind}),v=h[1],d=h.slice(2,-1).sort().join(",");return("unzip"!==h[0]||"ftp"!==v&&"localcopy"!==v||"remove"!==h[h.length-1]||"php,xml"!==d||5!==u.length)&&r("native_sequence_rejected"),{path:p,transport:v,steps:u,cleanup:u[u.length-1],overwriteCount:t.overwrite.length}}return{create:p,isOwnedOverwrite:c}}();"object"==typeof module&&module.exports&&(module.exports=t),e&&(e.EasyChatOpenCart2InstallPlan=t)}("undefined"!=typeof window?window:null);