HEX
Server: Apache/2.4.54 (Debian)
System: Linux a5825d2beacc 4.15.0-197-generic #208-Ubuntu SMP Tue Nov 1 17:23:37 UTC 2022 x86_64
User: root (0)
PHP: 8.1.14
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/complianz-gdpr/gutenberg/build/index.js
!function(){var t={669:function(t,e,n){t.exports=n(609)},448:function(t,e,n){"use strict";var r=n(867),o=n(26),s=n(372),i=n(327),a=n(97),c=n(109),u=n(985),l=n(61),p=n(655),f=n(263);t.exports=function(t){return new Promise((function(e,n){var d,h=t.data,m=t.headers,g=t.responseType;function y(){t.cancelToken&&t.cancelToken.unsubscribe(d),t.signal&&t.signal.removeEventListener("abort",d)}r.isFormData(h)&&delete m["Content-Type"];var v=new XMLHttpRequest;if(t.auth){var b=t.auth.username||"",S=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";m.Authorization="Basic "+btoa(b+":"+S)}var w=a(t.baseURL,t.url);function x(){if(v){var r="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,s={data:g&&"text"!==g&&"json"!==g?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:r,config:t,request:v};o((function(t){e(t),y()}),(function(t){n(t),y()}),s),v=null}}if(v.open(t.method.toUpperCase(),i(w,t.params,t.paramsSerializer),!0),v.timeout=t.timeout,"onloadend"in v?v.onloadend=x:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(x)},v.onabort=function(){v&&(n(l("Request aborted",t,"ECONNABORTED",v)),v=null)},v.onerror=function(){n(l("Network Error",t,null,v)),v=null},v.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||p.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(l(e,t,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},r.isStandardBrowserEnv()){var E=(t.withCredentials||u(w))&&t.xsrfCookieName?s.read(t.xsrfCookieName):void 0;E&&(m[t.xsrfHeaderName]=E)}"setRequestHeader"in v&&r.forEach(m,(function(t,e){void 0===h&&"content-type"===e.toLowerCase()?delete m[e]:v.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(v.withCredentials=!!t.withCredentials),g&&"json"!==g&&(v.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&v.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(d=function(t){v&&(n(!t||t&&t.type?new f("canceled"):t),v.abort(),v=null)},t.cancelToken&&t.cancelToken.subscribe(d),t.signal&&(t.signal.aborted?d():t.signal.addEventListener("abort",d))),h||(h=null),v.send(h)}))}},609:function(t,e,n){"use strict";var r=n(867),o=n(849),s=n(321),i=n(185),a=function t(e){var n=new s(e),a=o(s.prototype.request,n);return r.extend(a,s.prototype,n),r.extend(a,n),a.create=function(n){return t(i(e,n))},a}(n(655));a.Axios=s,a.Cancel=n(263),a.CancelToken=n(972),a.isCancel=n(502),a.VERSION=n(288).version,a.all=function(t){return Promise.all(t)},a.spread=n(713),a.isAxiosError=n(268),t.exports=a,t.exports.default=a},263:function(t){"use strict";function e(t){this.message=t}e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,t.exports=e},972:function(t,e,n){"use strict";var r=n(263);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;this.promise.then((function(t){if(n._listeners){var e,r=n._listeners.length;for(e=0;e<r;e++)n._listeners[e](t);n._listeners=null}})),this.promise.then=function(t){var e,r=new Promise((function(t){n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},o.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},o.source=function(){var t;return{token:new o((function(e){t=e})),cancel:t}},t.exports=o},502:function(t){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},321:function(t,e,n){"use strict";var r=n(867),o=n(327),s=n(782),i=n(572),a=n(185),c=n(875),u=c.validators;function l(t){this.defaults=t,this.interceptors={request:new s,response:new s}}l.prototype.request=function(t,e){if("string"==typeof t?(e=e||{}).url=t:e=t||{},!e.url)throw new Error("Provided config url is not valid");(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var r=[],o=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(o=o&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var s,l=[];if(this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)})),!o){var p=[i,void 0];for(Array.prototype.unshift.apply(p,r),p=p.concat(l),s=Promise.resolve(e);p.length;)s=s.then(p.shift(),p.shift());return s}for(var f=e;r.length;){var d=r.shift(),h=r.shift();try{f=d(f)}catch(t){h(t);break}}try{s=i(f)}catch(t){return Promise.reject(t)}for(;l.length;)s=s.then(l.shift(),l.shift());return s},l.prototype.getUri=function(t){if(!t.url)throw new Error("Provided config url is not valid");return t=a(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){l.prototype[t]=function(e,n){return this.request(a(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){l.prototype[t]=function(e,n,r){return this.request(a(r||{},{method:t,url:e,data:n}))}})),t.exports=l},782:function(t,e,n){"use strict";var r=n(867);function o(){this.handlers=[]}o.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=o},97:function(t,e,n){"use strict";var r=n(793),o=n(303);t.exports=function(t,e){return t&&!r(e)?o(t,e):e}},61:function(t,e,n){"use strict";var r=n(481);t.exports=function(t,e,n,o,s){var i=new Error(t);return r(i,e,n,o,s)}},572:function(t,e,n){"use strict";var r=n(867),o=n(527),s=n(502),i=n(655),a=n(263);function c(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new a("canceled")}t.exports=function(t){return c(t),t.headers=t.headers||{},t.data=o.call(t,t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||i.adapter)(t).then((function(e){return c(t),e.data=o.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return s(e)||(c(t),e&&e.response&&(e.response.data=o.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},481:function(t){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}},185:function(t,e,n){"use strict";var r=n(867);t.exports=function(t,e){e=e||{};var n={};function o(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function s(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:o(void 0,t[n]):o(t[n],e[n])}function i(t){if(!r.isUndefined(e[t]))return o(void 0,e[t])}function a(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:o(void 0,t[n]):o(void 0,e[n])}function c(n){return n in e?o(t[n],e[n]):n in t?o(void 0,t[n]):void 0}var u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return r.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,o=e(t);r.isUndefined(o)&&e!==c||(n[t]=o)})),n}},26:function(t,e,n){"use strict";var r=n(61);t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},527:function(t,e,n){"use strict";var r=n(867),o=n(655);t.exports=function(t,e,n){var s=this||o;return r.forEach(n,(function(n){t=n.call(s,t,e)})),t}},655:function(t,e,n){"use strict";var r=n(867),o=n(16),s=n(481),i={"Content-Type":"application/x-www-form-urlencoded"};function a(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=n(448)),c),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(a(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)||e&&"application/json"===e["Content-Type"]?(a(e,"application/json"),function(t,e,n){if(r.isString(t))try{return(0,JSON.parse)(t),r.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||u.transitional,n=e&&e.silentJSONParsing,o=e&&e.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||o&&r.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw s(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){u.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){u.headers[t]=r.merge(i)})),t.exports=u},288:function(t){t.exports={version:"0.25.0"}},849:function(t){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},327:function(t,e,n){"use strict";var r=n(867);function o(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var s;if(n)s=n(e);else if(r.isURLSearchParams(e))s=e.toString();else{var i=[];r.forEach(e,(function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),i.push(o(e)+"="+o(t))})))})),s=i.join("&")}if(s){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}},303:function(t){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},372:function(t,e,n){"use strict";var r=n(867);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,s,i){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},793:function(t){"use strict";t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},268:function(t,e,n){"use strict";var r=n(867);t.exports=function(t){return r.isObject(t)&&!0===t.isAxiosError}},985:function(t,e,n){"use strict";var r=n(867);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},16:function(t,e,n){"use strict";var r=n(867);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},109:function(t,e,n){"use strict";var r=n(867),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,s,i={};return t?(r.forEach(t.split("\n"),(function(t){if(s=t.indexOf(":"),e=r.trim(t.substr(0,s)).toLowerCase(),n=r.trim(t.substr(s+1)),e){if(i[e]&&o.indexOf(e)>=0)return;i[e]="set-cookie"===e?(i[e]?i[e]:[]).concat([n]):i[e]?i[e]+", "+n:n}})),i):i}},713:function(t){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},875:function(t,e,n){"use strict";var r=n(288).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){o[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var s={};o.transitional=function(t,e,n){function o(t,e){return"[Axios v"+r+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,r,i){if(!1===t)throw new Error(o(r," has been removed"+(e?" in "+e:"")));return e&&!s[r]&&(s[r]=!0,console.warn(o(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,r,i)}},t.exports={assertOptions:function(t,e,n){if("object"!=typeof t)throw new TypeError("options must be an object");for(var r=Object.keys(t),o=r.length;o-- >0;){var s=r[o],i=e[s];if(i){var a=t[s],c=void 0===a||i(a,s,t);if(!0!==c)throw new TypeError("option "+s+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+s)}},validators:o}},867:function(t,e,n){"use strict";var r=n(849),o=Object.prototype.toString;function s(t){return Array.isArray(t)}function i(t){return void 0===t}function a(t){return"[object ArrayBuffer]"===o.call(t)}function c(t){return null!==t&&"object"==typeof t}function u(t){if("[object Object]"!==o.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function l(t){return"[object Function]"===o.call(t)}function p(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:s,isArrayBuffer:a,isBuffer:function(t){return null!==t&&!i(t)&&null!==t.constructor&&!i(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"[object FormData]"===o.call(t)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&a(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:c,isPlainObject:u,isUndefined:i,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:l,isStream:function(t){return c(t)&&l(t.pipe)},isURLSearchParams:function(t){return"[object URLSearchParams]"===o.call(t)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:p,merge:function t(){var e={};function n(n,r){u(e[r])&&u(n)?e[r]=t(e[r],n):u(n)?e[r]=t({},n):s(n)?e[r]=n.slice():e[r]=n}for(var r=0,o=arguments.length;r<o;r++)p(arguments[r],n);return e},extend:function(t,e,n){return p(e,(function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t=window.wp.element,e=n(669),r=n.n(e);const{__:__}=wp.i18n,{registerBlockType:o}=wp.blocks,{InspectorControls:s}=wp.editor,{SelectControl:i}=wp.components,{PanelBody:a,PanelRow:c}=wp.components,{RichText:u}=wp.editor,{Component:l}=wp.element,p=wp.element.createElement,f=p("svg",{width:20,height:20,viewBox:"0 0 133.62 133.62"},p("path",{d:"M113.63,19.34C100.37,6.51,84.41,0,66.2,0A64.08,64.08,0,0,0,19.36,19.36,64.08,64.08,0,0,0,0,66.2c0,18.25,6.51,34.21,19.34,47.43s28.61,20,46.86,20,34.2-6.72,47.45-20,20-29.21,20-47.45S126.89,32.21,113.63,19.34Zm-2.85,91.44c-12.47,12.46-27.47,18.77-44.58,18.77s-31.89-6.31-43.94-18.75A62.11,62.11,0,0,1,4.07,66.2a60.14,60.14,0,0,1,18.17-44,60.1,60.1,0,0,1,44-18.17c17.12,0,32.12,6.12,44.6,18.19s18.75,26.86,18.75,43.94S123.23,98.32,110.78,110.78Z"}),p("path",{d:"M99.49,30.71a6.6,6.6,0,0,0-9.31,0L40.89,80,35.3,74.41a6.58,6.58,0,0,0-9.31,0l-2.12,2.12a6.6,6.6,0,0,0,0,9.31l9.64,9.64a6.67,6.67,0,0,0,.56.65l2.12,2.12L41,102.8l4-4a8.39,8.39,0,0,0,.65-.56l2.12-2.12a8.39,8.39,0,0,0,.56-.65l53.34-53.34a6.6,6.6,0,0,0,0-9.31Z"}),p("path",{d:"M94.91,86.63H65.15L48.86,102.8H94.91a6.6,6.6,0,0,0,6.58-6.58v-3A6.61,6.61,0,0,0,94.91,86.63Z"}),p("path",{d:"M47.09,45H68.71L85,28.79H47.09a6.6,6.6,0,0,0-6.58,6.58v3A6.6,6.6,0,0,0,47.09,45Z"}));o("complianz/document",{title:__("Legal document - Complianz","complianz-gdpr"),icon:f,category:"widgets",example:{attributes:{preview:!0}},keywords:[__("Privacy Statement","complianz-gdpr"),__("Cookie Policy","complianz-gdpr"),__("Disclaimer","complianz-gdpr")],attributes:{documentSyncStatus:{type:"string",default:"sync"},customDocument:{type:"string",default:""},hasDocuments:{type:"string",default:"false"},content:{type:"string",source:"children",selector:"p"},selectedDocument:{type:"string",default:""},documents:{type:"array"},document:{type:"array"},preview:{type:"boolean",default:!1}},edit:class extends l{static getInitialState(t){return{documents:[],selectedDocument:t.selectedDocument,customDocument:t.customDocument,documentSyncStatus:t.documentSyncStatus,document:{},hasDocuments:!0,preview:!1}}constructor(){super(...arguments),this.state=this.constructor.getInitialState(this.props.attributes)}componentWillMount(){this.getDocuments(),this.getDocuments=this.getDocuments.bind(this),this.onChangeSelectDocument=this.onChangeSelectDocument.bind(this),this.onChangeSelectDocumentSyncStatus=this.onChangeSelectDocumentSyncStatus.bind(this),this.onChangeCustomDocument=this.onChangeCustomDocument.bind(this)}getDocuments(){return r().get(complianz.site_url+"complianz/v1/documents").then((t=>{let e=t.data;if(e&&0!==this.state.selectedDocument){const t=e.find((t=>t.id==this.state.selectedDocument));0===e.length&&(this.setState({hasDocuments:!1}),this.props.setAttributes({hasDocuments:!1})),this.setState({document:t,documents:e})}else this.setState({documents:e})}))}onChangeSelectDocument(t){const e=this.state.documents.find((e=>e.id===t));this.setState({selectedDocument:t,document:e}),this.props.setAttributes({selectedDocument:t})}onChangeCustomDocument(t){this.setState({customDocument:t}),this.props.setAttributes({customDocument:t})}onChangeSelectDocumentSyncStatus(t){if(this.setState({documentSyncStatus:t}),this.props.setAttributes({documentSyncStatus:t}),"sync"===t){let t=this.state.document.content;this.setState({customDocument:t}),this.props.setAttributes({customDocument:t})}}render(){const{className:e,attributes:{}={}}=this.props;let n=[{value:0,label:__("Select a document","complianz-gdpr")}],r=__("Loading...","complianz-gdpr"),o="document-title",l="sync",p=[{value:"sync",label:__("Synchronize document with Complianz","complianz-gdpr")},{value:"unlink",label:__("Edit document and stop synchronization","complianz-gdpr")}];if(this.props.attributes.hasDocuments||(r=__("No documents found. Please finish the Complianz Privacy Suite wizard to generate documents","complianz-gdpr"),o="no-documents"),this.props.attributes.preview)return(0,t.createElement)("img",{src:complianz.cmplz_preview});this.state.documents.length>0&&(r=this.props.isSelected?__("Select a document type from the dropdownlist","complianz-gdpr"):__("Click this block to show the options","complianz-gdpr"),this.state.documents.forEach((t=>{n.push({value:t.id,label:t.title})}))),0!==this.props.attributes.selectedDocument&&this.state.document&&this.state.document.hasOwnProperty("title")&&(r=this.state.document.content,o=this.props.attributes.selectedDocument,l=this.props.attributes.documentSyncStatus);let f=r;return this.props.attributes.customDocument.length>0&&(f=this.props.attributes.customDocument),"sync"===l?[!!this.props.isSelected&&(0,t.createElement)(s,{key:"inspector"},(0,t.createElement)(a,{title:__("Document settings","complianz-gdpr"),initialOpen:!0},(0,t.createElement)(c,null,(0,t.createElement)(i,{onChange:this.onChangeSelectDocument,value:this.props.attributes.selectedDocument,label:__("Select a document","complianz-gdpr"),options:n})),(0,t.createElement)(c,null,(0,t.createElement)(i,{onChange:this.onChangeSelectDocumentSyncStatus,value:this.props.attributes.documentSyncStatus,label:__("Document sync status","complianz-gdpr"),options:p})))),(0,t.createElement)("div",{key:o,className:e,dangerouslySetInnerHTML:{__html:r}})]:[!!this.props.isSelected&&(0,t.createElement)(s,{key:"inspector"},(0,t.createElement)(a,{title:__("Document settings","complianz-gdpr"),initialOpen:!0},(0,t.createElement)(c,null,(0,t.createElement)(i,{onChange:this.onChangeSelectDocument,value:this.props.attributes.selectedDocument,label:__("Select a document","complianz-gdpr"),options:n})),(0,t.createElement)(c,null,(0,t.createElement)(i,{onChange:this.onChangeSelectDocumentSyncStatus,value:this.props.attributes.documentSyncStatus,label:__("Document sync status","complianz-gdpr"),options:p})))),(0,t.createElement)(u,{className:e,value:f,autoFocus:!0,onChange:this.onChangeCustomDocument})]}},save:function(){return null}})}()}();