Changeset 3451408
- Timestamp:
- 02/01/2026 02:32:59 PM (2 months ago)
- Location:
- docu-chat
- Files:
-
- 58 added
- 3 edited
-
tags/1.0.3 (added)
-
tags/1.0.3/admin (added)
-
tags/1.0.3/admin/docuchat_outputBackendDocuChat.php (added)
-
tags/1.0.3/admin/modules (added)
-
tags/1.0.3/admin/modules/docuchat_activation_module.php (added)
-
tags/1.0.3/admin/modules/docuchat_document_module.php (added)
-
tags/1.0.3/admin/modules/docuchat_gofoundme_layout.php (added)
-
tags/1.0.3/admin/modules/docuchat_next_updates.php (added)
-
tags/1.0.3/admin/modules/docuchat_process_complete.php (added)
-
tags/1.0.3/admin/modules/docuchat_register_module.php (added)
-
tags/1.0.3/admin/modules/docuchat_submenu_delete_data_from_server.php (added)
-
tags/1.0.3/assets (added)
-
tags/1.0.3/assets/screenshot-0.png (added)
-
tags/1.0.3/assets/screenshot-1.png (added)
-
tags/1.0.3/assets/screenshot-2.png (added)
-
tags/1.0.3/assets/screenshot-3.png (added)
-
tags/1.0.3/assets/screenshot-4.png (added)
-
tags/1.0.3/assets/screenshot-5.png (added)
-
tags/1.0.3/docuchat.php (added)
-
tags/1.0.3/front (added)
-
tags/1.0.3/front/docuchat_layout.php (added)
-
tags/1.0.3/helpers (added)
-
tags/1.0.3/helpers/docuchat_plugin_activate.php (added)
-
tags/1.0.3/helpers/docuchat_plugin_deletePartialLocalData.php (added)
-
tags/1.0.3/helpers/docuchat_plugin_document_uploaded_status.php (added)
-
tags/1.0.3/helpers/docuchat_plugin_llmChat.php (added)
-
tags/1.0.3/helpers/docuchat_plugin_register.php (added)
-
tags/1.0.3/helpers/docuchat_plugin_uploadFile.php (added)
-
tags/1.0.3/public (added)
-
tags/1.0.3/public/docuchat_banner.jpg (added)
-
tags/1.0.3/public/docuchat_conffety.png (added)
-
tags/1.0.3/public/docuchat_logo.png (added)
-
tags/1.0.3/public/docuchat_mockChat.png (added)
-
tags/1.0.3/public/docuchat_pig.png (added)
-
tags/1.0.3/public/docuchat_robot.png (added)
-
tags/1.0.3/public/docuchat_robotTrash.png (added)
-
tags/1.0.3/readme.txt (added)
-
tags/1.0.3/src (added)
-
tags/1.0.3/src/docuchat_backend.js (added)
-
tags/1.0.3/src/docuchat_backend.js.LICENSE.txt (added)
-
tags/1.0.3/src/docuchat_front.js (added)
-
tags/1.0.3/src/docuchat_front.js.LICENSE.txt (added)
-
tags/1.0.3/src/styles (added)
-
tags/1.0.3/src/styles/docuchat_backend.css (added)
-
tags/1.0.3/src/styles/docuchat_front.css (added)
-
tags/1.0.3/utils (added)
-
tags/1.0.3/utils/docuchat_activation_process.php (added)
-
tags/1.0.3/utils/docuchat_add_action_links.php (added)
-
tags/1.0.3/utils/docuchat_add_images_and_resources.php (added)
-
tags/1.0.3/utils/docuchat_adminMenu.php (added)
-
tags/1.0.3/utils/docuchat_adminSubMenu.php (added)
-
tags/1.0.3/utils/docuchat_ajaxconections.php (added)
-
tags/1.0.3/utils/docuchat_deleteAcounSubMenu.php (added)
-
tags/1.0.3/utils/docuchat_get_file_from_nameOrId.php (added)
-
tags/1.0.3/utils/docuchat_get_image_from_name.php (added)
-
tags/1.0.3/utils/docuchat_remove_images_and_resources.php (added)
-
tags/1.0.3/utils/docuchat_script_styles_files.php (added)
-
tags/1.0.3/utils/function.php (added)
-
trunk/docuchat.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src/docuchat_backend.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
docu-chat/trunk/docuchat.php
r3451366 r3451408 5 5 * Plugin Name: Docu chat 6 6 * plugin URI: https://docuchat.es 7 * version:1.0. 27 * version:1.0.3 8 8 * Text Domain: docu-chat 9 9 * Tested up to: 6.2 -
docu-chat/trunk/readme.txt
r3451374 r3451408 4 4 Requires at least: 4.7 5 5 Tested up to: 6.7 6 Stable tag: 1.0. 26 Stable tag: 1.0.3 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 Help your cliend answer in a automatic chat that answer question with a pdf sended. 11 12 == Actual version == 13 14 1.0.3 This version was fixed a error that try to connec with a local server 11 15 12 16 -
docu-chat/trunk/src/docuchat_backend.js
r3451366 r3451408 1 1 /*! For license information please see docuchat_backend.js.LICENSE.txt */ 2 (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,o(r.key),r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(t,e,n){return(e=o(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(e){var n=function(e){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}const i=n((function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r(this,"submnitForm",(function(){e.form&&e.form.addEventListener("submit",(function(t){e.message.innerHTML+='<div class="loaderAnimation"><span class="dot"></span></div>',t.preventDefault();var n=new FormData(e.form),r={};n.forEach((function(t,e){r[e]=t})),e.nonce_now=r._wpnonce,e.sendInfo(r,e.message)}))})),r(this,"sendInfo",(function(t,n){fetch("http ://localhost:8000/api/v1/register",{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(t){200==t.status&&e.saveData(t.token,t.email,n),400==t.status&&e.returnExeption(t.message,n)}))})),r(this,"saveData",(function(t,n,r){jQuery.ajax({type:"post",url:docuchat_ajax.url,dataType:"text",data:"action=register&token=".concat(t,"&email=").concat(n,"&nonce=").concat(e.nonce_now),error:function(t){console.error(t)},success:function(t){var e=JSON.parse(t.replace("}0","}"));if(200==e.status){r.innerHTML+='<p class="success">'.concat(e.message,"</p>");var n=setTimeout((function(){r.innerHTML+='<p class="success">Check your email, we\'ve send you a email</p>',clearTimeout(n)}),4e3),o=setTimeout((function(){r.innerHTML+='<p class="success">Automatic reload to next step...</p>',clearTimeout(o)}),8600),i=setTimeout((function(){window.location.reload(),clearTimeout(i)}),13e3)}else r.innerHTML="",r.innerHTML+='<div id="my-note-id" class="notice notice-error is-dismissible my-note-class-1 my-note-class-2">\n <p>'.concat(e.message,"</p>\n </div>")}})})),r(this,"returnExeption",(function(t,e){e&&(e.innerHTML+='<p class="error" style="color:red">'.concat(t,"</p>"))})),this.form=document.getElementById("register_form"),this.message=document.getElementsByClassName("docuchatMain_container_body_content_response")[0],this.nonce_now,this.submnitForm()}));function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,s(r.key),r)}}function u(t,e,n){return(e=s(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}const l=function(){return t=function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,"sendInfo",(function(t,n){fetch("http://localhost:8000/api/v1/activate",{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(t){200==t.status?e.saveData(t.message,n):e.returnExeption(t.message,n)}))})),u(this,"saveData",(function(t,n){jQuery.ajax({type:"post",url:docuchat_ajax.url,dataType:"text",data:"action=activate&status=".concat(t,"&nonce=").concat(e.nonce_now),error:function(t){console.error(t)},success:function(t){var e=JSON.parse(t.replace("}0","}"));if(200==e.status){n.innerHTML+='<p class="success">'.concat(e.message,"</p>");var r=setTimeout((function(){n.innerHTML+='<p class="success">Plugin ready to recive your document.</p>',clearTimeout(r)}),4e3),o=setTimeout((function(){n.innerHTML+='<p class="success">Automatic reload to next step...</p>',clearTimeout(o)}),8600),i=setTimeout((function(){window.location.reload(),clearTimeout(i)}),13e3)}}})})),u(this,"returnExeption",(function(t,e){e.innerHTML+='<p class="error" style="color:red">'.concat(t,"</p>")})),this.form=document.getElementById("activate_form"),this.message=document.getElementsByClassName("docuchatMain_container_body_content_response")[0],this.nonce_now,this.submnitForm()},e=[{key:"submnitForm",value:function(){var t=this;this.form&&this.form.addEventListener("submit",(function(e){e.preventDefault(),t.message.innerHTML+='<div class="loaderAnimation"><span class="dot"></span></div>';var n=new FormData(t.form),r={};n.forEach((function(t,e){r[e]=t})),docuchat_ajax.emailRegistred&&(r.email=docuchat_ajax.emailRegistred),docuchat_ajax.token&&(r.token=docuchat_ajax.token),t.nonce_now=r._wpnonce,t.saveData(r,t.message),e.target.reset()}))}}],e&&c(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,y(r.key),r)}}function h(t,e,n){return(e=y(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t){var e=function(t){if("object"!=f(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==f(e)?e:e+""}const m=function(){return t=function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,"sendInfo",(function(t,n){jQuery.ajax({type:"post",url:docuchat_ajax.url,dataType:"text",data:"action=uploadFile&file=".concat(t.get("fileNumber"),"&nonce=").concat(e.nonce_now),error:function(t){console.error(t)},success:function(t){var e=JSON.parse(t.replace("}0","}")),r=JSON.parse(e.body);200==r.status?(n.innerHTML+='<p class="success">'.concat(r.message,"</p>"),this.saveData(r.status,n)):this.returnExeption(r.message,n)}.bind(e)})})),h(this,"saveData",(function(t,n){jQuery.ajax({type:"post",url:docuchat_ajax.url,dataType:"text",data:"action=document&status=".concat(t,"&nonce=").concat(e.nonce_now),error:function(t){console.error(t)},success:function(t){var e=JSON.parse(t.replace("}0","}"));if(200==e.status){n.innerHTML+='<p class="success">'.concat(e.message,"</p>");var r=setTimeout((function(){n.innerHTML+='<p class="success">Document has benn uploaded, now can interact with DocuChat</p>',clearTimeout(r)}),4e3),o=setTimeout((function(){n.innerHTML+='<p class="success">Automatic reload, thanks for using DocuChat</p>',clearTimeout(o)}),8600),i=setTimeout((function(){window.location.reload(),clearTimeout(i)}),1e4)}else this.returnExeption(e.message,n)}})})),h(this,"returnExeption",(function(t,e){e.innerHTML+='<p class="error" style="color:red">'.concat(t,"</p>"),setTimeout((function(){window.location.reload()}),5e3)})),this.form=document.getElementById("document_form"),this.message=document.getElementsByClassName("docuchatMain_container_body_content_response")[0],this.nonce_now,this.submnitForm()},e=[{key:"submnitForm",value:function(){var t=this;this.form&&this.form.addEventListener("submit",(function(e){e.preventDefault(),t.message.innerHTML+='<div class="loaderAnimation"><span class="dot"></span></div>',t.message.innerHTML+='<p class="success">Please wait, this can take a few minutes..</p>';var n=new FormData(t.form);t.nonce_now=n.get("_wpnonce"),t.sendInfo(n,t.message)}))}}],e&&p(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function v(){v=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new M(r||[]);return o(a,"_invoke",{value:O(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function x(){}var L={};s(L,a,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(H([])));_&&_!==n&&r.call(_,a)&&(L=_);var T=x.prototype=b.prototype=Object.create(L);function j(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==d(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=P(c,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?m:h,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function P(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function H(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(d(e)+" is not iterable")}return w.prototype=x,o(T,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=s(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,s(t,u,"GeneratorFunction")),t.prototype=Object.create(T),t},e.awrap=function(t){return{__await:t}},j(S.prototype),s(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new S(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(T),s(T,u,"Generator"),s(T,a,(function(){return this})),s(T,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=H,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:H(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function g(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,w(r.key),r)}}function w(t){var e=function(t){if("object"!=d(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==d(e)?e:e+""}const x=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.deleteButton,this.responseBox,this.init()},e=[{key:"init",value:function(){var t=this;document.getElementsByClassName("docuchatMain_container_delete_left_button")[0]&&(this.responseBox=document.getElementsByClassName("delete_acount_responses")[0],this.deleteButton=document.getElementsByClassName("docuchatMain_container_delete_left_button")[0],this.deleteButton.addEventListener("click",(function(e){e.preventDefault(),t.responseBox.innerHTML="",t.responseBox.innerHTML+='<div class="loaderAnimation"><span class="dot"></span></div>',fetch("http://localhost:8000/api/v1/d_acount",{method:"DELETE",body:JSON.stringify({token:docuchat_ajax.token}),headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(e){t.responseBox.innerHTML="",200==e.status?(t.responseBox.innerHTML+='<p class="success">'.concat(e.message,"</p>"),t.deletePartialData(t.responseBox)):(t.responseBox.innerHTML+='<p class="error">'.concat(e.message,"</p>"),t.deletePartialData(t.responseBox))}))})))}},{key:"deletePartialData",value:(n=v().mark((function t(e){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:jQuery.ajax({type:"post",url:docuchat_ajax.url,dataType:"text",data:"action=partialDelete&nonce=".concat(docuchat_ajax.partialDelete_nonce),success:function(t){var n=JSON.parse(t);200==n.status&&(e.innerHTML+='<p class="success">'.concat(n.message,"</p>"),setTimeout((function(){window.location.href=ajax.adminUrl}),3e3))},error:function(t){var n=JSON.parse(t);e.innerHTML+='<p class="success">'.concat(n.message,"</p>"),setTimeout((function(){window.location.reload()}),3e3)}});case 1:case"end":return t.stop()}}),t)})),r=function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){g(i,r,o,a,c,"next",t)}function c(t){g(i,r,o,a,c,"throw",t)}a(void 0)}))},function(t){return r.apply(this,arguments)})}],e&&b(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n,r}();function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function E(){E=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new M(r||[]);return o(a,"_invoke",{value:O(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",y="executing",m="completed",d={};function v(){}function g(){}function b(){}var w={};s(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(H([])));_&&_!==n&&r.call(_,a)&&(w=_);var T=b.prototype=v.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==L(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=P(c,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?m:h,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function P(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function H(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(L(e)+" is not iterable")}return g.prototype=b,o(T,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,u,"GeneratorFunction")),t.prototype=Object.create(T),t},e.awrap=function(t){return{__await:t}},j(S.prototype),s(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new S(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(T),s(T,u,"Generator"),s(T,a,(function(){return this})),s(T,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=H,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:H(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),d}},e}function _(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function T(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,j(r.key),r)}}function j(t){var e=function(t){if("object"!=L(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=L(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==L(e)?e:e+""}const S=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pdfSelector=document.getElementById("pdfSelector"),this.inputPdfSelector=document.getElementById("fileNumberInput"),this.init()},e=[{key:"init",value:function(){var t=this;this.pdfSelector&&this.pdfSelector.addEventListener("click",(function(e){var n=null,r=t.inputPdfSelector;t.pdfSelector&&t.inputPdfSelector&&t.pdfSelector.addEventListener("click",(function(t){t.preventDefault(),(n=wp.media({title:"Select a pdf 150mb max",button:{text:"Use this pdf"},library:{type:"application/pdf"},multiple:!1})).on("select",function(){var t,e=(t=E().mark((function t(e){var o;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.state().get("selection").first().toJSON();case 2:return o=t.sent,r.value=o.id,t.abrupt("return");case 5:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){_(i,r,o,a,c,"next",t)}function c(t){_(i,r,o,a,c,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}()),n&&n.open()}))}))}}],e&&T(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();window.addEventListener("load",(function(){window.RegisterForm=new i,window.ActivationForm=new l,window.UploadForm=new m,window.DeleteAcount=new x,window.SelectFileFromMedia=new S}))})();2 (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,o(r.key),r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(t,e,n){return(e=o(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(e){var n=function(e){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}const i=n((function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r(this,"submnitForm",(function(){e.form&&e.form.addEventListener("submit",(function(t){e.message.innerHTML+='<div class="loaderAnimation"><span class="dot"></span></div>',t.preventDefault();var n=new FormData(e.form),r={};n.forEach((function(t,e){r[e]=t})),e.nonce_now=r._wpnonce,e.sendInfo(r,e.message)}))})),r(this,"sendInfo",(function(t,n){fetch("https://api.docuchat.es/api/v1/register",{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(t){200==t.status&&e.saveData(t.token,t.email,n),400==t.status&&e.returnExeption(t.message,n)}))})),r(this,"saveData",(function(t,n,r){jQuery.ajax({type:"post",url:docuchat_ajax.url,dataType:"text",data:"action=register&token=".concat(t,"&email=").concat(n,"&nonce=").concat(e.nonce_now),error:function(t){console.error(t)},success:function(t){var e=JSON.parse(t.replace("}0","}"));if(200==e.status){r.innerHTML+='<p class="success">'.concat(e.message,"</p>");var n=setTimeout((function(){r.innerHTML+='<p class="success">Check your email, we\'ve send you a email</p>',clearTimeout(n)}),4e3),o=setTimeout((function(){r.innerHTML+='<p class="success">Automatic reload to next step...</p>',clearTimeout(o)}),8600),i=setTimeout((function(){window.location.reload(),clearTimeout(i)}),13e3)}else r.innerHTML="",r.innerHTML+='<div id="my-note-id" class="notice notice-error is-dismissible my-note-class-1 my-note-class-2">\n <p>'.concat(e.message,"</p>\n </div>")}})})),r(this,"returnExeption",(function(t,e){e&&(e.innerHTML+='<p class="error" style="color:red">'.concat(t,"</p>"))})),this.form=document.getElementById("register_form"),this.message=document.getElementsByClassName("docuchatMain_container_body_content_response")[0],this.nonce_now,this.submnitForm()}));function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,s(r.key),r)}}function u(t,e,n){return(e=s(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}const l=function(){return t=function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,"sendInfo",(function(t,n){fetch("https://api.docuchat.es/api/v1/activate",{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(t){200==t.status?e.saveData(t.message,n):e.returnExeption(t.message,n)}))})),u(this,"saveData",(function(t,n){jQuery.ajax({type:"post",url:docuchat_ajax.url,dataType:"text",data:"action=activate&status=".concat(t,"&nonce=").concat(e.nonce_now),error:function(t){console.error(t)},success:function(t){var e=JSON.parse(t.replace("}0","}"));if(200==e.status){n.innerHTML+='<p class="success">'.concat(e.message,"</p>");var r=setTimeout((function(){n.innerHTML+='<p class="success">Plugin ready to recive your document.</p>',clearTimeout(r)}),4e3),o=setTimeout((function(){n.innerHTML+='<p class="success">Automatic reload to next step...</p>',clearTimeout(o)}),8600),i=setTimeout((function(){window.location.reload(),clearTimeout(i)}),13e3)}}})})),u(this,"returnExeption",(function(t,e){e.innerHTML+='<p class="error" style="color:red">'.concat(t,"</p>")})),this.form=document.getElementById("activate_form"),this.message=document.getElementsByClassName("docuchatMain_container_body_content_response")[0],this.nonce_now,this.submnitForm()},e=[{key:"submnitForm",value:function(){var t=this;this.form&&this.form.addEventListener("submit",(function(e){e.preventDefault(),t.message.innerHTML+='<div class="loaderAnimation"><span class="dot"></span></div>';var n=new FormData(t.form),r={};n.forEach((function(t,e){r[e]=t})),docuchat_ajax.emailRegistred&&(r.email=docuchat_ajax.emailRegistred),docuchat_ajax.token&&(r.token=docuchat_ajax.token),t.nonce_now=r._wpnonce,t.saveData(r,t.message),e.target.reset()}))}}],e&&c(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,y(r.key),r)}}function h(t,e,n){return(e=y(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t){var e=function(t){if("object"!=f(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==f(e)?e:e+""}const m=function(){return t=function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,"sendInfo",(function(t,n){jQuery.ajax({type:"post",url:docuchat_ajax.url,dataType:"text",data:"action=uploadFile&file=".concat(t.get("fileNumber"),"&nonce=").concat(e.nonce_now),error:function(t){console.error(t)},success:function(t){var e=JSON.parse(t.replace("}0","}")),r=JSON.parse(e.body);200==r.status?(n.innerHTML+='<p class="success">'.concat(r.message,"</p>"),this.saveData(r.status,n)):this.returnExeption(r.message,n)}.bind(e)})})),h(this,"saveData",(function(t,n){jQuery.ajax({type:"post",url:docuchat_ajax.url,dataType:"text",data:"action=document&status=".concat(t,"&nonce=").concat(e.nonce_now),error:function(t){console.error(t)},success:function(t){var e=JSON.parse(t.replace("}0","}"));if(200==e.status){n.innerHTML+='<p class="success">'.concat(e.message,"</p>");var r=setTimeout((function(){n.innerHTML+='<p class="success">Document has benn uploaded, now can interact with DocuChat</p>',clearTimeout(r)}),4e3),o=setTimeout((function(){n.innerHTML+='<p class="success">Automatic reload, thanks for using DocuChat</p>',clearTimeout(o)}),8600),i=setTimeout((function(){window.location.reload(),clearTimeout(i)}),1e4)}else this.returnExeption(e.message,n)}})})),h(this,"returnExeption",(function(t,e){e.innerHTML+='<p class="error" style="color:red">'.concat(t,"</p>"),setTimeout((function(){window.location.reload()}),5e3)})),this.form=document.getElementById("document_form"),this.message=document.getElementsByClassName("docuchatMain_container_body_content_response")[0],this.nonce_now,this.submnitForm()},e=[{key:"submnitForm",value:function(){var t=this;this.form&&this.form.addEventListener("submit",(function(e){e.preventDefault(),t.message.innerHTML+='<div class="loaderAnimation"><span class="dot"></span></div>',t.message.innerHTML+='<p class="success">Please wait, this can take a few minutes..</p>';var n=new FormData(t.form);t.nonce_now=n.get("_wpnonce"),t.sendInfo(n,t.message)}))}}],e&&p(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function v(){v=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new M(r||[]);return o(a,"_invoke",{value:O(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function x(){}var L={};s(L,a,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(H([])));_&&_!==n&&r.call(_,a)&&(L=_);var T=x.prototype=b.prototype=Object.create(L);function j(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==d(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=P(c,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?m:h,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function P(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function H(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(d(e)+" is not iterable")}return w.prototype=x,o(T,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=s(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,s(t,u,"GeneratorFunction")),t.prototype=Object.create(T),t},e.awrap=function(t){return{__await:t}},j(S.prototype),s(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new S(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(T),s(T,u,"Generator"),s(T,a,(function(){return this})),s(T,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=H,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:H(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function g(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,w(r.key),r)}}function w(t){var e=function(t){if("object"!=d(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==d(e)?e:e+""}const x=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.deleteButton,this.responseBox,this.init()},e=[{key:"init",value:function(){var t=this;document.getElementsByClassName("docuchatMain_container_delete_left_button")[0]&&(this.responseBox=document.getElementsByClassName("delete_acount_responses")[0],this.deleteButton=document.getElementsByClassName("docuchatMain_container_delete_left_button")[0],this.deleteButton.addEventListener("click",(function(e){e.preventDefault(),t.responseBox.innerHTML="",t.responseBox.innerHTML+='<div class="loaderAnimation"><span class="dot"></span></div>',fetch("https://api.docuchat.es/api/v1/d_acount",{method:"DELETE",body:JSON.stringify({token:docuchat_ajax.token}),headers:{"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(e){t.responseBox.innerHTML="",200==e.status?(t.responseBox.innerHTML+='<p class="success">'.concat(e.message,"</p>"),t.deletePartialData(t.responseBox)):(t.responseBox.innerHTML+='<p class="error">'.concat(e.message,"</p>"),t.deletePartialData(t.responseBox))}))})))}},{key:"deletePartialData",value:(n=v().mark((function t(e){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:jQuery.ajax({type:"post",url:docuchat_ajax.url,dataType:"text",data:"action=partialDelete&nonce=".concat(docuchat_ajax.partialDelete_nonce),success:function(t){var n=JSON.parse(t);200==n.status&&(e.innerHTML+='<p class="success">'.concat(n.message,"</p>"),setTimeout((function(){window.location.href=ajax.adminUrl}),3e3))},error:function(t){var n=JSON.parse(t);e.innerHTML+='<p class="success">'.concat(n.message,"</p>"),setTimeout((function(){window.location.reload()}),3e3)}});case 1:case"end":return t.stop()}}),t)})),r=function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){g(i,r,o,a,c,"next",t)}function c(t){g(i,r,o,a,c,"throw",t)}a(void 0)}))},function(t){return r.apply(this,arguments)})}],e&&b(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n,r}();function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function E(){E=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new M(r||[]);return o(a,"_invoke",{value:O(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",y="executing",m="completed",d={};function v(){}function g(){}function b(){}var w={};s(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(H([])));_&&_!==n&&r.call(_,a)&&(w=_);var T=b.prototype=v.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==L(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=P(c,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?m:h,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function P(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function H(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(L(e)+" is not iterable")}return g.prototype=b,o(T,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,u,"GeneratorFunction")),t.prototype=Object.create(T),t},e.awrap=function(t){return{__await:t}},j(S.prototype),s(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new S(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(T),s(T,u,"Generator"),s(T,a,(function(){return this})),s(T,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=H,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:H(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),d}},e}function _(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function T(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,j(r.key),r)}}function j(t){var e=function(t){if("object"!=L(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=L(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==L(e)?e:e+""}const S=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pdfSelector=document.getElementById("pdfSelector"),this.inputPdfSelector=document.getElementById("fileNumberInput"),this.init()},e=[{key:"init",value:function(){var t=this;this.pdfSelector&&this.pdfSelector.addEventListener("click",(function(e){var n=null,r=t.inputPdfSelector;t.pdfSelector&&t.inputPdfSelector&&t.pdfSelector.addEventListener("click",(function(t){t.preventDefault(),(n=wp.media({title:"Select a pdf 150mb max",button:{text:"Use this pdf"},library:{type:"application/pdf"},multiple:!1})).on("select",function(){var t,e=(t=E().mark((function t(e){var o;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.state().get("selection").first().toJSON();case 2:return o=t.sent,r.value=o.id,t.abrupt("return");case 5:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){_(i,r,o,a,c,"next",t)}function c(t){_(i,r,o,a,c,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}()),n&&n.open()}))}))}}],e&&T(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();window.addEventListener("load",(function(){window.RegisterForm=new i,window.ActivationForm=new l,window.UploadForm=new m,window.DeleteAcount=new x,window.SelectFileFromMedia=new S}))})();
Note: See TracChangeset
for help on using the changeset viewer.