| @@ -1,6 +1,6 @@ | ||
| 1 | -(()=>{var e,t,a,n,s={36168(e,t,a){"use strict";a.d(t,{$B:()=>i,Ds:()=>H,IT:()=>A,IV:()=>v,Ie:()=>f,In:()=>P,MF:()=>l,MK:()=>_,Uz:()=>y,W0:()=>k,Y3:()=>m,_P:()=>w,cK:()=>j,hq:()=>d,kg:()=>M,nC:()=>E,yT:()=>L,yh:()=>g,z9:()=>O,zX:()=>u}),a(99418);var n=a(97099),s=a(38443),r=a(27723),o=a(57536);a(66087);const{ajax_url:i,namespace:l,plugin_root_path:c,plugin_root_url:d,is_pro:u,route_path:m,menu:_,nonce:h,addons:p,ablocks_nonce:f,rest_url:b,toplevel_menu_icon_url:g,third_party_plugin_status:y,settings:k,site_url:v,blocks_status:x,theme_builder:w,cookie_consent:M,admin_url:L,is_fse_theme:j,post_types:S,breakpoints:Y,responsive_devices:D,breakpoint_mode:T,permissions:C,is_admin_user:N}=window.ABlocksGlobal??{},E=o.A.create({baseURL:b,headers:{"content-type":"application/json","X-WP-Nonce":h,"Cache-Control":"no-cache"}}),O=e=>e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""),A=((0,s.dateI18n)("M j, Y",new Date),(0,s.dateI18n)("F j, Y",new Date),(0,s.dateI18n)("m/d/Y",new Date),(0, | |
| 2 | -s.dateI18n)("m-d-Y",new Date),(0,s.dateI18n)("m.d.Y",new Date),(0,s.dateI18n)("d M Y",new Date),(0,s.dateI18n)("d F Y",new Date),(0,s.dateI18n)("d-m-Y",new Date),(0,s.dateI18n)("d.m.Y",new Date),(0,s.dateI18n)("d/m/Y",new Date),(0,s.dateI18n)("Y-m-d",new Date),(0,s.dateI18n)("Y.m.d",new Date),(0,s.dateI18n)("Y/m/d",new Date),(0,s.dateI18n)("M, Y",new Date),(0,s.dateI18n)("M Y",new Date),(0,s.dateI18n)("F, Y",new Date),(0,s.dateI18n)("F Y",new Date),(0,r.__)("Normal Text","ablocks"),()=>new URLSearchParams((0,n.zy)().search)),P=async(e={},t=!1)=>{let a=new FormData;return a.append("security",f),Object.entries(e).forEach(([e,n])=>{t||"object"!=typeof n||null===n?a.append(e,n):a.append(e,JSON.stringify(n))}),await o.A.post(i,a).then(e=>e,e=>e.response)},H=(e,t)=>{let a=null,n=5e3;const s=e=>{e&&e.preventDefault(),i.remove(),a=null},o=()=>{n-=1e3,n<=0&&(clearInterval(a),s())},i=document.createElement("div") | |
| 1 | +(()=>{var e,t,a,n,s={36168(e,t,a){"use strict";a.d(t,{$B:()=>i,Ds:()=>H,IT:()=>A,IV:()=>v,Ie:()=>f,In:()=>P,MF:()=>l,MK:()=>_,Uz:()=>y,W0:()=>k,Y3:()=>m,_P:()=>w,cK:()=>j,hq:()=>d,kg:()=>M,nC:()=>E,yT:()=>L,yh:()=>g,z9:()=>O,zX:()=>u}),a(99418);var n=a(97099),s=a(38443),r=a(27723),o=(a(47143),a(57536));a(66087);const{ajax_url:i,namespace:l,plugin_root_path:c,plugin_root_url:d,is_pro:u,route_path:m,menu:_,nonce:h,addons:p,ablocks_nonce:f,rest_url:b,toplevel_menu_icon_url:g,third_party_plugin_status:y,settings:k,site_url:v,blocks_status:x,theme_builder:w,cookie_consent:M,admin_url:L,is_fse_theme:j,post_types:S,breakpoints:Y,responsive_devices:D,breakpoint_mode:T,permissions:C,is_admin_user:N}=window.ABlocksGlobal??{},E=o.A.create({baseURL:b,headers:{"content-type":"application/json","X-WP-Nonce":h,"Cache-Control":"no-cache"}}),O=e=>e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""),A=((0,s.dateI18n)("M j, Y",new Date),(0,s.dateI18n)("F j, Y",new Date),(0, | |
| 2 | +s.dateI18n)("m/d/Y",new Date),(0,s.dateI18n)("m-d-Y",new Date),(0,s.dateI18n)("m.d.Y",new Date),(0,s.dateI18n)("d M Y",new Date),(0,s.dateI18n)("d F Y",new Date),(0,s.dateI18n)("d-m-Y",new Date),(0,s.dateI18n)("d.m.Y",new Date),(0,s.dateI18n)("d/m/Y",new Date),(0,s.dateI18n)("Y-m-d",new Date),(0,s.dateI18n)("Y.m.d",new Date),(0,s.dateI18n)("Y/m/d",new Date),(0,s.dateI18n)("M, Y",new Date),(0,s.dateI18n)("M Y",new Date),(0,s.dateI18n)("F, Y",new Date),(0,s.dateI18n)("F Y",new Date),(0,r.__)("Normal Text","ablocks"),()=>new URLSearchParams((0,n.zy)().search)),P=async(e={},t=!1)=>{let a=new FormData;return a.append("security",f),Object.entries(e).forEach(([e,n])=>{t||"object"!=typeof n||null===n?a.append(e,n):a.append(e,JSON.stringify(n))}),await o.A.post(i,a).then(e=>e,e=>e.response)},H=(e,t)=>{let a=null,n=5e3;const s=e=>{e&&e.preventDefault(),i.remove(),a=null},o=()=>{n-=1e3,n<=0&&(clearInterval(a),s())},i=document.createElement("div") | |
| 3 | 3 | ;i.className="ablocks-notification ablocks-notification--dashbaord "+(e?`ablocks-notification--${e}`:"ablocks-notification--success"),i.setAttribute("aria-live","polite"),i.onmouseenter=()=>clearInterval(a),i.onmouseleave=()=>a=setInterval(o,1e3);const l=document.createElement("p");l.className="ablocks-notification__message",l.appendChild(document.createTextNode(t)),i.appendChild(l);const c=document.createElement("button");c.className="ablocks-btn ablocks-btn--bg-transparent",c.setAttribute("data-suffix","close-notification"),c.setAttribute("aria-label",(0,r.__)("Close","ablocks")),c.innerHTML='<span class="ablocks-icon ablocks-icon--close" aria-hidden="true"></span>',c.onclick=s,i.appendChild(c),a=setInterval(o,1e3),document.body.appendChild(i)}},50411(e,t,a){var n;!function(){"use strict";var s=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:s,canUseWorkers:"undefined"!=typeof Worker, |
| 4 | 4 | canUseEventListeners:s&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:s&&!!window.screen};void 0===(n=function(){return r}.call(t,a,t,e))||(e.exports=n)}()},4146(e,t,a){"use strict";var n=a(73404),s={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function l(e){return n.isMemo(e)?o:i[e.$$typeof]||s}i[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[n.Memo]=o;var c=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,m=Object.getOwnPropertyDescriptor,_=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,a,n){if("string"!=typeof a){if(h){var s=_(a);s&&s!==h&&e(t,s,n)}var o=d(a) |
| 5 | 5 | ;u&&(o=o.concat(u(a)));for(var i=l(t),p=l(a),f=0;f<o.length;++f){var b=o[f];if(!(r[b]||n&&n[b]||p&&p[b]||i&&i[b])){var g=m(a,b);try{c(t,b,g)}catch(e){}}}}return t}},3072(e,t){"use strict";var a="function"==typeof Symbol&&Symbol.for,n=a?Symbol.for("react.element"):60103,s=a?Symbol.for("react.portal"):60106,r=a?Symbol.for("react.fragment"):60107,o=a?Symbol.for("react.strict_mode"):60108,i=a?Symbol.for("react.profiler"):60114,l=a?Symbol.for("react.provider"):60109,c=a?Symbol.for("react.context"):60110,d=a?Symbol.for("react.async_mode"):60111,u=a?Symbol.for("react.concurrent_mode"):60111,m=a?Symbol.for("react.forward_ref"):60112,_=a?Symbol.for("react.suspense"):60113,h=a?Symbol.for("react.suspense_list"):60120,p=a?Symbol.for("react.memo"):60115,f=a?Symbol.for("react.lazy"):60116,b=a?Symbol.for("react.block"):60121,g=a?Symbol.for("react.fundamental"):60117,y=a?Symbol.for("react.responder"):60118,k=a?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){ |
| 6 | 6 | var t=e.$$typeof;switch(t){case n:switch(e=e.type){case d:case u:case r:case i:case o:case _:return e;default:switch(e=e&&e.$$typeof){case c:case m:case f:case p:case l:return e;default:return t}}case s:return t}}}function x(e){return v(e)===u}t.AsyncMode=d,t.ConcurrentMode=u,t.ContextConsumer=c,t.ContextProvider=l,t.Element=n,t.ForwardRef=m,t.Fragment=r,t.Lazy=f,t.Memo=p,t.Portal=s,t.Profiler=i,t.StrictMode=o,t.Suspense=_,t.isAsyncMode=function(e){return x(e)||v(e)===d},t.isConcurrentMode=x,t.isContextConsumer=function(e){return v(e)===c},t.isContextProvider=function(e){return v(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return v(e)===m},t.isFragment=function(e){return v(e)===r},t.isLazy=function(e){return v(e)===f},t.isMemo=function(e){return v(e)===p},t.isPortal=function(e){return v(e)===s},t.isProfiler=function(e){return v(e)===i},t.isStrictMode=function(e){return v(e)===o},t.isSuspense=function(e){return v(e)===_ |
| @@ -334,53 +334,54 @@ | ||
| 334 | 334 | if("function"==typeof r&&!r(a,c))return e(c);var d={};l.push(d),d.started=w.now(),d.startedTime=new Date,d.prevState=n(a()),d.action=c;var u=void 0;if(o)try{u=e(c)}catch(e){d.error=s(e)}else u=e(c);d.took=w.now()-d.started,d.nextState=n(a());var m=t.diff&&"function"==typeof i?i(a,c):t.diff;if(b(l,Object.assign({},t,{diff:m})),l.length=0,d.error)throw d.error;return u}}}}var y,k,v=function(e,t){return function(e,t){return new Array(t+1).join(e)}("0",t-e.toString().length)+e},x=function(e){return v(e.getHours(),2)+":"+v(e.getMinutes(),2)+":"+v(e.getSeconds(),2)+"."+v(e.getMilliseconds(),3)},w="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date,M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L=function(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);t<e.length;t++)a[t]=e[t] |
| 335 | 335 | ;return a}return Array.from(e)},j=[];y="object"===("undefined"==typeof globalThis?"undefined":M(globalThis))&&globalThis?globalThis:"undefined"!=typeof window?window:{},(k=y.DeepDiff)&&j.push(function(){void 0!==k&&y.DeepDiff===d&&(y.DeepDiff=k,k=void 0)}),t(n,a),t(s,a),t(r,a),t(o,a),Object.defineProperties(d,{diff:{value:d,enumerable:!0},observableDiff:{value:c,enumerable:!0},applyDiff:{value:function(e,t,a){e&&t&&c(e,t,function(n){a&&!a(e,t,n)||m(e,t,n)})},enumerable:!0},applyChange:{value:m,enumerable:!0},revertChange:{value:function(e,t,a){if(e&&t&&a&&a.kind){var n,s,r=e;for(s=a.path.length-1,n=0;n<s;n++)void 0===r[a.path[n]]&&(r[a.path[n]]={}),r=r[a.path[n]];switch(a.kind){case"A":_(r[a.path[n]],a.index,a.item);break;case"D":case"E":r[a.path[n]]=a.lhs;break;case"N":delete r[a.path[n]]}}},enumerable:!0},isConflict:{value:function(){return void 0!==k},enumerable:!0},noConflict:{value:function(){return j&&(j.forEach(function(e){e()}),j=null),d},enumerable:!0}});var S={E:{ |
| 336 | 336 | color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},Y={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(e){return e},actionTransformer:function(e){return e},errorTransformer:function(e){return e},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dispatch,a=e.getState;return"function"==typeof t||"function"==typeof a?g()({dispatch:t,getState:a |
| 337 | 337 | }):void console.error("\n[redux-logger v3] BREAKING CHANGE\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\n[redux-logger v3] Change\n[redux-logger v3] import createLogger from 'redux-logger'\n[redux-logger v3] to\n[redux-logger v3] import { createLogger } from 'redux-logger'\n")};e.defaults=Y,e.createLogger=g,e.logger=D,e.default=D,Object.defineProperty(e,"__esModule",{value:!0})}(t)},85160(e,t,a){"use strict";var n=a(51609),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useSyncExternalStore,o=n.useRef,i=n.useEffect,l=n.useMemo,c=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,a,n,d){var u=o(null);if(null===u.current){var m={hasValue:!1,value:null};u.current=m}else m=u.current;u=l(function(){function e(e){if(!i){if(i=!0,r=e,e=n(e),void 0!==d&&m.hasValue){var t=m.value;if(d(t,e))return o=t}return o=e}if(t=o,s(r,e))return t;var a=n(e);return void 0!==d&&d(t,a)?(r=e, |
| 338 | -t):(r=e,o=a)}var r,o,i=!1,l=void 0===a?null:a;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,a,n,d]);var _=r(e,u[0],u[1]);return i(function(){m.hasValue=!0,m.value=_},[_]),c(_),_}},78418(e,t,a){"use strict";e.exports=a(85160)},9771(e){"use strict";e.exports=function(){}},51609(e){"use strict";e.exports=window.React},75795(e){"use strict";e.exports=window.ReactDOM},66087(e){"use strict";e.exports=window.lodash},38443(e){"use strict";e.exports=window.wp.date},27723(e){"use strict";e.exports=window.wp.i18n},46942(e,t){var a;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=o(e,r(a)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="" | |
| 339 | -;for(var a in e)n.call(e,a)&&e[a]&&(t=o(t,a));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0===(a=function(){return s}.apply(t,[]))||(e.exports=a)}()},36263(e,t,a){"use strict";a.d(t,{A:()=>u});var n=a(17275),s=a(73119),r=a(17013),o=a(77960),i=a(74062);const l={http:s.A,xhr:r.A,fetch:{get:o.J}};n.A.forEach(l,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const c=e=>`- ${e}`,d=e=>n.A.isFunction(e)||null===e||!1===e,u={getAdapter:function(e,t){e=n.A.isArray(e)?e:[e];const{length:a}=e;let s,r;const o={};for(let c=0;c<a;c++){let a;if(s=e[c],r=s,!d(s)&&(r=l[(a=String(s)).toLowerCase()],void 0===r))throw new i.A(`Unknown adapter '${a}'`);if(r&&(n.A.isFunction(r)||(r=r.get(t))))break;o[a||"#"+c]=r}if(!r){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")) | |
| 340 | -;let t=a?e.length>1?"since :\n"+e.map(c).join("\n"):" "+c(e[0]):"as no adapter specified";throw new i.A("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return r},adapters:l}},77960(e,t,a){"use strict";a.d(t,{J:()=>y});var n=a(63820),s=a(17275),r=a(74062),o=a(12723),i=a(1791),l=a(7110),c=a(77837),d=a(88382),u=a(63853);const{isFunction:m}=s.A,_=(({Request:e,Response:t})=>({Request:e,Response:t}))(s.A.global),{ReadableStream:h,TextEncoder:p}=s.A.global,f=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},b=e=>{e=s.A.merge.call({skipUndefined:!0},_,e);const{fetch:t,Request:a,Response:b}=e,g=t?m(t):"function"==typeof fetch,y=m(a),k=m(b);if(!g)return!1;const v=g&&m(h),x=g&&("function"==typeof p?(w=new p,e=>w.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer()));var w;const M=y&&v&&f(()=>{let e=!1;const t=new h,s=new a(n.A.origin,{body:t,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return t.cancel(),e&&!s | |
| 341 | -}),L=k&&v&&f(()=>s.A.isReadableStream(new b("").body)),j={stream:L&&(e=>e.body)};g&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!j[e]&&(j[e]=(t,a)=>{let n=t&&t[e];if(n)return n.call(t);throw new r.A(`Response type '${e}' is not supported`,r.A.ERR_NOT_SUPPORT,a)})});return async e=>{let{url:m,method:_,data:h,signal:p,cancelToken:f,timeout:g,onDownloadProgress:k,onUploadProgress:v,responseType:w,headers:S,withCredentials:Y="same-origin",fetchOptions:D}=(0,d.A)(e),T=t||fetch;w=w?(w+"").toLowerCase():"text";let C=(0,o.A)([p,f&&f.toAbortSignal()],g),N=null;const E=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let O;try{if(v&&M&&"get"!==_&&"head"!==_&&0!==(O=await(async(e,t)=>{const r=s.A.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(s.A.isBlob(e))return e.size;if(s.A.isSpecCompliantForm(e)){const t=new a(n.A.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength} | |
| 342 | -return s.A.isArrayBufferView(e)||s.A.isArrayBuffer(e)?e.byteLength:(s.A.isURLSearchParams(e)&&(e+=""),s.A.isString(e)?(await x(e)).byteLength:void 0)})(t):r})(S,h))){let e,t=new a(m,{method:"POST",body:h,duplex:"half"});if(s.A.isFormData(h)&&(e=t.headers.get("content-type"))&&S.setContentType(e),t.body){const[e,a]=(0,c.Vj)(O,(0,c.C1)((0,c.mM)(v)));h=(0,i.E9)(t.body,65536,e,a)}}s.A.isString(Y)||(Y=Y?"include":"omit");const t=y&&"credentials"in a.prototype,r={...D,signal:C,method:_.toUpperCase(),headers:S.normalize().toJSON(),body:h,duplex:"half",credentials:t?Y:void 0};N=y&&new a(m,r);let o=await(y?T(N,D):T(m,r));const d=L&&("stream"===w||"response"===w);if(L&&(k||d&&E)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=o[t]});const t=s.A.toFiniteNumber(o.headers.get("content-length")),[a,n]=k&&(0,c.Vj)(t,(0,c.C1)((0,c.mM)(k),!0))||[];o=new b((0,i.E9)(o.body,65536,a,()=>{n&&n(),E&&E()}),e)}w=w||"text";let p=await j[s.A.findKey(j,w)||"text"](o,e);return!d&&E&&E(), | |
| 343 | -await new Promise((t,a)=>{(0,u.A)(t,a,{data:p,headers:l.A.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:N})})}catch(t){if(E&&E(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new r.A("Network Error",r.A.ERR_NETWORK,e,N,t&&t.response),{cause:t.cause||t});throw r.A.from(t,t&&t.code,e,N,t&&t.response)}}},g=new Map,y=e=>{let t=e&&e.env||{};const{fetch:a,Request:n,Response:s}=t,r=[n,s,a];let o,i,l=r.length,c=g;for(;l--;)o=r[l],i=c.get(o),void 0===i&&c.set(o,i=l?new Map:b(t)),c=i;return i};y()},17013(e,t,a){"use strict";a.d(t,{A:()=>_});var n=a(17275),s=a(63853),r=a(10807),o=a(74062),i=a(38458),l=a(55579),c=a(63820),d=a(7110),u=a(77837),m=a(88382);const _="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,a){const _=(0,m.A)(e);let h=_.data;const p=d.A.from(_.headers).normalize();let f,b,g,y,k,{responseType:v,onUploadProgress:x,onDownloadProgress:w}=_;function M(){y&&y(),k&&k(), | |
| 344 | -_.cancelToken&&_.cancelToken.unsubscribe(f),_.signal&&_.signal.removeEventListener("abort",f)}let L=new XMLHttpRequest;function j(){if(!L)return;const n=d.A.from("getAllResponseHeaders"in L&&L.getAllResponseHeaders()),r={data:v&&"text"!==v&&"json"!==v?L.response:L.responseText,status:L.status,statusText:L.statusText,headers:n,config:e,request:L};(0,s.A)(function(e){t(e),M()},function(e){a(e),M()},r),L=null}L.open(_.method.toUpperCase(),_.url,!0),L.timeout=_.timeout,"onloadend"in L?L.onloadend=j:L.onreadystatechange=function(){L&&4===L.readyState&&(0!==L.status||L.responseURL&&0===L.responseURL.indexOf("file:"))&&setTimeout(j)},L.onabort=function(){L&&(a(new o.A("Request aborted",o.A.ECONNABORTED,e,L)),L=null)},L.onerror=function(t){const n=t&&t.message?t.message:"Network Error",s=new o.A(n,o.A.ERR_NETWORK,e,L);s.event=t||null,a(s),L=null},L.ontimeout=function(){let t=_.timeout?"timeout of "+_.timeout+"ms exceeded":"timeout exceeded";const n=_.transitional||r.A | |
| 345 | -;_.timeoutErrorMessage&&(t=_.timeoutErrorMessage),a(new o.A(t,n.clarifyTimeoutError?o.A.ETIMEDOUT:o.A.ECONNABORTED,e,L)),L=null},void 0===h&&p.setContentType(null),"setRequestHeader"in L&&n.A.forEach(p.toJSON(),function(e,t){L.setRequestHeader(t,e)}),n.A.isUndefined(_.withCredentials)||(L.withCredentials=!!_.withCredentials),v&&"json"!==v&&(L.responseType=_.responseType),w&&([g,k]=(0,u.C1)(w,!0),L.addEventListener("progress",g)),x&&L.upload&&([b,y]=(0,u.C1)(x),L.upload.addEventListener("progress",b),L.upload.addEventListener("loadend",y)),(_.cancelToken||_.signal)&&(f=t=>{L&&(a(!t||t.type?new i.A(null,e,L):t),L.abort(),L=null)},_.cancelToken&&_.cancelToken.subscribe(f),_.signal&&(_.signal.aborted?f():_.signal.addEventListener("abort",f)));const S=(0,l.A)(_.url);S&&-1===c.A.protocols.indexOf(S)?a(new o.A("Unsupported protocol "+S+":",o.A.ERR_BAD_REQUEST,e)):L.send(h||null)})}},57536(e,t,a){"use strict";a.d(t,{A:()=>v}) | |
| 346 | -;var n=a(17275),s=a(12125),r=a(55978),o=a(44662),i=a(6013),l=a(77887),c=a(38458),d=a(64874),u=a(59575),m=a(89888),_=a(70665),h=a(74062),p=a(20605),f=a(68562),b=a(7110),g=a(36263),y=a(7693);const k=function e(t){const a=new r.A(t),i=(0,s.A)(r.A.prototype.request,a);return n.A.extend(i,r.A.prototype,a,{allOwnKeys:!0}),n.A.extend(i,a,null,{allOwnKeys:!0}),i.create=function(a){return e((0,o.A)(t,a))},i}(i.A);k.Axios=r.A,k.CanceledError=c.A,k.CancelToken=d.A,k.isCancel=u.A,k.VERSION=m.x,k.toFormData=_.A,k.AxiosError=h.A,k.Cancel=k.CanceledError,k.all=function(e){return Promise.all(e)},k.spread=p.A,k.isAxiosError=f.A,k.mergeConfig=o.A,k.AxiosHeaders=b.A,k.formToJSON=e=>(0,l.A)(n.A.isHTMLForm(e)?new FormData(e):e),k.getAdapter=g.A.getAdapter,k.HttpStatusCode=y.A,k.default=k;const v=k},64874(e,t,a){"use strict";a.d(t,{A:()=>r});var n=a(38458);class s{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e}) | |
| 347 | -;const a=this;this.promise.then(e=>{if(!a._listeners)return;let t=a._listeners.length;for(;t-- >0;)a._listeners[t](e);a._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{a.subscribe(e),t=e}).then(e);return n.cancel=function(){a.unsubscribe(t)},n},e(function(e,s,r){a.reason||(a.reason=new n.A(e,s,r),t(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new s(function(t){e=t}),cancel:e}}}const r=s},38458(e,t,a){"use strict";a.d(t,{A:()=>r});var n=a(74062);class s extends n.A{constructor(e,t,a){super(null==e?"canceled":e,n.A.ERR_CANCELED,t,a),this.name="CanceledError", | |
| 348 | -this.__CANCEL__=!0}}const r=s},59575(e,t,a){"use strict";function n(e){return!(!e||!e.__CANCEL__)}a.d(t,{A:()=>n})},55978(e,t,a){"use strict";a.d(t,{A:()=>h});var n=a(17275),s=a(93967),r=a(17352),o=a(48683),i=a(44662),l=a(88262),c=a(13390),d=a(7110),u=a(10807);const m=c.A.validators;class _{constructor(e){this.defaults=e||{},this.interceptors={request:new r.A,response:new r.A}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const a=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?a&&!String(e.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+a):e.stack=a}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=(0,i.A)(this.defaults,t);const{transitional:a,paramsSerializer:s,headers:r}=t;void 0!==a&&c.A.assertOptions(a,{silentJSONParsing:m.transitional(m.boolean),forcedJSONParsing:m.transitional(m.boolean), | |
| 349 | -clarifyTimeoutError:m.transitional(m.boolean),legacyInterceptorReqResOrdering:m.transitional(m.boolean)},!1),null!=s&&(n.A.isFunction(s)?t.paramsSerializer={serialize:s}:c.A.assertOptions(s,{encode:m.function,serialize:m.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),c.A.assertOptions(t,{baseUrl:m.spelling("baseURL"),withXsrfToken:m.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let l=r&&n.A.merge(r.common,r[t.method]);r&&n.A.forEach(["delete","get","head","post","put","patch","common"],e=>{delete r[e]}),t.headers=d.A.concat(l,r);const _=[];let h=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;h=h&&e.synchronous;const a=t.transitional||u.A;a&&a.legacyInterceptorReqResOrdering?_.unshift(e.fulfilled,e.rejected):_.push(e.fulfilled,e.rejected)});const p=[];let f | |
| 350 | -;this.interceptors.response.forEach(function(e){p.push(e.fulfilled,e.rejected)});let b,g=0;if(!h){const e=[o.A.bind(this),void 0];for(e.unshift(..._),e.push(...p),b=e.length,f=Promise.resolve(t);g<b;)f=f.then(e[g++],e[g++]);return f}b=_.length;let y=t;for(;g<b;){const e=_[g++],t=_[g++];try{y=e(y)}catch(e){t.call(this,e);break}}try{f=o.A.call(this,y)}catch(e){return Promise.reject(e)}for(g=0,b=p.length;g<b;)f=f.then(p[g++],p[g++]);return f}getUri(e){e=(0,i.A)(this.defaults,e);const t=(0,l.A)(e.baseURL,e.url,e.allowAbsoluteUrls);return(0,s.A)(t,e.params,e.paramsSerializer)}}n.A.forEach(["delete","get","head","options"],function(e){_.prototype[e]=function(t,a){return this.request((0,i.A)(a||{},{method:e,url:t,data:(a||{}).data}))}}),n.A.forEach(["post","put","patch"],function(e){function t(t){return function(a,n,s){return this.request((0,i.A)(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:a,data:n}))}}_.prototype[e]=t(),_.prototype[e+"Form"]=t(!0)});const h=_}, | |
| 351 | -74062(e,t,a){"use strict";a.d(t,{A:()=>r});var n=a(17275);class s extends Error{static from(e,t,a,n,r,o){const i=new s(e.message,t||e.code,a,n,r);return i.cause=e,i.name=e.name,null!=e.status&&null==i.status&&(i.status=e.status),o&&Object.assign(i,o),i}constructor(e,t,a,n,s){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),a&&(this.config=a),n&&(this.request=n),s&&(this.response=s,this.status=s.status)}toJSON(){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:n.A.toJSONObject(this.config),code:this.code,status:this.status}}}s.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",s.ERR_BAD_OPTION="ERR_BAD_OPTION",s.ECONNABORTED="ECONNABORTED",s.ETIMEDOUT="ETIMEDOUT",s.ERR_NETWORK="ERR_NETWORK", | |
| 352 | -s.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",s.ERR_DEPRECATED="ERR_DEPRECATED",s.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",s.ERR_BAD_REQUEST="ERR_BAD_REQUEST",s.ERR_CANCELED="ERR_CANCELED",s.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",s.ERR_INVALID_URL="ERR_INVALID_URL";const r=s},7110(e,t,a){"use strict";a.d(t,{A:()=>d});var n=a(17275),s=a(43325);const r=Symbol("internals");function o(e){return e&&String(e).trim().toLowerCase()}function i(e){return!1===e||null==e?e:n.A.isArray(e)?e.map(i):String(e).replace(/[\r\n]+$/,"")}function l(e,t,a,s,r){return n.A.isFunction(s)?s.call(this,t,a):(r&&(t=a),n.A.isString(t)?n.A.isString(s)?-1!==t.indexOf(s):n.A.isRegExp(s)?s.test(t):void 0:void 0)}class c{constructor(e){e&&this.set(e)}set(e,t,a){const r=this;function l(e,t,a){const s=o(t);if(!s)throw new Error("header name must be a non-empty string");const l=n.A.findKey(r,s);(!l||void 0===r[l]||!0===a||void 0===a&&!1!==r[l])&&(r[l||t]=i(e))}const c=(e,t)=>n.A.forEach(e,(e,a)=>l(e,a,t)) | |
| 353 | -;if(n.A.isPlainObject(e)||e instanceof this.constructor)c(e,t);else if(n.A.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))c((0,s.A)(e),t);else if(n.A.isObject(e)&&n.A.isIterable(e)){let a,s,r={};for(const t of e){if(!n.A.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[s=t[0]]=(a=r[s])?n.A.isArray(a)?[...a,t[1]]:[a,t[1]]:t[1]}c(r,t)}else null!=e&&l(t,e,a);return this}get(e,t){if(e=o(e)){const a=n.A.findKey(this,e);if(a){const e=this[a];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=a.exec(e);)t[n[1]]=n[2];return t}(e);if(n.A.isFunction(t))return t.call(this,e,a);if(n.A.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=o(e)){const a=n.A.findKey(this,e);return!(!a||void 0===this[a]||t&&!l(0,this[a],a,t))}return!1}delete(e,t){const a=this;let s=!1;function r(e){if(e=o(e)){const r=n.A.findKey(a,e) | |
| 354 | -;!r||t&&!l(0,a[r],r,t)||(delete a[r],s=!0)}}return n.A.isArray(e)?e.forEach(r):r(e),s}clear(e){const t=Object.keys(this);let a=t.length,n=!1;for(;a--;){const s=t[a];e&&!l(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,a={};return n.A.forEach(this,(s,r)=>{const o=n.A.findKey(a,r);if(o)return t[o]=i(s),void delete t[r];const l=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,a)=>t.toUpperCase()+a)}(r):String(r).trim();l!==r&&delete t[r],t[l]=i(s),a[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return n.A.forEach(this,(a,s)=>{null!=a&&!1!==a&&(t[s]=e&&n.A.isArray(a)?a.join(", "):a)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){ | |
| 355 | -return e instanceof this?e:new this(e)}static concat(e,...t){const a=new this(e);return t.forEach(e=>a.set(e)),a}static accessor(e){const t=(this[r]=this[r]={accessors:{}}).accessors,a=this.prototype;function s(e){const s=o(e);t[s]||(function(e,t){const a=n.A.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+a,{value:function(e,a,s){return this[n].call(this,t,e,a,s)},configurable:!0})})}(a,e),t[s]=!0)}return n.A.isArray(e)?e.forEach(s):s(e),this}}c.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),n.A.reduceDescriptors(c.prototype,({value:e},t)=>{let a=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[a]=e}}}),n.A.freezeMethods(c);const d=c},17352(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(17275);const s=class{constructor(){this.handlers=[]}use(e,t,a){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!a&&a.synchronous,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(e){ | |
| 356 | -this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){n.A.forEach(this.handlers,function(t){null!==t&&e(t)})}}},88262(e,t,a){"use strict";a.d(t,{A:()=>r});var n=a(99034),s=a(76787);function r(e,t,a){let r=!(0,n.A)(t);return e&&(r||0==a)?(0,s.A)(e,t):t}},48683(e,t,a){"use strict";a.d(t,{A:()=>d});var n=a(19152),s=a(59575),r=a(6013),o=a(38458),i=a(7110),l=a(36263);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new o.A(null,e)}function d(e){return c(e),e.headers=i.A.from(e.headers),e.data=n.A.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),l.A.getAdapter(e.adapter||r.A.adapter,e)(e).then(function(t){return c(e),t.data=n.A.call(e,e.transformResponse,t),t.headers=i.A.from(t.headers),t},function(t){return(0,s.A)(t)||(c(e),t&&t.response&&(t.response.data=n.A.call(e,e.transformResponse,t.response), | |
| 357 | -t.response.headers=i.A.from(t.response.headers))),Promise.reject(t)})}},44662(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(17275),s=a(7110);const r=e=>e instanceof s.A?{...e}:e;function o(e,t){t=t||{};const a={};function s(e,t,a,s){return n.A.isPlainObject(e)&&n.A.isPlainObject(t)?n.A.merge.call({caseless:s},e,t):n.A.isPlainObject(t)?n.A.merge({},t):n.A.isArray(t)?t.slice():t}function o(e,t,a,r){return n.A.isUndefined(t)?n.A.isUndefined(e)?void 0:s(void 0,e,0,r):s(e,t,0,r)}function i(e,t){if(!n.A.isUndefined(t))return s(void 0,t)}function l(e,t){return n.A.isUndefined(t)?n.A.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function c(a,n,r){return r in t?s(a,n):r in e?s(void 0,a):void 0}const d={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l, | |
| 358 | -beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:c,headers:(e,t,a)=>o(r(e),r(t),0,!0)};return n.A.forEach(Object.keys({...e,...t}),function(s){if("__proto__"===s||"constructor"===s||"prototype"===s)return;const r=n.A.hasOwnProp(d,s)?d[s]:o,i=r(e[s],t[s],s);n.A.isUndefined(i)&&r!==c||(a[s]=i)}),a}},63853(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(74062);function s(e,t,a){const s=a.config.validateStatus;a.status&&s&&!s(a.status)?t(new n.A("Request failed with status code "+a.status,[n.A.ERR_BAD_REQUEST,n.A.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a)):e(a)}},19152(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(17275),s=a(6013),r=a(7110);function o(e,t){const a=this||s.A,o=t||a,i=r.A.from(o.headers);let l=o.data;return n.A.forEach(e,function(e){l=e.call(a,l,i.normalize(),t?t.status:void 0)}),i.normalize(),l}},6013(e,t,a){"use strict";a.d(t,{A:()=>u}) | |
| 359 | -;var n=a(17275),s=a(74062),r=a(10807),o=a(70665),i=a(31076),l=a(63820),c=a(77887);const d={transitional:r.A,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const a=t.getContentType()||"",s=a.indexOf("application/json")>-1,r=n.A.isObject(e);if(r&&n.A.isHTMLForm(e)&&(e=new FormData(e)),n.A.isFormData(e))return s?JSON.stringify((0,c.A)(e)):e;if(n.A.isArrayBuffer(e)||n.A.isBuffer(e)||n.A.isStream(e)||n.A.isFile(e)||n.A.isBlob(e)||n.A.isReadableStream(e))return e;if(n.A.isArrayBufferView(e))return e.buffer;if(n.A.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(r){if(a.indexOf("application/x-www-form-urlencoded")>-1)return(0,i.A)(e,this.formSerializer).toString();if((l=n.A.isFileList(e))||a.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return(0,o.A)(l?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||s?(t.setContentType("application/json",!1),function(e){ | |
| 360 | -if(n.A.isString(e))try{return(0,JSON.parse)(e),n.A.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||d.transitional,a=t&&t.forcedJSONParsing,r="json"===this.responseType;if(n.A.isResponse(e)||n.A.isReadableStream(e))return e;if(e&&n.A.isString(e)&&(a&&!this.responseType||r)){const a=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(a){if("SyntaxError"===e.name)throw s.A.from(e,s.A.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:l.A.classes.FormData,Blob:l.A.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};n.A.forEach(["delete","get","head","post","put","patch"],e=>{d.headers[e]={}});const u=d},10807(e,t,a){"use strict";a.d(t,{ | |
| 361 | -A:()=>n});const n={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0}},89888(e,t,a){"use strict";a.d(t,{x:()=>n});const n="1.14.0"},95267(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(70665);function s(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function r(e,t){this._pairs=[],e&&(0,n.A)(e,this,t)}const o=r.prototype;o.append=function(e,t){this._pairs.push([e,t])},o.toString=function(e){const t=e?function(t){return e.call(this,t,s)}:s;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const i=r},7693(e,t,a){"use strict";a.d(t,{A:()=>s});const n={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300, | |
| 362 | -MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522, | |
| 363 | -OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(n).forEach(([e,t])=>{n[t]=e});const s=n},12125(e,t,a){"use strict";function n(e,t){return function(){return e.apply(t,arguments)}}a.d(t,{A:()=>n})},93967(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(17275),s=a(95267);function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function o(e,t,a){if(!t)return e;const o=a&&a.encode||r,i=n.A.isFunction(a)?{serialize:a}:a,l=i&&i.serialize;let c;if(c=l?l(t,i):n.A.isURLSearchParams(t)?t.toString():new s.A(t,i).toString(o),c){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+c}return e}},76787(e,t,a){"use strict";function n(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}a.d(t,{A:()=>n})},12723(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(38458),s=a(74062),r=a(17275);const o=(e,t)=>{const{length:a}=e=e?e.filter(Boolean):[] | |
| 364 | -;if(t||a){let a,o=new AbortController;const i=function(e){if(!a){a=!0,c();const t=e instanceof Error?e:this.reason;o.abort(t instanceof s.A?t:new n.A(t instanceof Error?t.message:t))}};let l=t&&setTimeout(()=>{l=null,i(new s.A(`timeout of ${t}ms exceeded`,s.A.ETIMEDOUT))},t);const c=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:d}=o;return d.unsubscribe=()=>r.A.asap(c),d}}},9887(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(17275);const s=a(63820).A.hasStandardBrowserEnv?{write(e,t,a,s,r,o,i){if("undefined"==typeof document)return;const l=[`${e}=${encodeURIComponent(t)}`];n.A.isNumber(a)&&l.push(`expires=${new Date(a).toUTCString()}`),n.A.isString(s)&&l.push(`path=${s}`),n.A.isString(r)&&l.push(`domain=${r}`),!0===o&&l.push("secure"),n.A.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(e){if("undefined"==typeof document)return null | |
| 365 | -;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}}},77887(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(17275);const s=function(e){function t(e,a,s,r){let o=e[r++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),l=r>=e.length;return o=!o&&n.A.isArray(s)?s.length:o,l?(n.A.hasOwnProp(s,o)?s[o]=[s[o],a]:s[o]=a,!i):(s[o]&&n.A.isObject(s[o])||(s[o]=[]),t(e,a,s[o],r)&&n.A.isArray(s[o])&&(s[o]=function(e){const t={},a=Object.keys(e);let n;const s=a.length;let r;for(n=0;n<s;n++)r=a[n],t[r]=e[r];return t}(s[o])),!i)}if(n.A.isFormData(e)&&n.A.isFunction(e.entries)){const a={};return n.A.forEachEntry(e,(e,s)=>{t(function(e){return n.A.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),s,a,0)}),a}return null}},99034(e,t,a){"use strict";function n(e){return"string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}a.d(t,{A:()=>n})}, | |
| 366 | -68562(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(17275);function s(e){return n.A.isObject(e)&&!0===e.isAxiosError}},86305(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(63820);const s=n.A.hasStandardBrowserEnv?(r=new URL(n.A.origin),o=n.A.navigator&&/(msie|trident)/i.test(n.A.navigator.userAgent),e=>(e=new URL(e,n.A.origin),r.protocol===e.protocol&&r.host===e.host&&(o||r.port===e.port))):()=>!0;var r,o},73119(e,t,a){"use strict";a.d(t,{A:()=>n});const n=null},43325(e,t,a){"use strict";a.d(t,{A:()=>s});const n=a(17275).A.toObjectSet(["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"]),s=e=>{const t={};let a,s,r;return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),a=e.substring(0,r).trim().toLowerCase(),s=e.substring(r+1).trim(), | |
| 367 | -!a||t[a]&&n[a]||("set-cookie"===a?t[a]?t[a].push(s):t[a]=[s]:t[a]=t[a]?t[a]+", "+s:s)}),t}},55579(e,t,a){"use strict";function n(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}a.d(t,{A:()=>n})},77837(e,t,a){"use strict";a.d(t,{C1:()=>o,Vj:()=>i,mM:()=>l});var n=a(93873),s=a(30066),r=a(17275);const o=(e,t,a=3)=>{let r=0;const o=(0,n.A)(50,250);return(0,s.A)(a=>{const n=a.loaded,s=a.lengthComputable?a.total:void 0,i=n-r,l=o(i);r=n,e({loaded:n,total:s,progress:s?n/s:void 0,bytes:i,rate:l||void 0,estimated:l&&s&&n<=s?(s-n)/l:void 0,event:a,lengthComputable:null!=s,[t?"download":"upload"]:!0})},a)},i=(e,t)=>{const a=null!=e;return[n=>t[0]({lengthComputable:a,total:e,loaded:n}),t[1]]},l=e=>(...t)=>r.A.asap(()=>e(...t))},88382(e,t,a){"use strict";a.d(t,{A:()=>u});var n=a(63820),s=a(17275),r=a(86305),o=a(9887),i=a(88262),l=a(44662),c=a(7110),d=a(93967);const u=e=>{const t=(0,l.A)({},e);let{data:a,withXSRFToken:u,xsrfHeaderName:m,xsrfCookieName:_,headers:h,auth:p}=t | |
| 368 | -;if(t.headers=h=c.A.from(h),t.url=(0,d.A)((0,i.A)(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),p&&h.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?unescape(encodeURIComponent(p.password)):""))),s.A.isFormData(a))if(n.A.hasStandardBrowserEnv||n.A.hasStandardBrowserWebWorkerEnv)h.setContentType(void 0);else if(s.A.isFunction(a.getHeaders)){const e=a.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,a])=>{t.includes(e.toLowerCase())&&h.set(e,a)})}if(n.A.hasStandardBrowserEnv&&(u&&s.A.isFunction(u)&&(u=u(t)),u||!1!==u&&(0,r.A)(t.url))){const e=m&&_&&o.A.read(_);e&&h.set(m,e)}return t}},93873(e,t,a){"use strict";a.d(t,{A:()=>n});const n=function(e,t){e=e||10;const a=new Array(e),n=new Array(e);let s,r=0,o=0;return t=void 0!==t?t:1e3,function(i){const l=Date.now(),c=n[o];s||(s=l),a[r]=i,n[r]=l;let d=o,u=0;for(;d!==r;)u+=a[d++],d%=e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),l-s<t)return;const m=c&&l-c | |
| 369 | -;return m?Math.round(1e3*u/m):void 0}}},20605(e,t,a){"use strict";function n(e){return function(t){return e.apply(null,t)}}a.d(t,{A:()=>n})},30066(e,t,a){"use strict";a.d(t,{A:()=>n});const n=function(e,t){let a,n,s=0,r=1e3/t;const o=(t,r=Date.now())=>{s=r,a=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-s;i>=r?o(e,t):(a=e,n||(n=setTimeout(()=>{n=null,o(a)},r-i)))},()=>a&&o(a)]}},70665(e,t,a){"use strict";a.d(t,{A:()=>d});var n=a(17275),s=a(74062),r=a(73119);function o(e){return n.A.isPlainObject(e)||n.A.isArray(e)}function i(e){return n.A.endsWith(e,"[]")?e.slice(0,-2):e}function l(e,t,a){return e?e.concat(t).map(function(e,t){return e=i(e),!a&&t?"["+e+"]":e}).join(a?".":""):t}const c=n.A.toFlatObject(n.A,{},null,function(e){return/^is[A-Z]/.test(e)}),d=function(e,t,a){if(!n.A.isObject(e))throw new TypeError("target must be an object");t=t||new(r.A||FormData);const d=(a=n.A.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){ | |
| 370 | -return!n.A.isUndefined(t[e])})).metaTokens,u=a.visitor||f,m=a.dots,_=a.indexes,h=(a.Blob||"undefined"!=typeof Blob&&Blob)&&n.A.isSpecCompliantForm(t);if(!n.A.isFunction(u))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(n.A.isDate(e))return e.toISOString();if(n.A.isBoolean(e))return e.toString();if(!h&&n.A.isBlob(e))throw new s.A("Blob is not supported. Use a Buffer instead.");return n.A.isArrayBuffer(e)||n.A.isTypedArray(e)?h&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,a,s){let r=e;if(n.A.isReactNative(t)&&n.A.isReactNativeBlob(e))return t.append(l(s,a,m),p(e)),!1;if(e&&!s&&"object"==typeof e)if(n.A.endsWith(a,"{}"))a=d?a:a.slice(0,-2),e=JSON.stringify(e);else if(n.A.isArray(e)&&function(e){return n.A.isArray(e)&&!e.some(o)}(e)||(n.A.isFileList(e)||n.A.endsWith(a,"[]"))&&(r=n.A.toArray(e)))return a=i(a),r.forEach(function(e,s){!n.A.isUndefined(e)&&null!==e&&t.append(!0===_?l([a],s,m):null===_?a:a+"[]",p(e))}),!1 | |
| 371 | -;return!!o(e)||(t.append(l(s,a,m),p(e)),!1)}const b=[],g=Object.assign(c,{defaultVisitor:f,convertValue:p,isVisitable:o});if(!n.A.isObject(e))throw new TypeError("data must be an object");return function e(a,s){if(!n.A.isUndefined(a)){if(-1!==b.indexOf(a))throw Error("Circular reference detected in "+s.join("."));b.push(a),n.A.forEach(a,function(a,r){!0===(!(n.A.isUndefined(a)||null===a)&&u.call(t,a,n.A.isString(r)?r.trim():r,s,g))&&e(a,s?s.concat(r):[r])}),b.pop()}}(e),t}},31076(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(17275),s=a(70665),r=a(63820);function o(e,t){return(0,s.A)(e,new r.A.classes.URLSearchParams,{visitor:function(e,t,a,s){return r.A.isNode&&n.A.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}},1791(e,t,a){"use strict";a.d(t,{E9:()=>s});const n=function*(e,t){let a=e.byteLength;if(!t||a<t)return void(yield e);let n,s=0;for(;s<a;)n=s+t,yield e.slice(s,n),s=n},s=(e,t,a,s)=>{const r=async function*(e,t){ | |
| 372 | -for await(const a of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:a}=await t.read();if(e)break;yield a}}finally{await t.cancel()}}(e))yield*n(a,t)}(e,t);let o,i=0,l=e=>{o||(o=!0,s&&s(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await r.next();if(t)return l(),void e.close();let s=n.byteLength;if(a){let e=i+=s;a(e)}e.enqueue(new Uint8Array(n))}catch(e){throw l(e),e}},cancel:e=>(l(e),r.return())},{highWaterMark:2})}},13390(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(89888),s=a(74062);const r={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{r[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const o={};r.transitional=function(e,t,a){function r(e,t){return"[Axios v"+n.x+"] Transitional option '"+e+"'"+t+(a?". "+a:"")}return(a,n,i)=>{if(!1===e)throw new s.A(r(n," has been removed"+(t?" in "+t:"")),s.A.ERR_DEPRECATED);return t&&!o[n]&&(o[n]=!0, | |
| 373 | -console.warn(r(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(a,n,i)}},r.spelling=function(e){return(t,a)=>(console.warn(`${a} is likely a misspelling of ${e}`),!0)};const i={assertOptions:function(e,t,a){if("object"!=typeof e)throw new s.A("options must be an object",s.A.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let r=n.length;for(;r-- >0;){const o=n[r],i=t[o];if(i){const t=e[o],a=void 0===t||i(t,o,e);if(!0!==a)throw new s.A("option "+o+" must be "+a,s.A.ERR_BAD_OPTION_VALUE);continue}if(!0!==a)throw new s.A("Unknown option "+o,s.A.ERR_BAD_OPTION)}},validators:r}},66501(e,t,a){"use strict";a.d(t,{A:()=>n});const n="undefined"!=typeof Blob?Blob:null},98556(e,t,a){"use strict";a.d(t,{A:()=>n});const n="undefined"!=typeof FormData?FormData:null},60139(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(95267);const s="undefined"!=typeof URLSearchParams?URLSearchParams:n.A},56847(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(60139),s=a(98556),r=a(66501) | |
| 374 | -;const o={isBrowser:!0,classes:{URLSearchParams:n.A,FormData:s.A,Blob:r.A},protocols:["http","https","file","blob","url","data"]}},92569(e,t,a){"use strict";a.r(t),a.d(t,{hasBrowserEnv:()=>n,hasStandardBrowserEnv:()=>r,hasStandardBrowserWebWorkerEnv:()=>o,navigator:()=>s,origin:()=>i});const n="undefined"!=typeof window&&"undefined"!=typeof document,s="object"==typeof navigator&&navigator||void 0,r=n&&(!s||["ReactNative","NativeScript","NS"].indexOf(s.product)<0),o="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,i=n&&window.location.href||"http://localhost"},63820(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(56847);const s={...a(92569),...n.A}},17275(e,t,a){"use strict";a.d(t,{A:()=>G});var n=a(12125);const{toString:s}=Object.prototype,{getPrototypeOf:r}=Object,{iterator:o,toStringTag:i}=Symbol,l=(c=Object.create(null),e=>{const t=s.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c | |
| 375 | -;const d=e=>(e=e.toLowerCase(),t=>l(t)===e),u=e=>t=>typeof t===e,{isArray:m}=Array,_=u("undefined");function h(e){return null!==e&&!_(e)&&null!==e.constructor&&!_(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const p=d("ArrayBuffer"),f=u("string"),b=u("function"),g=u("number"),y=e=>null!==e&&"object"==typeof e,k=e=>{if("object"!==l(e))return!1;const t=r(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||i in e||o in e)},v=d("Date"),x=d("File"),w=d("Blob"),M=d("FileList"),L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},j=void 0!==L.FormData?L.FormData:void 0,S=d("URLSearchParams"),[Y,D,T,C]=["ReadableStream","Request","Response","Headers"].map(d);function N(e,t,{allOwnKeys:a=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),m(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(h(e))return | |
| 376 | -;const s=a?Object.getOwnPropertyNames(e):Object.keys(e),r=s.length;let o;for(n=0;n<r;n++)o=s[n],t.call(null,e[o],o,e)}}function E(e,t){if(h(e))return null;t=t.toLowerCase();const a=Object.keys(e);let n,s=a.length;for(;s-- >0;)if(n=a[s],t===n.toLowerCase())return n;return null}const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:globalThis,A=e=>!_(e)&&e!==O,P=(H="undefined"!=typeof Uint8Array&&r(Uint8Array),e=>H&&e instanceof H);var H;const R=d("HTMLFormElement"),I=(({hasOwnProperty:e})=>(t,a)=>e.call(t,a))(Object.prototype),F=d("RegExp"),W=(e,t)=>{const a=Object.getOwnPropertyDescriptors(e),n={};N(a,(a,s)=>{let r;!1!==(r=t(a,s,e))&&(n[s]=r||a)}),Object.defineProperties(e,n)},z=d("AsyncFunction"),U=(B="function"==typeof setImmediate,V=b(O.postMessage),B?setImmediate:V?($=`axios@${Math.random()}`,q=[],O.addEventListener("message",({source:e,data:t})=>{e===O&&t===$&&q.length&&q.shift()()},!1),e=>{q.push(e),O.postMessage($,"*") | |
| 377 | -}):e=>setTimeout(e));var B,V,$,q;const J="undefined"!=typeof queueMicrotask?queueMicrotask.bind(O):"undefined"!=typeof process&&process.nextTick||U,G={isArray:m,isArrayBuffer:p,isBuffer:h,isFormData:e=>{let t;return e&&(j&&e instanceof j||b(e.append)&&("formdata"===(t=l(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:f,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:k,isEmptyObject:e=>{if(!y(e)||h(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Y,isRequest:D,isResponse:T,isHeaders:C,isUndefined:_,isDate:v,isFile:x,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:w,isRegExp:F,isFunction:b,isStream:e=>y(e)&&b(e.pipe),isURLSearchParams:S,isTypedArray:P,isFileList:M, | |
| 378 | -forEach:N,merge:function e(){const{caseless:t,skipUndefined:a}=A(this)&&this||{},n={},s=(s,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=t&&E(n,r)||r;k(n[o])&&k(s)?n[o]=e(n[o],s):k(s)?n[o]=e({},s):m(s)?n[o]=s.slice():a&&_(s)||(n[o]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&N(arguments[e],s);return n},extend:(e,t,a,{allOwnKeys:s}={})=>(N(t,(t,s)=>{a&&b(t)?Object.defineProperty(e,s,{value:(0,n.A)(t,a),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,a,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),a&&Object.assign(e.prototype,a)},toFlatObject:(e,t,a,n)=>{ | |
| 379 | -let s,o,i;const l={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],n&&!n(i,e,t)||l[i]||(t[i]=e[i],l[i]=!0);e=!1!==a&&r(e)}while(e&&(!a||a(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:d,endsWith:(e,t,a)=>{e=String(e),(void 0===a||a>e.length)&&(a=e.length),a-=t.length;const n=e.indexOf(t,a);return-1!==n&&n===a},toArray:e=>{if(!e)return null;if(m(e))return e;let t=e.length;if(!g(t))return null;const a=new Array(t);for(;t-- >0;)a[t]=e[t];return a},forEachEntry:(e,t)=>{const a=(e&&e[o]).call(e);let n;for(;(n=a.next())&&!n.done;){const a=n.value;t.call(e,a[0],a[1])}},matchAll:(e,t)=>{let a;const n=[];for(;null!==(a=e.exec(t));)n.push(a);return n},isHTMLForm:R,hasOwnProperty:I,hasOwnProp:I,reduceDescriptors:W,freezeMethods:e=>{W(e,(t,a)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(a))return!1;const n=e[a];b(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{ | |
| 380 | -throw Error("Can not rewrite read-only method '"+a+"'")}))})},toObjectSet:(e,t)=>{const a={},n=e=>{e.forEach(e=>{a[e]=!0})};return m(e)?n(e):n(String(e).split(t)),a},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,a){return t.toUpperCase()+a}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:E,global:O,isContextDefined:A,isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[i]&&e[o])},toJSONObject:e=>{const t=new Array(10),a=(e,n)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(h(e))return e;if(!("toJSON"in e)){t[n]=e;const s=m(e)?[]:{};return N(e,(e,t)=>{const r=a(e,n+1);!_(r)&&(s[t]=r)}),t[n]=void 0,s}}return e};return a(e,0)},isAsyncFn:z,isThenable:e=>e&&(y(e)||b(e))&&b(e.then)&&b(e.catch),setImmediate:U,asap:J,isIterable:e=>null!=e&&b(e[o])}},99418(e,t,a){"use strict";const{entries:n,setPrototypeOf:s,isFrozen:r,getPrototypeOf:o,getOwnPropertyDescriptor:i}=Object | |
| 381 | -;let{freeze:l,seal:c,create:d}=Object,{apply:u,construct:m}="undefined"!=typeof Reflect&&Reflect;l||(l=function(e){return e}),c||(c=function(e){return e}),u||(u=function(e,t){for(var a=arguments.length,n=new Array(a>2?a-2:0),s=2;s<a;s++)n[s-2]=arguments[s];return e.apply(t,n)}),m||(m=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];return new e(...a)});const _=Y(Array.prototype.forEach),h=Y(Array.prototype.lastIndexOf),p=Y(Array.prototype.pop),f=Y(Array.prototype.push),b=Y(Array.prototype.splice),g=Y(String.prototype.toLowerCase),y=Y(String.prototype.toString),k=Y(String.prototype.match),v=Y(String.prototype.replace),x=Y(String.prototype.indexOf),w=Y(String.prototype.trim),M=Y(Object.prototype.hasOwnProperty),L=Y(RegExp.prototype.test),j=(S=TypeError,function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return m(S,t)});var S;function Y(e){return function(t){t instanceof RegExp&&(t.lastIndex=0) | |
| 382 | -;for(var a=arguments.length,n=new Array(a>1?a-1:0),s=1;s<a;s++)n[s-1]=arguments[s];return u(e,t,n)}}function D(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g;s&&s(e,null);let n=t.length;for(;n--;){let s=t[n];if("string"==typeof s){const e=a(s);e!==s&&(r(t)||(t[n]=e),s=e)}e[s]=!0}return e}function T(e){for(let t=0;t<e.length;t++)M(e,t)||(e[t]=null);return e}function C(e){const t=d(null);for(const[a,s]of n(e))M(e,a)&&(Array.isArray(s)?t[a]=T(s):s&&"object"==typeof s&&s.constructor===Object?t[a]=C(s):t[a]=s);return t}function N(e,t){for(;null!==e;){const a=i(e,t);if(a){if(a.get)return Y(a.get);if("function"==typeof a.value)return Y(a.value)}e=o(e)}return function(){return null}} | |
| 338 | +t):(r=e,o=a)}var r,o,i=!1,l=void 0===a?null:a;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,a,n,d]);var _=r(e,u[0],u[1]);return i(function(){m.hasValue=!0,m.value=_},[_]),c(_),_}},78418(e,t,a){"use strict";e.exports=a(85160)},9771(e){"use strict";e.exports=function(){}},51609(e){"use strict";e.exports=window.React},75795(e){"use strict";e.exports=window.ReactDOM},66087(e){"use strict";e.exports=window.lodash},47143(e){"use strict";e.exports=window.wp.data},38443(e){"use strict";e.exports=window.wp.date},27723(e){"use strict";e.exports=window.wp.i18n},46942(e,t){var a;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=o(e,r(a)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e) | |
| 339 | +;if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)n.call(e,a)&&e[a]&&(t=o(t,a));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0===(a=function(){return s}.apply(t,[]))||(e.exports=a)}()},36263(e,t,a){"use strict";a.d(t,{A:()=>u});var n=a(17275),s=a(73119),r=a(17013),o=a(77960),i=a(74062);const l={http:s.A,xhr:r.A,fetch:{get:o.J}};n.A.forEach(l,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const c=e=>`- ${e}`,d=e=>n.A.isFunction(e)||null===e||!1===e,u={getAdapter:function(e,t){e=n.A.isArray(e)?e:[e];const{length:a}=e;let s,r;const o={};for(let c=0;c<a;c++){let a;if(s=e[c],r=s,!d(s)&&(r=l[(a=String(s)).toLowerCase()],void 0===r))throw new i.A(`Unknown adapter '${a}'`);if(r&&(n.A.isFunction(r)||(r=r.get(t))))break;o[a||"#"+c]=r}if(!r){ | |
| 340 | +const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=a?e.length>1?"since :\n"+e.map(c).join("\n"):" "+c(e[0]):"as no adapter specified";throw new i.A("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return r},adapters:l}},77960(e,t,a){"use strict";a.d(t,{J:()=>y});var n=a(63820),s=a(17275),r=a(74062),o=a(12723),i=a(1791),l=a(7110),c=a(77837),d=a(88382),u=a(63853);const{isFunction:m}=s.A,_=(({Request:e,Response:t})=>({Request:e,Response:t}))(s.A.global),{ReadableStream:h,TextEncoder:p}=s.A.global,f=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},b=e=>{e=s.A.merge.call({skipUndefined:!0},_,e);const{fetch:t,Request:a,Response:b}=e,g=t?m(t):"function"==typeof fetch,y=m(a),k=m(b);if(!g)return!1;const v=g&&m(h),x=g&&("function"==typeof p?(w=new p,e=>w.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer()));var w;const M=y&&v&&f(()=>{let e=!1 | |
| 341 | +;const t=new h,s=new a(n.A.origin,{body:t,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return t.cancel(),e&&!s}),L=k&&v&&f(()=>s.A.isReadableStream(new b("").body)),j={stream:L&&(e=>e.body)};g&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!j[e]&&(j[e]=(t,a)=>{let n=t&&t[e];if(n)return n.call(t);throw new r.A(`Response type '${e}' is not supported`,r.A.ERR_NOT_SUPPORT,a)})});return async e=>{let{url:m,method:_,data:h,signal:p,cancelToken:f,timeout:g,onDownloadProgress:k,onUploadProgress:v,responseType:w,headers:S,withCredentials:Y="same-origin",fetchOptions:D}=(0,d.A)(e),T=t||fetch;w=w?(w+"").toLowerCase():"text";let C=(0,o.A)([p,f&&f.toAbortSignal()],g),N=null;const E=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let O;try{if(v&&M&&"get"!==_&&"head"!==_&&0!==(O=await(async(e,t)=>{const r=s.A.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(s.A.isBlob(e))return e.size;if(s.A.isSpecCompliantForm(e)){ | |
| 342 | +const t=new a(n.A.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return s.A.isArrayBufferView(e)||s.A.isArrayBuffer(e)?e.byteLength:(s.A.isURLSearchParams(e)&&(e+=""),s.A.isString(e)?(await x(e)).byteLength:void 0)})(t):r})(S,h))){let e,t=new a(m,{method:"POST",body:h,duplex:"half"});if(s.A.isFormData(h)&&(e=t.headers.get("content-type"))&&S.setContentType(e),t.body){const[e,a]=(0,c.Vj)(O,(0,c.C1)((0,c.mM)(v)));h=(0,i.E9)(t.body,65536,e,a)}}s.A.isString(Y)||(Y=Y?"include":"omit");const t=y&&"credentials"in a.prototype,r={...D,signal:C,method:_.toUpperCase(),headers:S.normalize().toJSON(),body:h,duplex:"half",credentials:t?Y:void 0};N=y&&new a(m,r);let o=await(y?T(N,D):T(m,r));const d=L&&("stream"===w||"response"===w);if(L&&(k||d&&E)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=o[t]});const t=s.A.toFiniteNumber(o.headers.get("content-length")),[a,n]=k&&(0,c.Vj)(t,(0,c.C1)((0,c.mM)(k),!0))||[];o=new b((0,i.E9)(o.body,65536,a,()=>{n&&n(),E&&E() | |
| 343 | +}),e)}w=w||"text";let p=await j[s.A.findKey(j,w)||"text"](o,e);return!d&&E&&E(),await new Promise((t,a)=>{(0,u.A)(t,a,{data:p,headers:l.A.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:N})})}catch(t){if(E&&E(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new r.A("Network Error",r.A.ERR_NETWORK,e,N,t&&t.response),{cause:t.cause||t});throw r.A.from(t,t&&t.code,e,N,t&&t.response)}}},g=new Map,y=e=>{let t=e&&e.env||{};const{fetch:a,Request:n,Response:s}=t,r=[n,s,a];let o,i,l=r.length,c=g;for(;l--;)o=r[l],i=c.get(o),void 0===i&&c.set(o,i=l?new Map:b(t)),c=i;return i};y()},17013(e,t,a){"use strict";a.d(t,{A:()=>_});var n=a(17275),s=a(63853),r=a(10807),o=a(74062),i=a(38458),l=a(55579),c=a(63820),d=a(7110),u=a(77837),m=a(88382);const _="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,a){const _=(0,m.A)(e);let h=_.data;const p=d.A.from(_.headers).normalize() | |
| 344 | +;let f,b,g,y,k,{responseType:v,onUploadProgress:x,onDownloadProgress:w}=_;function M(){y&&y(),k&&k(),_.cancelToken&&_.cancelToken.unsubscribe(f),_.signal&&_.signal.removeEventListener("abort",f)}let L=new XMLHttpRequest;function j(){if(!L)return;const n=d.A.from("getAllResponseHeaders"in L&&L.getAllResponseHeaders()),r={data:v&&"text"!==v&&"json"!==v?L.response:L.responseText,status:L.status,statusText:L.statusText,headers:n,config:e,request:L};(0,s.A)(function(e){t(e),M()},function(e){a(e),M()},r),L=null}L.open(_.method.toUpperCase(),_.url,!0),L.timeout=_.timeout,"onloadend"in L?L.onloadend=j:L.onreadystatechange=function(){L&&4===L.readyState&&(0!==L.status||L.responseURL&&0===L.responseURL.indexOf("file:"))&&setTimeout(j)},L.onabort=function(){L&&(a(new o.A("Request aborted",o.A.ECONNABORTED,e,L)),L=null)},L.onerror=function(t){const n=t&&t.message?t.message:"Network Error",s=new o.A(n,o.A.ERR_NETWORK,e,L);s.event=t||null,a(s),L=null},L.ontimeout=function(){ | |
| 345 | +let t=_.timeout?"timeout of "+_.timeout+"ms exceeded":"timeout exceeded";const n=_.transitional||r.A;_.timeoutErrorMessage&&(t=_.timeoutErrorMessage),a(new o.A(t,n.clarifyTimeoutError?o.A.ETIMEDOUT:o.A.ECONNABORTED,e,L)),L=null},void 0===h&&p.setContentType(null),"setRequestHeader"in L&&n.A.forEach(p.toJSON(),function(e,t){L.setRequestHeader(t,e)}),n.A.isUndefined(_.withCredentials)||(L.withCredentials=!!_.withCredentials),v&&"json"!==v&&(L.responseType=_.responseType),w&&([g,k]=(0,u.C1)(w,!0),L.addEventListener("progress",g)),x&&L.upload&&([b,y]=(0,u.C1)(x),L.upload.addEventListener("progress",b),L.upload.addEventListener("loadend",y)),(_.cancelToken||_.signal)&&(f=t=>{L&&(a(!t||t.type?new i.A(null,e,L):t),L.abort(),L=null)},_.cancelToken&&_.cancelToken.subscribe(f),_.signal&&(_.signal.aborted?f():_.signal.addEventListener("abort",f)));const S=(0,l.A)(_.url);S&&-1===c.A.protocols.indexOf(S)?a(new o.A("Unsupported protocol "+S+":",o.A.ERR_BAD_REQUEST,e)):L.send(h||null)})}}, | |
| 346 | +57536(e,t,a){"use strict";a.d(t,{A:()=>v});var n=a(17275),s=a(12125),r=a(55978),o=a(44662),i=a(6013),l=a(77887),c=a(38458),d=a(64874),u=a(59575),m=a(89888),_=a(70665),h=a(74062),p=a(20605),f=a(68562),b=a(7110),g=a(36263),y=a(7693);const k=function e(t){const a=new r.A(t),i=(0,s.A)(r.A.prototype.request,a);return n.A.extend(i,r.A.prototype,a,{allOwnKeys:!0}),n.A.extend(i,a,null,{allOwnKeys:!0}),i.create=function(a){return e((0,o.A)(t,a))},i}(i.A);k.Axios=r.A,k.CanceledError=c.A,k.CancelToken=d.A,k.isCancel=u.A,k.VERSION=m.x,k.toFormData=_.A,k.AxiosError=h.A,k.Cancel=k.CanceledError,k.all=function(e){return Promise.all(e)},k.spread=p.A,k.isAxiosError=f.A,k.mergeConfig=o.A,k.AxiosHeaders=b.A,k.formToJSON=e=>(0,l.A)(n.A.isHTMLForm(e)?new FormData(e):e),k.getAdapter=g.A.getAdapter,k.HttpStatusCode=y.A,k.default=k;const v=k},64874(e,t,a){"use strict";a.d(t,{A:()=>r});var n=a(38458);class s{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t | |
| 347 | +;this.promise=new Promise(function(e){t=e});const a=this;this.promise.then(e=>{if(!a._listeners)return;let t=a._listeners.length;for(;t-- >0;)a._listeners[t](e);a._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{a.subscribe(e),t=e}).then(e);return n.cancel=function(){a.unsubscribe(t)},n},e(function(e,s,r){a.reason||(a.reason=new n.A(e,s,r),t(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new s(function(t){e=t}),cancel:e}}}const r=s},38458(e,t,a){"use strict";a.d(t,{A:()=>r});var n=a(74062);class s extends n.A{constructor(e,t,a){ | |
| 348 | +super(null==e?"canceled":e,n.A.ERR_CANCELED,t,a),this.name="CanceledError",this.__CANCEL__=!0}}const r=s},59575(e,t,a){"use strict";function n(e){return!(!e||!e.__CANCEL__)}a.d(t,{A:()=>n})},55978(e,t,a){"use strict";a.d(t,{A:()=>h});var n=a(17275),s=a(93967),r=a(17352),o=a(48683),i=a(44662),l=a(88262),c=a(13390),d=a(7110),u=a(10807);const m=c.A.validators;class _{constructor(e){this.defaults=e||{},this.interceptors={request:new r.A,response:new r.A}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const a=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?a&&!String(e.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+a):e.stack=a}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=(0,i.A)(this.defaults,t);const{transitional:a,paramsSerializer:s,headers:r}=t;void 0!==a&&c.A.assertOptions(a,{silentJSONParsing:m.transitional(m.boolean), | |
| 349 | +forcedJSONParsing:m.transitional(m.boolean),clarifyTimeoutError:m.transitional(m.boolean),legacyInterceptorReqResOrdering:m.transitional(m.boolean)},!1),null!=s&&(n.A.isFunction(s)?t.paramsSerializer={serialize:s}:c.A.assertOptions(s,{encode:m.function,serialize:m.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),c.A.assertOptions(t,{baseUrl:m.spelling("baseURL"),withXsrfToken:m.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let l=r&&n.A.merge(r.common,r[t.method]);r&&n.A.forEach(["delete","get","head","post","put","patch","common"],e=>{delete r[e]}),t.headers=d.A.concat(l,r);const _=[];let h=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;h=h&&e.synchronous;const a=t.transitional||u.A | |
| 350 | +;a&&a.legacyInterceptorReqResOrdering?_.unshift(e.fulfilled,e.rejected):_.push(e.fulfilled,e.rejected)});const p=[];let f;this.interceptors.response.forEach(function(e){p.push(e.fulfilled,e.rejected)});let b,g=0;if(!h){const e=[o.A.bind(this),void 0];for(e.unshift(..._),e.push(...p),b=e.length,f=Promise.resolve(t);g<b;)f=f.then(e[g++],e[g++]);return f}b=_.length;let y=t;for(;g<b;){const e=_[g++],t=_[g++];try{y=e(y)}catch(e){t.call(this,e);break}}try{f=o.A.call(this,y)}catch(e){return Promise.reject(e)}for(g=0,b=p.length;g<b;)f=f.then(p[g++],p[g++]);return f}getUri(e){e=(0,i.A)(this.defaults,e);const t=(0,l.A)(e.baseURL,e.url,e.allowAbsoluteUrls);return(0,s.A)(t,e.params,e.paramsSerializer)}}n.A.forEach(["delete","get","head","options"],function(e){_.prototype[e]=function(t,a){return this.request((0,i.A)(a||{},{method:e,url:t,data:(a||{}).data}))}}),n.A.forEach(["post","put","patch"],function(e){function t(t){return function(a,n,s){return this.request((0,i.A)(s||{},{method:e,headers:t?{ | |
| 351 | +"Content-Type":"multipart/form-data"}:{},url:a,data:n}))}}_.prototype[e]=t(),_.prototype[e+"Form"]=t(!0)});const h=_},74062(e,t,a){"use strict";a.d(t,{A:()=>r});var n=a(17275);class s extends Error{static from(e,t,a,n,r,o){const i=new s(e.message,t||e.code,a,n,r);return i.cause=e,i.name=e.name,null!=e.status&&null==i.status&&(i.status=e.status),o&&Object.assign(i,o),i}constructor(e,t,a,n,s){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),a&&(this.config=a),n&&(this.request=n),s&&(this.response=s,this.status=s.status)}toJSON(){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:n.A.toJSONObject(this.config),code:this.code,status:this.status}}}s.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",s.ERR_BAD_OPTION="ERR_BAD_OPTION", | |
| 352 | +s.ECONNABORTED="ECONNABORTED",s.ETIMEDOUT="ETIMEDOUT",s.ERR_NETWORK="ERR_NETWORK",s.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",s.ERR_DEPRECATED="ERR_DEPRECATED",s.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",s.ERR_BAD_REQUEST="ERR_BAD_REQUEST",s.ERR_CANCELED="ERR_CANCELED",s.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",s.ERR_INVALID_URL="ERR_INVALID_URL";const r=s},7110(e,t,a){"use strict";a.d(t,{A:()=>d});var n=a(17275),s=a(43325);const r=Symbol("internals");function o(e){return e&&String(e).trim().toLowerCase()}function i(e){return!1===e||null==e?e:n.A.isArray(e)?e.map(i):String(e).replace(/[\r\n]+$/,"")}function l(e,t,a,s,r){return n.A.isFunction(s)?s.call(this,t,a):(r&&(t=a),n.A.isString(t)?n.A.isString(s)?-1!==t.indexOf(s):n.A.isRegExp(s)?s.test(t):void 0:void 0)}class c{constructor(e){e&&this.set(e)}set(e,t,a){const r=this;function l(e,t,a){const s=o(t);if(!s)throw new Error("header name must be a non-empty string");const l=n.A.findKey(r,s) | |
| 353 | +;(!l||void 0===r[l]||!0===a||void 0===a&&!1!==r[l])&&(r[l||t]=i(e))}const c=(e,t)=>n.A.forEach(e,(e,a)=>l(e,a,t));if(n.A.isPlainObject(e)||e instanceof this.constructor)c(e,t);else if(n.A.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))c((0,s.A)(e),t);else if(n.A.isObject(e)&&n.A.isIterable(e)){let a,s,r={};for(const t of e){if(!n.A.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[s=t[0]]=(a=r[s])?n.A.isArray(a)?[...a,t[1]]:[a,t[1]]:t[1]}c(r,t)}else null!=e&&l(t,e,a);return this}get(e,t){if(e=o(e)){const a=n.A.findKey(this,e);if(a){const e=this[a];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=a.exec(e);)t[n[1]]=n[2];return t}(e);if(n.A.isFunction(t))return t.call(this,e,a);if(n.A.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=o(e)){const a=n.A.findKey(this,e) | |
| 354 | +;return!(!a||void 0===this[a]||t&&!l(0,this[a],a,t))}return!1}delete(e,t){const a=this;let s=!1;function r(e){if(e=o(e)){const r=n.A.findKey(a,e);!r||t&&!l(0,a[r],r,t)||(delete a[r],s=!0)}}return n.A.isArray(e)?e.forEach(r):r(e),s}clear(e){const t=Object.keys(this);let a=t.length,n=!1;for(;a--;){const s=t[a];e&&!l(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,a={};return n.A.forEach(this,(s,r)=>{const o=n.A.findKey(a,r);if(o)return t[o]=i(s),void delete t[r];const l=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,a)=>t.toUpperCase()+a)}(r):String(r).trim();l!==r&&delete t[r],t[l]=i(s),a[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return n.A.forEach(this,(a,s)=>{null!=a&&!1!==a&&(t[s]=e&&n.A.isArray(a)?a.join(", "):a)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){ | |
| 355 | +return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const a=new this(e);return t.forEach(e=>a.set(e)),a}static accessor(e){const t=(this[r]=this[r]={accessors:{}}).accessors,a=this.prototype;function s(e){const s=o(e);t[s]||(function(e,t){const a=n.A.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+a,{value:function(e,a,s){return this[n].call(this,t,e,a,s)},configurable:!0})})}(a,e),t[s]=!0)}return n.A.isArray(e)?e.forEach(s):s(e),this}}c.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),n.A.reduceDescriptors(c.prototype,({value:e},t)=>{let a=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[a]=e}}}),n.A.freezeMethods(c);const d=c},17352(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(17275);const s=class{ | |
| 356 | +constructor(){this.handlers=[]}use(e,t,a){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!a&&a.synchronous,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){n.A.forEach(this.handlers,function(t){null!==t&&e(t)})}}},88262(e,t,a){"use strict";a.d(t,{A:()=>r});var n=a(99034),s=a(76787);function r(e,t,a){let r=!(0,n.A)(t);return e&&(r||0==a)?(0,s.A)(e,t):t}},48683(e,t,a){"use strict";a.d(t,{A:()=>d});var n=a(19152),s=a(59575),r=a(6013),o=a(38458),i=a(7110),l=a(36263);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new o.A(null,e)}function d(e){return c(e),e.headers=i.A.from(e.headers),e.data=n.A.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),l.A.getAdapter(e.adapter||r.A.adapter,e)(e).then(function(t){return c(e), | |
| 357 | +t.data=n.A.call(e,e.transformResponse,t),t.headers=i.A.from(t.headers),t},function(t){return(0,s.A)(t)||(c(e),t&&t.response&&(t.response.data=n.A.call(e,e.transformResponse,t.response),t.response.headers=i.A.from(t.response.headers))),Promise.reject(t)})}},44662(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(17275),s=a(7110);const r=e=>e instanceof s.A?{...e}:e;function o(e,t){t=t||{};const a={};function s(e,t,a,s){return n.A.isPlainObject(e)&&n.A.isPlainObject(t)?n.A.merge.call({caseless:s},e,t):n.A.isPlainObject(t)?n.A.merge({},t):n.A.isArray(t)?t.slice():t}function o(e,t,a,r){return n.A.isUndefined(t)?n.A.isUndefined(e)?void 0:s(void 0,e,0,r):s(e,t,0,r)}function i(e,t){if(!n.A.isUndefined(t))return s(void 0,t)}function l(e,t){return n.A.isUndefined(t)?n.A.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function c(a,n,r){return r in t?s(a,n):r in e?s(void 0,a):void 0}const d={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l, | |
| 358 | +timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:c,headers:(e,t,a)=>o(r(e),r(t),0,!0)};return n.A.forEach(Object.keys({...e,...t}),function(s){if("__proto__"===s||"constructor"===s||"prototype"===s)return;const r=n.A.hasOwnProp(d,s)?d[s]:o,i=r(e[s],t[s],s);n.A.isUndefined(i)&&r!==c||(a[s]=i)}),a}},63853(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(74062);function s(e,t,a){const s=a.config.validateStatus;a.status&&s&&!s(a.status)?t(new n.A("Request failed with status code "+a.status,[n.A.ERR_BAD_REQUEST,n.A.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a)):e(a)}},19152(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(17275),s=a(6013),r=a(7110);function o(e,t){const a=this||s.A,o=t||a,i=r.A.from(o.headers) | |
| 359 | +;let l=o.data;return n.A.forEach(e,function(e){l=e.call(a,l,i.normalize(),t?t.status:void 0)}),i.normalize(),l}},6013(e,t,a){"use strict";a.d(t,{A:()=>u});var n=a(17275),s=a(74062),r=a(10807),o=a(70665),i=a(31076),l=a(63820),c=a(77887);const d={transitional:r.A,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const a=t.getContentType()||"",s=a.indexOf("application/json")>-1,r=n.A.isObject(e);if(r&&n.A.isHTMLForm(e)&&(e=new FormData(e)),n.A.isFormData(e))return s?JSON.stringify((0,c.A)(e)):e;if(n.A.isArrayBuffer(e)||n.A.isBuffer(e)||n.A.isStream(e)||n.A.isFile(e)||n.A.isBlob(e)||n.A.isReadableStream(e))return e;if(n.A.isArrayBufferView(e))return e.buffer;if(n.A.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(r){if(a.indexOf("application/x-www-form-urlencoded")>-1)return(0,i.A)(e,this.formSerializer).toString();if((l=n.A.isFileList(e))||a.indexOf("multipart/form-data")>-1){ | |
| 360 | +const t=this.env&&this.env.FormData;return(0,o.A)(l?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||s?(t.setContentType("application/json",!1),function(e){if(n.A.isString(e))try{return(0,JSON.parse)(e),n.A.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||d.transitional,a=t&&t.forcedJSONParsing,r="json"===this.responseType;if(n.A.isResponse(e)||n.A.isReadableStream(e))return e;if(e&&n.A.isString(e)&&(a&&!this.responseType||r)){const a=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(a){if("SyntaxError"===e.name)throw s.A.from(e,s.A.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:l.A.classes.FormData,Blob:l.A.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{ | |
| 361 | +Accept:"application/json, text/plain, */*","Content-Type":void 0}}};n.A.forEach(["delete","get","head","post","put","patch"],e=>{d.headers[e]={}});const u=d},10807(e,t,a){"use strict";a.d(t,{A:()=>n});const n={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0}},89888(e,t,a){"use strict";a.d(t,{x:()=>n});const n="1.14.0"},95267(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(70665);function s(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function r(e,t){this._pairs=[],e&&(0,n.A)(e,this,t)}const o=r.prototype;o.append=function(e,t){this._pairs.push([e,t])},o.toString=function(e){const t=e?function(t){return e.call(this,t,s)}:s;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const i=r},7693(e,t,a){"use strict";a.d(t,{A:()=>s});const n={Continue:100,SwitchingProtocols:101,Processing:102, | |
| 362 | +EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504, | |
| 363 | +HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(n).forEach(([e,t])=>{n[t]=e});const s=n},12125(e,t,a){"use strict";function n(e,t){return function(){return e.apply(t,arguments)}}a.d(t,{A:()=>n})},93967(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(17275),s=a(95267);function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function o(e,t,a){if(!t)return e;const o=a&&a.encode||r,i=n.A.isFunction(a)?{serialize:a}:a,l=i&&i.serialize;let c;if(c=l?l(t,i):n.A.isURLSearchParams(t)?t.toString():new s.A(t,i).toString(o),c){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+c}return e}},76787(e,t,a){"use strict";function n(e,t){ | |
| 364 | +return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}a.d(t,{A:()=>n})},12723(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(38458),s=a(74062),r=a(17275);const o=(e,t)=>{const{length:a}=e=e?e.filter(Boolean):[];if(t||a){let a,o=new AbortController;const i=function(e){if(!a){a=!0,c();const t=e instanceof Error?e:this.reason;o.abort(t instanceof s.A?t:new n.A(t instanceof Error?t.message:t))}};let l=t&&setTimeout(()=>{l=null,i(new s.A(`timeout of ${t}ms exceeded`,s.A.ETIMEDOUT))},t);const c=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:d}=o;return d.unsubscribe=()=>r.A.asap(c),d}}},9887(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(17275);const s=a(63820).A.hasStandardBrowserEnv?{write(e,t,a,s,r,o,i){if("undefined"==typeof document)return;const l=[`${e}=${encodeURIComponent(t)}`];n.A.isNumber(a)&&l.push(`expires=${new Date(a).toUTCString()}`), | |
| 365 | +n.A.isString(s)&&l.push(`path=${s}`),n.A.isString(r)&&l.push(`domain=${r}`),!0===o&&l.push("secure"),n.A.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}}},77887(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(17275);const s=function(e){function t(e,a,s,r){let o=e[r++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),l=r>=e.length;return o=!o&&n.A.isArray(s)?s.length:o,l?(n.A.hasOwnProp(s,o)?s[o]=[s[o],a]:s[o]=a,!i):(s[o]&&n.A.isObject(s[o])||(s[o]=[]),t(e,a,s[o],r)&&n.A.isArray(s[o])&&(s[o]=function(e){const t={},a=Object.keys(e);let n;const s=a.length;let r;for(n=0;n<s;n++)r=a[n],t[r]=e[r];return t}(s[o])),!i)}if(n.A.isFormData(e)&&n.A.isFunction(e.entries)){const a={};return n.A.forEachEntry(e,(e,s)=>{t(function(e){ | |
| 366 | +return n.A.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),s,a,0)}),a}return null}},99034(e,t,a){"use strict";function n(e){return"string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}a.d(t,{A:()=>n})},68562(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(17275);function s(e){return n.A.isObject(e)&&!0===e.isAxiosError}},86305(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(63820);const s=n.A.hasStandardBrowserEnv?(r=new URL(n.A.origin),o=n.A.navigator&&/(msie|trident)/i.test(n.A.navigator.userAgent),e=>(e=new URL(e,n.A.origin),r.protocol===e.protocol&&r.host===e.host&&(o||r.port===e.port))):()=>!0;var r,o},73119(e,t,a){"use strict";a.d(t,{A:()=>n});const n=null},43325(e,t,a){"use strict";a.d(t,{A:()=>s});const n=a(17275).A.toObjectSet(["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"]),s=e=>{ | |
| 367 | +const t={};let a,s,r;return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),a=e.substring(0,r).trim().toLowerCase(),s=e.substring(r+1).trim(),!a||t[a]&&n[a]||("set-cookie"===a?t[a]?t[a].push(s):t[a]=[s]:t[a]=t[a]?t[a]+", "+s:s)}),t}},55579(e,t,a){"use strict";function n(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}a.d(t,{A:()=>n})},77837(e,t,a){"use strict";a.d(t,{C1:()=>o,Vj:()=>i,mM:()=>l});var n=a(93873),s=a(30066),r=a(17275);const o=(e,t,a=3)=>{let r=0;const o=(0,n.A)(50,250);return(0,s.A)(a=>{const n=a.loaded,s=a.lengthComputable?a.total:void 0,i=n-r,l=o(i);r=n,e({loaded:n,total:s,progress:s?n/s:void 0,bytes:i,rate:l||void 0,estimated:l&&s&&n<=s?(s-n)/l:void 0,event:a,lengthComputable:null!=s,[t?"download":"upload"]:!0})},a)},i=(e,t)=>{const a=null!=e;return[n=>t[0]({lengthComputable:a,total:e,loaded:n}),t[1]]},l=e=>(...t)=>r.A.asap(()=>e(...t))},88382(e,t,a){"use strict";a.d(t,{A:()=>u}) | |
| 368 | +;var n=a(63820),s=a(17275),r=a(86305),o=a(9887),i=a(88262),l=a(44662),c=a(7110),d=a(93967);const u=e=>{const t=(0,l.A)({},e);let{data:a,withXSRFToken:u,xsrfHeaderName:m,xsrfCookieName:_,headers:h,auth:p}=t;if(t.headers=h=c.A.from(h),t.url=(0,d.A)((0,i.A)(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),p&&h.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?unescape(encodeURIComponent(p.password)):""))),s.A.isFormData(a))if(n.A.hasStandardBrowserEnv||n.A.hasStandardBrowserWebWorkerEnv)h.setContentType(void 0);else if(s.A.isFunction(a.getHeaders)){const e=a.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,a])=>{t.includes(e.toLowerCase())&&h.set(e,a)})}if(n.A.hasStandardBrowserEnv&&(u&&s.A.isFunction(u)&&(u=u(t)),u||!1!==u&&(0,r.A)(t.url))){const e=m&&_&&o.A.read(_);e&&h.set(m,e)}return t}},93873(e,t,a){"use strict";a.d(t,{A:()=>n});const n=function(e,t){e=e||10;const a=new Array(e),n=new Array(e);let s,r=0,o=0 | |
| 369 | +;return t=void 0!==t?t:1e3,function(i){const l=Date.now(),c=n[o];s||(s=l),a[r]=i,n[r]=l;let d=o,u=0;for(;d!==r;)u+=a[d++],d%=e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),l-s<t)return;const m=c&&l-c;return m?Math.round(1e3*u/m):void 0}}},20605(e,t,a){"use strict";function n(e){return function(t){return e.apply(null,t)}}a.d(t,{A:()=>n})},30066(e,t,a){"use strict";a.d(t,{A:()=>n});const n=function(e,t){let a,n,s=0,r=1e3/t;const o=(t,r=Date.now())=>{s=r,a=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-s;i>=r?o(e,t):(a=e,n||(n=setTimeout(()=>{n=null,o(a)},r-i)))},()=>a&&o(a)]}},70665(e,t,a){"use strict";a.d(t,{A:()=>d});var n=a(17275),s=a(74062),r=a(73119);function o(e){return n.A.isPlainObject(e)||n.A.isArray(e)}function i(e){return n.A.endsWith(e,"[]")?e.slice(0,-2):e}function l(e,t,a){return e?e.concat(t).map(function(e,t){return e=i(e),!a&&t?"["+e+"]":e}).join(a?".":""):t}const c=n.A.toFlatObject(n.A,{},null,function(e){return/^is[A-Z]/.test(e) | |
| 370 | +}),d=function(e,t,a){if(!n.A.isObject(e))throw new TypeError("target must be an object");t=t||new(r.A||FormData);const d=(a=n.A.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!n.A.isUndefined(t[e])})).metaTokens,u=a.visitor||f,m=a.dots,_=a.indexes,h=(a.Blob||"undefined"!=typeof Blob&&Blob)&&n.A.isSpecCompliantForm(t);if(!n.A.isFunction(u))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(n.A.isDate(e))return e.toISOString();if(n.A.isBoolean(e))return e.toString();if(!h&&n.A.isBlob(e))throw new s.A("Blob is not supported. Use a Buffer instead.");return n.A.isArrayBuffer(e)||n.A.isTypedArray(e)?h&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,a,s){let r=e;if(n.A.isReactNative(t)&&n.A.isReactNativeBlob(e))return t.append(l(s,a,m),p(e)),!1;if(e&&!s&&"object"==typeof e)if(n.A.endsWith(a,"{}"))a=d?a:a.slice(0,-2),e=JSON.stringify(e);else if(n.A.isArray(e)&&function(e){return n.A.isArray(e)&&!e.some(o) | |
| 371 | +}(e)||(n.A.isFileList(e)||n.A.endsWith(a,"[]"))&&(r=n.A.toArray(e)))return a=i(a),r.forEach(function(e,s){!n.A.isUndefined(e)&&null!==e&&t.append(!0===_?l([a],s,m):null===_?a:a+"[]",p(e))}),!1;return!!o(e)||(t.append(l(s,a,m),p(e)),!1)}const b=[],g=Object.assign(c,{defaultVisitor:f,convertValue:p,isVisitable:o});if(!n.A.isObject(e))throw new TypeError("data must be an object");return function e(a,s){if(!n.A.isUndefined(a)){if(-1!==b.indexOf(a))throw Error("Circular reference detected in "+s.join("."));b.push(a),n.A.forEach(a,function(a,r){!0===(!(n.A.isUndefined(a)||null===a)&&u.call(t,a,n.A.isString(r)?r.trim():r,s,g))&&e(a,s?s.concat(r):[r])}),b.pop()}}(e),t}},31076(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(17275),s=a(70665),r=a(63820);function o(e,t){return(0,s.A)(e,new r.A.classes.URLSearchParams,{visitor:function(e,t,a,s){return r.A.isNode&&n.A.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}},1791(e,t,a){"use strict";a.d(t,{ | |
| 372 | +E9:()=>s});const n=function*(e,t){let a=e.byteLength;if(!t||a<t)return void(yield e);let n,s=0;for(;s<a;)n=s+t,yield e.slice(s,n),s=n},s=(e,t,a,s)=>{const r=async function*(e,t){for await(const a of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:a}=await t.read();if(e)break;yield a}}finally{await t.cancel()}}(e))yield*n(a,t)}(e,t);let o,i=0,l=e=>{o||(o=!0,s&&s(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await r.next();if(t)return l(),void e.close();let s=n.byteLength;if(a){let e=i+=s;a(e)}e.enqueue(new Uint8Array(n))}catch(e){throw l(e),e}},cancel:e=>(l(e),r.return())},{highWaterMark:2})}},13390(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(89888),s=a(74062);const r={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{r[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const o={};r.transitional=function(e,t,a){function r(e,t){ | |
| 373 | +return"[Axios v"+n.x+"] Transitional option '"+e+"'"+t+(a?". "+a:"")}return(a,n,i)=>{if(!1===e)throw new s.A(r(n," has been removed"+(t?" in "+t:"")),s.A.ERR_DEPRECATED);return t&&!o[n]&&(o[n]=!0,console.warn(r(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(a,n,i)}},r.spelling=function(e){return(t,a)=>(console.warn(`${a} is likely a misspelling of ${e}`),!0)};const i={assertOptions:function(e,t,a){if("object"!=typeof e)throw new s.A("options must be an object",s.A.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let r=n.length;for(;r-- >0;){const o=n[r],i=t[o];if(i){const t=e[o],a=void 0===t||i(t,o,e);if(!0!==a)throw new s.A("option "+o+" must be "+a,s.A.ERR_BAD_OPTION_VALUE);continue}if(!0!==a)throw new s.A("Unknown option "+o,s.A.ERR_BAD_OPTION)}},validators:r}},66501(e,t,a){"use strict";a.d(t,{A:()=>n});const n="undefined"!=typeof Blob?Blob:null},98556(e,t,a){"use strict";a.d(t,{A:()=>n});const n="undefined"!=typeof FormData?FormData:null}, | |
| 374 | +60139(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(95267);const s="undefined"!=typeof URLSearchParams?URLSearchParams:n.A},56847(e,t,a){"use strict";a.d(t,{A:()=>o});var n=a(60139),s=a(98556),r=a(66501);const o={isBrowser:!0,classes:{URLSearchParams:n.A,FormData:s.A,Blob:r.A},protocols:["http","https","file","blob","url","data"]}},92569(e,t,a){"use strict";a.r(t),a.d(t,{hasBrowserEnv:()=>n,hasStandardBrowserEnv:()=>r,hasStandardBrowserWebWorkerEnv:()=>o,navigator:()=>s,origin:()=>i});const n="undefined"!=typeof window&&"undefined"!=typeof document,s="object"==typeof navigator&&navigator||void 0,r=n&&(!s||["ReactNative","NativeScript","NS"].indexOf(s.product)<0),o="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,i=n&&window.location.href||"http://localhost"},63820(e,t,a){"use strict";a.d(t,{A:()=>s});var n=a(56847);const s={...a(92569),...n.A}},17275(e,t,a){"use strict";a.d(t,{A:()=>G});var n=a(12125) | |
| 375 | +;const{toString:s}=Object.prototype,{getPrototypeOf:r}=Object,{iterator:o,toStringTag:i}=Symbol,l=(c=Object.create(null),e=>{const t=s.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const d=e=>(e=e.toLowerCase(),t=>l(t)===e),u=e=>t=>typeof t===e,{isArray:m}=Array,_=u("undefined");function h(e){return null!==e&&!_(e)&&null!==e.constructor&&!_(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const p=d("ArrayBuffer"),f=u("string"),b=u("function"),g=u("number"),y=e=>null!==e&&"object"==typeof e,k=e=>{if("object"!==l(e))return!1;const t=r(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||i in e||o in e) | |
| 376 | +},v=d("Date"),x=d("File"),w=d("Blob"),M=d("FileList"),L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},j=void 0!==L.FormData?L.FormData:void 0,S=d("URLSearchParams"),[Y,D,T,C]=["ReadableStream","Request","Response","Headers"].map(d);function N(e,t,{allOwnKeys:a=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),m(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(h(e))return;const s=a?Object.getOwnPropertyNames(e):Object.keys(e),r=s.length;let o;for(n=0;n<r;n++)o=s[n],t.call(null,e[o],o,e)}}function E(e,t){if(h(e))return null;t=t.toLowerCase();const a=Object.keys(e);let n,s=a.length;for(;s-- >0;)if(n=a[s],t===n.toLowerCase())return n;return null}const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:globalThis,A=e=>!_(e)&&e!==O,P=(H="undefined"!=typeof Uint8Array&&r(Uint8Array),e=>H&&e instanceof H) | |
| 377 | +;var H;const R=d("HTMLFormElement"),I=(({hasOwnProperty:e})=>(t,a)=>e.call(t,a))(Object.prototype),F=d("RegExp"),W=(e,t)=>{const a=Object.getOwnPropertyDescriptors(e),n={};N(a,(a,s)=>{let r;!1!==(r=t(a,s,e))&&(n[s]=r||a)}),Object.defineProperties(e,n)},z=d("AsyncFunction"),U=(B="function"==typeof setImmediate,V=b(O.postMessage),B?setImmediate:V?($=`axios@${Math.random()}`,q=[],O.addEventListener("message",({source:e,data:t})=>{e===O&&t===$&&q.length&&q.shift()()},!1),e=>{q.push(e),O.postMessage($,"*")}):e=>setTimeout(e));var B,V,$,q;const J="undefined"!=typeof queueMicrotask?queueMicrotask.bind(O):"undefined"!=typeof process&&process.nextTick||U,G={isArray:m,isArrayBuffer:p,isBuffer:h,isFormData:e=>{let t;return e&&(j&&e instanceof j||b(e.append)&&("formdata"===(t=l(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t}, | |
| 378 | +isString:f,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:k,isEmptyObject:e=>{if(!y(e)||h(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Y,isRequest:D,isResponse:T,isHeaders:C,isUndefined:_,isDate:v,isFile:x,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:w,isRegExp:F,isFunction:b,isStream:e=>y(e)&&b(e.pipe),isURLSearchParams:S,isTypedArray:P,isFileList:M,forEach:N,merge:function e(){const{caseless:t,skipUndefined:a}=A(this)&&this||{},n={},s=(s,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=t&&E(n,r)||r;k(n[o])&&k(s)?n[o]=e(n[o],s):k(s)?n[o]=e({},s):m(s)?n[o]=s.slice():a&&_(s)||(n[o]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&N(arguments[e],s);return n},extend:(e,t,a,{allOwnKeys:s}={})=>(N(t,(t,s)=>{a&&b(t)?Object.defineProperty(e,s,{value:(0,n.A)(t,a),writable:!0,enumerable:!0,configurable:!0 | |
| 379 | +}):Object.defineProperty(e,s,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,a,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),a&&Object.assign(e.prototype,a)},toFlatObject:(e,t,a,n)=>{let s,o,i;const l={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],n&&!n(i,e,t)||l[i]||(t[i]=e[i],l[i]=!0);e=!1!==a&&r(e)}while(e&&(!a||a(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:d,endsWith:(e,t,a)=>{e=String(e),(void 0===a||a>e.length)&&(a=e.length),a-=t.length;const n=e.indexOf(t,a);return-1!==n&&n===a},toArray:e=>{if(!e)return null;if(m(e))return e;let t=e.length;if(!g(t))return null;const a=new Array(t) | |
| 380 | +;for(;t-- >0;)a[t]=e[t];return a},forEachEntry:(e,t)=>{const a=(e&&e[o]).call(e);let n;for(;(n=a.next())&&!n.done;){const a=n.value;t.call(e,a[0],a[1])}},matchAll:(e,t)=>{let a;const n=[];for(;null!==(a=e.exec(t));)n.push(a);return n},isHTMLForm:R,hasOwnProperty:I,hasOwnProp:I,reduceDescriptors:W,freezeMethods:e=>{W(e,(t,a)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(a))return!1;const n=e[a];b(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")}))})},toObjectSet:(e,t)=>{const a={},n=e=>{e.forEach(e=>{a[e]=!0})};return m(e)?n(e):n(String(e).split(t)),a},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,a){return t.toUpperCase()+a}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:E,global:O,isContextDefined:A,isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[i]&&e[o])},toJSONObject:e=>{const t=new Array(10),a=(e,n)=>{if(y(e)){ | |
| 381 | +if(t.indexOf(e)>=0)return;if(h(e))return e;if(!("toJSON"in e)){t[n]=e;const s=m(e)?[]:{};return N(e,(e,t)=>{const r=a(e,n+1);!_(r)&&(s[t]=r)}),t[n]=void 0,s}}return e};return a(e,0)},isAsyncFn:z,isThenable:e=>e&&(y(e)||b(e))&&b(e.then)&&b(e.catch),setImmediate:U,asap:J,isIterable:e=>null!=e&&b(e[o])}},99418(e,t,a){"use strict";const{entries:n,setPrototypeOf:s,isFrozen:r,getPrototypeOf:o,getOwnPropertyDescriptor:i}=Object;let{freeze:l,seal:c,create:d}=Object,{apply:u,construct:m}="undefined"!=typeof Reflect&&Reflect;l||(l=function(e){return e}),c||(c=function(e){return e}),u||(u=function(e,t){for(var a=arguments.length,n=new Array(a>2?a-2:0),s=2;s<a;s++)n[s-2]=arguments[s];return e.apply(t,n)}),m||(m=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];return new e(...a)}) | |
| 382 | +;const _=Y(Array.prototype.forEach),h=Y(Array.prototype.lastIndexOf),p=Y(Array.prototype.pop),f=Y(Array.prototype.push),b=Y(Array.prototype.splice),g=Y(String.prototype.toLowerCase),y=Y(String.prototype.toString),k=Y(String.prototype.match),v=Y(String.prototype.replace),x=Y(String.prototype.indexOf),w=Y(String.prototype.trim),M=Y(Object.prototype.hasOwnProperty),L=Y(RegExp.prototype.test),j=(S=TypeError,function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return m(S,t)});var S;function Y(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var a=arguments.length,n=new Array(a>1?a-1:0),s=1;s<a;s++)n[s-1]=arguments[s];return u(e,t,n)}}function D(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g;s&&s(e,null);let n=t.length;for(;n--;){let s=t[n];if("string"==typeof s){const e=a(s);e!==s&&(r(t)||(t[n]=e),s=e)}e[s]=!0}return e}function T(e){for(let t=0;t<e.length;t++)M(e,t)||(e[t]=null);return e}function C(e){const t=d(null) | |
| 383 | +;for(const[a,s]of n(e))M(e,a)&&(Array.isArray(s)?t[a]=T(s):s&&"object"==typeof s&&s.constructor===Object?t[a]=C(s):t[a]=s);return t}function N(e,t){for(;null!==e;){const a=i(e,t);if(a){if(a.get)return Y(a.get);if("function"==typeof a.value)return Y(a.value)}e=o(e)}return function(){return null}} | |
| 383 | 384 | const E=l(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),O=l(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),A=l(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),P=l(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),H=l(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),R=l(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),I=l(["#text"]),F=l(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),W=l(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),z=l(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=l(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=c(/\{\{[\w\W]*|[\w\W]*\}\}/gm),V=c(/<%[\w\W]*|[\w\W]*%>/gm),$=c(/\$\{[\w\W]*/gm),q=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),J=c(/^aria-[\-\w]+$/),G=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),K=c(/^(?:\w+script|data):/i),X=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Z=c(/^html$/i),Q=c(/^[a-z][.\w]*(-[.\w]+)+$/i) |
| 384 | 385 | ;var ee=Object.freeze({__proto__:null,ARIA_ATTR:J,ATTR_WHITESPACE:X,CUSTOM_ELEMENT:Q,DATA_ATTR:q,DOCTYPE_NAME:Z,ERB_EXPR:V,IS_ALLOWED_URI:G,IS_SCRIPT_OR_DATA:K,MUSTACHE_EXPR:B,TMPLIT_EXPR:$});const te=function(){return"undefined"==typeof window?null:window};!function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te();const a=t=>e(t);if(a.version="3.3.3",a.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return a.isSupported=!1,a;let{document:s}=t;const r=s,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:c,Node:u,Element:m,NodeFilter:S,NamedNodeMap:Y=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:T,DOMParser:B,trustedTypes:V}=t,$=m.prototype,q=N($,"cloneNode"),J=N($,"remove"),K=N($,"nextSibling"),X=N($,"childNodes"),Q=N($,"parentNode");if("function"==typeof c){const e=s.createElement("template");e.content&&e.content.ownerDocument&&(s=e.content.ownerDocument)}let ae,ne="" |
| 385 | 386 | ;const{implementation:se,createNodeIterator:re,createDocumentFragment:oe,getElementsByTagName:ie}=s,{importNode:le}=r;let ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};a.isSupported="function"==typeof n&&"function"==typeof Q&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:de,ERB_EXPR:ue,TMPLIT_EXPR:me,DATA_ATTR:_e,ARIA_ATTR:he,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:fe,CUSTOM_ELEMENT:be}=ee;let{IS_ALLOWED_URI:ge}=ee,ye=null;const ke=D({},[...E,...O,...A,...H,...I]);let ve=null;const xe=D({},[...F,...W,...z,...U]);let we=Object.seal(d(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Me=null,Le=null |
| 386 | 387 | ;const je=Object.seal(d(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Se=!0,Ye=!0,De=!1,Te=!0,Ce=!1,Ne=!0,Ee=!1,Oe=!1,Ae=!1,Pe=!1,He=!1,Re=!1,Ie=!0,Fe=!1,We=!0,ze=!1,Ue={},Be=null;const Ve=D({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const qe=D({},["audio","video","img","source","image","track"]);let Je=null;const Ge=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml";let Qe=Ze,et=!1,tt=null;const at=D({},[Ke,Xe,Ze],y);let nt=D({},["mi","mo","mn","ms","mtext"]),st=D({},["annotation-xml"]) |
| @@ -431,9 +432,9 @@ | ||
| 431 | 432 | s.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:n,replace:r,state:o,method:i=he,action:c,onSubmit:d,relative:u,preventScrollReset:_,viewTransition:h,unstable_defaultShouldRevalidate:p,...f},b)=>{let{unstable_useTransitions:g}=s.useContext(V),y=function(){let{router:e}=Ie("useSubmit"),{basename:t}=s.useContext(V),a=de("useRouteId"),n=e.fetch,r=e.navigate;return s.useCallback(async(e,s={})=>{let{action:o,method:i,encType:l,formData:c,body:d}=function(e,t){let a,n,s,r,o;if(fe(i=e)&&"form"===i.tagName.toLowerCase()){let o=e.getAttribute("action");n=o?w(o,t):null,a=e.getAttribute("method")||he,s=ye(e.getAttribute("enctype"))||pe,r=new FormData(e)}else if(function(e){return fe(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return fe(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let o=e.form;if(null==o)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>') |
| 432 | 433 | ;let i=e.getAttribute("formaction")||o.getAttribute("action");if(n=i?w(i,t):null,a=e.getAttribute("formmethod")||o.getAttribute("method")||he,s=ye(e.getAttribute("formenctype"))||ye(o.getAttribute("enctype"))||pe,r=new FormData(o,e),!function(){if(null===be)try{new FormData(document.createElement("form"),0),be=!1}catch(e){be=!0}return be}()){let{name:t,type:a,value:n}=e;if("image"===a){let e=t?`${t}.`:"";r.append(`${e}x`,"0"),r.append(`${e}y`,"0")}else t&&r.append(t,n)}}else{if(fe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=he,n=null,s=pe,o=e}var i;return r&&"text/plain"===s&&(o=r,r=void 0),{action:n,method:a.toLowerCase(),encType:s,formData:r,body:o}}(e,t);if(!1===s.navigate){let e=s.fetcherKey||`__${String(++Fe)}__`;await n(e,a,s.action||o,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:c,body:d,formMethod:s.method||i,formEncType:s.encType||l, |
| 433 | 434 | flushSync:s.flushSync})}else await r(s.action||o,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:c,body:d,formMethod:s.method||i,formEncType:s.encType||l,replace:s.replace,state:s.state,fromRouteId:a,flushSync:s.flushSync,viewTransition:s.viewTransition})},[n,r,t,a])}(),k=function(e,{relative:t}={}){let{basename:a}=s.useContext(V),n=s.useContext(q);l(n,"useFormAction must be used inside a RouteContext");let[r]=n.matches.slice(-1),o={...te(e||".",{relative:t})},i=X();if(null==e){o.search=i.search;let e=new URLSearchParams(o.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let a=e.toString();o.search=a?`?${a}`:""}}return e&&"."!==e||!r.route.index||(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),"/"!==a&&(o.pathname="/"===o.pathname?a:D([a,o.pathname])),m(o)}(c,{relative:u |
| 434 | 435 | }),v="get"===i.toLowerCase()?"get":"post",x="string"==typeof c&&He.test(c);return s.createElement("form",{ref:b,method:v,action:k,onSubmit:n?d:e=>{if(d&&d(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,l=n?.getAttribute("formmethod")||i,c=()=>y(n||e.currentTarget,{fetcherKey:t,method:l,navigate:a,replace:r,state:o,relative:u,preventScrollReset:_,viewTransition:h,unstable_defaultShouldRevalidate:p});g&&!1!==a?s.startTransition(()=>c()):c()},...f,"data-discover":x||"render"!==e?void 0:"true"})}).displayName="Form";var Fe=0}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return s[e].call(a.exports,a,a.exports,o),a.loaded=!0,a.exports}o.m=s,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(a,n){if(1&n&&(a=this(a)),8&n)return a;if("object"==typeof a&&a){if(4&n&&a.__esModule)return a |
| 435 | -;if(16&n&&"function"==typeof a.then)return a}var s=Object.create(null);o.r(s);var r={};e=e||[null,t({}),t([]),t(t)];for(var i=2&n&&a;("object"==typeof i||"function"==typeof i)&&!~e.indexOf(i);i=t(i))Object.getOwnPropertyNames(i).forEach(e=>r[e]=()=>a[e]);return r.default=()=>a,o.d(s,r),s},o.d=(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,a)=>(o.f[a](e,t),t),[])),o.u=e=>"ablocks-google-fonts.js?ver=324d36c74460f2cb90cb",o.miniCssF=e=>{},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},n="academy-blocks:",o.l=(e,t,s,r)=>{if(a[e])a[e].push(t);else{var i,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==n+s){i=u;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",o.nc&&i.setAttribute("nonce",o.nc),i.setAttribute("data-webpack",n+s),i.src=e),a[e]=[t] | |
| 436 | +;if(16&n&&"function"==typeof a.then)return a}var s=Object.create(null);o.r(s);var r={};e=e||[null,t({}),t([]),t(t)];for(var i=2&n&&a;("object"==typeof i||"function"==typeof i)&&!~e.indexOf(i);i=t(i))Object.getOwnPropertyNames(i).forEach(e=>r[e]=()=>a[e]);return r.default=()=>a,o.d(s,r),s},o.d=(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,a)=>(o.f[a](e,t),t),[])),o.u=e=>"ablocks-google-fonts.js?ver=21cea396e60f154f6c75",o.miniCssF=e=>{},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},n="academy-blocks:",o.l=(e,t,s,r)=>{if(a[e])a[e].push(t);else{var i,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==n+s){i=u;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",o.nc&&i.setAttribute("nonce",o.nc),i.setAttribute("data-webpack",n+s),i.src=e),a[e]=[t] | |
| 436 | 437 | ;var m=(t,n)=>{i.onerror=i.onload=null,clearTimeout(_);var s=a[e];if(delete a[e],i.parentNode&&i.parentNode.removeChild(i),s&&s.forEach(e=>e(n)),t)return t(n)},_=setTimeout(m.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=m.bind(null,i.onerror),i.onload=m.bind(null,i.onload),l&&document.head.appendChild(i)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var a=t.getElementsByTagName("script");if(a.length)for(var n=a.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=a[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser") |
| 437 | 438 | ;e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={945:0};o.f.j=(t,a)=>{var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)a.push(n[2]);else{var s=new Promise((a,s)=>n=e[t]=[a,s]);a.push(n[2]=s);var r=o.p+o.u(t),i=new Error;o.l(r,a=>{if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var s=a&&("load"===a.type?"missing":a.type),r=a&&a.target&&a.target.src;i.message="Loading chunk "+t+" failed.\n("+s+": "+r+")",i.name="ChunkLoadError",i.type=s,i.request=r,n[1](i)}},"chunk-"+t,t)}};var t=(t,a)=>{var n,s,[r,i,l]=a,c=0;if(r.some(t=>0!==e[t])){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);l&&l(o)}for(t&&t(a);c<r.length;c++)s=r[c],o.o(e,s)&&e[s]&&e[s][0](),e[s]=0},a=globalThis.webpackChunkacademy_blocks=globalThis.webpackChunkacademy_blocks||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})(),(()=>{"use strict";var e=o(5338);const t=window.wp.element;var a=o(51609),n=o.n(a),s=o(97099),r=o(27723),i=o(36168),l=o(78418);var c={notify(){}, |
| 438 | 439 | get:()=>[]};var d=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),u=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),m=(()=>d||u?a.useLayoutEffect:a.useEffect)();Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var _=Symbol.for("react-redux-context"),h="undefined"!=typeof globalThis?globalThis:{};function p(){if(!a.createContext)return{};const e=h[_]??=new Map;let t=e.get(a.createContext);return t||(t=a.createContext(null),e.set(a.createContext,t)),t}var f=p(),b=function(e){const{children:t,context:n,serverState:s,store:r}=e,o=a.useMemo(()=>{const e=function(e,t){let a,n=c,s=0,r=!1;function o(){d.onStateChange&&d.onStateChange()}function i(){s++,a||(a=t?t.addNestedSub(o):e.subscribe(o),n=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){ |
| 439 | 440 | const t=[];let a=e;for(;a;)t.push(a),a=a.next;return t},subscribe(a){let n=!0;const s=t={callback:a,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){n&&null!==e&&(n=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}())}function l(){s--,a&&0===s&&(a(),a=void 0,n.clear(),n=c)}const d={addNestedSub:function(e){i();const t=n.subscribe(e);let a=!1;return()=>{a||(a=!0,t(),l())}},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:o,isSubscribed:function(){return r},trySubscribe:function(){r||(r=!0,i())},tryUnsubscribe:function(){r&&(r=!1,l())},getListeners:()=>n};return d}(r);return{store:r,subscription:e,getServerState:s?()=>s:void 0}},[r,s]),i=a.useMemo(()=>r.getState(),[r]);m(()=>{const{subscription:e}=o;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),i!==r.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[o,i]);const l=n||f;return a.createElement(l.Provider,{value:o},t)};function g(e=f){ |
| @@ -662,25 +663,25 @@ | ||
| 662 | 663 | onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:f,placement:i}),a.createElement(Li,{captureEnabled:h,onTopArrive:S,onBottomArrive:Y,lockEnabled:M},function(t){return a.createElement(o,Wn({},u,{innerRef:function(a){e.getMenuListRef(a),t(a)},innerProps:{role:"listbox","aria-multiselectable":u.isMulti,id:e.getElementId("listbox")},isLoading:f,maxHeight:l,focusedOption:m}),D)}))});return w||"fixed"===x?a.createElement(i,Wn({},u,{appendTo:w,controlElement:this.controlRef,menuPlacement:v,menuPosition:x}),O):O}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,s=t.isDisabled,r=t.isMulti,o=t.name,i=t.required,l=this.state.selectValue;if(i&&!this.hasValue()&&!s)return a.createElement(Si,{name:o,onFocus:this.onValueInputFocus});if(o&&!s){if(r){if(n){var c=l.map(function(t){return e.getOptionValue(t)}).join(n);return a.createElement("input",{name:o,type:"hidden",value:c})}var d=l.length>0?l.map(function(t,n){return a.createElement("input",{ |
| 663 | 664 | key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})}):a.createElement("input",{name:o,type:"hidden",value:""});return a.createElement("div",null,d)}var u=l[0]?this.getOptionValue(l[0]):"";return a.createElement("input",{name:o,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,s=t.focusedOption,r=t.focusedValue,o=t.isFocused,i=t.selectValue,l=this.getFocusableOptions();return a.createElement(ti,Wn({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:s,focusedValue:r,isFocused:o,selectValue:i,focusableOptions:l,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,s=e.SelectContainer,r=e.ValueContainer,o=this.props,i=o.className,l=o.id,c=o.isDisabled,d=o.menuIsOpen,u=this.state.isFocused,m=this.commonProps=this.getCommonProps();return a.createElement(s,Wn({},m,{className:i,innerProps:{id:l, |
| 664 | 665 | onKeyDown:this.onKeyDown},isDisabled:c,isFocused:u}),this.renderLiveRegion(),a.createElement(t,Wn({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:u,menuIsOpen:d}),a.createElement(r,Wn({},m,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),a.createElement(n,Wn({},m,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var a=t.prevProps,n=t.clearFocusValueOnUpdate,s=t.inputIsHiddenAfterUpdate,r=t.ariaSelection,o=t.isFocused,i=t.prevWasFocused,l=t.instancePrefix,c=e.options,d=e.value,u=e.menuIsOpen,m=e.inputValue,_=e.isMulti,h=so(d),p={};if(a&&(d!==a.value||c!==a.options||u!==a.menuIsOpen||m!==a.inputValue)){var f=u?function(e,t){return Ai(Oi(e,t)) |
| 665 | 666 | }(e,h):[],b=u?Pi(Oi(e,h),"".concat(l,"-option")):[],g=n?function(e,t){var a=e.focusedValue,n=e.selectValue.indexOf(a);if(n>-1){if(t.indexOf(a)>-1)return a;if(n<t.length)return t[n]}return null}(t,h):null,y=function(e,t){var a=e.focusedOption;return a&&t.indexOf(a)>-1?a:t[0]}(t,f);p={selectValue:h,focusedOption:y,focusedOptionId:Ri(b,y),focusableOptionsWithIds:b,focusedValue:g,clearFocusValueOnUpdate:!1}}var k=null!=s&&e!==a?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},v=r,x=o&&i;return o&&!x&&(v={value:yo(_,h,h[0]||null),options:h,action:"initial-input-focus"},x=!i),"initial-input-focus"===(null==r?void 0:r.action)&&(v=null),An(An(An({},p),k),{},{prevProps:e,ariaSelection:v,prevWasFocused:x})}}]),n}(a.Component);$i.defaultProps=Ni;var qi=(0,a.forwardRef)(function(e,t){var n=function(e){ |
| 666 | -var t=e.defaultInputValue,n=void 0===t?"":t,s=e.defaultMenuIsOpen,r=void 0!==s&&s,o=e.defaultValue,i=void 0===o?null:o,l=e.inputValue,c=e.menuIsOpen,d=e.onChange,u=e.onInputChange,m=e.onMenuClose,_=e.onMenuOpen,h=e.value,p=In(e,Fn),f=Rn((0,a.useState)(void 0!==l?l:n),2),b=f[0],g=f[1],y=Rn((0,a.useState)(void 0!==c?c:r),2),k=y[0],v=y[1],x=Rn((0,a.useState)(void 0!==h?h:i),2),w=x[0],M=x[1],L=(0,a.useCallback)(function(e,t){"function"==typeof d&&d(e,t),M(e)},[d]),j=(0,a.useCallback)(function(e,t){var a;"function"==typeof u&&(a=u(e,t)),g(void 0!==a?a:e)},[u]),S=(0,a.useCallback)(function(){"function"==typeof _&&_(),v(!0)},[_]),Y=(0,a.useCallback)(function(){"function"==typeof m&&m(),v(!1)},[m]),D=void 0!==l?l:b,T=void 0!==c?c:k,C=void 0!==h?h:w;return An(An({},p),{},{inputValue:D,menuIsOpen:T,onChange:L,onInputChange:j,onMenuClose:Y,onMenuOpen:S,value:C})}(e);return a.createElement($i,Wn({ref:t},n))}),Ji=qi;const Gi=({field:e,form:t,...a})=>(0,S.jsx)("div",{children:(0,S.jsx)(Ji,{...a}) | |
| 667 | -}),Ki={title:Aa().string,subtitle:Aa().string,desc:Aa().string,name:Aa().string,placeholder:Aa().string,options:Aa().array};function Xi({title:e,name:t,subtitle:a,desc:n,options:s,placeholder:r}){const{values:o,setFieldValue:i}=ta(),l=t;return(0,S.jsxs)("div",{className:"form-group",children:[(0,S.jsxs)("div",{className:"form-info",children:[(0,S.jsx)("label",{htmlFor:l,children:e}),a&&(0,S.jsx)("span",{className:"sub-title",children:a})]}),(0,S.jsxs)("div",{className:"form-body",children:[(0,S.jsx)(ka,{id:l,name:t,className:"academy-select",classNamePrefix:"academy-react-select",placeholder:r,component:Gi,value:s.filter(e=>e.value===o[t]),options:s,onChange:e=>i(t,e.value)}),n&&(0,S.jsx)("span",{className:"desc",children:n})]})]})}Xi.propTypes=Ki;const Zi={border:"none",background:"var(--abpm-btn-bg, #f3f4f6)",borderRadius:6,width:30,height:30,cursor:"pointer",fontSize:14,flex:"none"},Qi={height:34,padding:"0 8px",borderRadius:6,border:"1px solid var(--abpm-border, #dcdfe6)", | |
| 668 | -boxSizing:"border-box"},el=({value:e=[],onChange:t})=>{const a=Array.isArray(e)?e:[],n=(e,n,s)=>t(a.map((t,a)=>a===e?{...t,[n]:s}:t)),s=(e,n)=>{const s=e+n;if(s<0||s>=a.length)return;const r=[...a];[r[e],r[s]]=[r[s],r[e]],t(r)};return(0,S.jsxs)("div",{className:"ablocks-bpm",children:[(0,S.jsxs)("div",{className:"ablocks-bpm__head",style:{display:"flex",gap:8,marginBottom:6,fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",color:"var(--abpm-muted, #6b7280)"},children:[(0,S.jsx)("span",{style:{flex:1},children:(0,r.__)("Label","ablocks")}),(0,S.jsx)("span",{style:{width:90},children:(0,r.__)("Min","ablocks")}),(0,S.jsx)("span",{style:{width:90},children:(0,r.__)("Max","ablocks")}),(0,S.jsx)("span",{style:{width:98}})]}),0===a.length&&(0,S.jsx)("p",{style:{margin:"0 0 8px",color:"var(--abpm-muted, #6b7280)",fontSize:13},children:(0,r.__)("No custom breakpoints yet.","ablocks")}),a.map((e,o)=>{return(0,S.jsxs)("div",{className:"ablocks-bpm__row",style:{ | |
| 669 | -display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,S.jsx)("input",{type:"text",placeholder:(0,r.__)("e.g. Laptop","ablocks"),value:e.label||"",onChange:e=>n(o,"label",e.target.value),style:{...Qi,flex:1}}),(0,S.jsx)("input",{type:"number",placeholder:"–",value:e.minWidth??"",onChange:e=>n(o,"minWidth",e.target.value),style:{...Qi,width:90}}),(0,S.jsx)("input",{type:"number",placeholder:"–",value:(i=e,void 0!==i.maxWidth&&""!==i.maxWidth?i.maxWidth:i.width??""),onChange:e=>n(o,"maxWidth",e.target.value),style:{...Qi,width:90}}),(0,S.jsx)("button",{type:"button",title:(0,r.__)("Move up","ablocks"),disabled:0===o,onClick:()=>s(o,-1),style:{...Zi,opacity:0===o?.4:1},children:"↑"}),(0,S.jsx)("button",{type:"button",title:(0,r.__)("Move down","ablocks"),disabled:o===a.length-1,onClick:()=>s(o,1),style:{...Zi,opacity:o===a.length-1?.4:1},children:"↓"}),(0,S.jsx)("button",{type:"button",title:(0,r.__)("Remove","ablocks"),onClick:()=>(e=>t(a.filter((t,a)=>a!==e)))(o),style:{ | |
| 670 | -...Zi,color:"#ef4444"},children:"×"})]},e.key||o);var i}),(0,S.jsx)("button",{type:"button",onClick:()=>t([...a,{key:"k"+Math.random().toString(36).slice(2,8),label:"",minWidth:"",maxWidth:""}]),style:{border:"1px dashed var(--abpm-border, #c7cbd6)",background:"transparent",borderRadius:8,padding:"8px 14px",cursor:"pointer",fontWeight:600,color:"var(--abpm-accent, #4f46e5)"},children:(0,r.__)("+ Add breakpoint","ablocks")}),(0,S.jsx)("p",{style:{margin:"8px 0 0",color:"var(--abpm-muted, #6b7280)",fontSize:12},children:(0,r.__)("Set a min and/or max width. Order controls the cascade (top = widest).","ablocks")})]})},tl=[{value:"cascade",label:(0,r.__)("Cascade — larger sizes flow down","ablocks")},{value:"strict",label:(0,r.__)("Strict — each breakpoint stands alone","ablocks")}],al=()=>{const{values:e,setFieldValue:t}=ta();return(0,S.jsx)(el,{value:e.breakpoint_custom||[],onChange:e=>t("breakpoint_custom",e)})},nl=()=>{const{values:e}=ta();return(0,S.jsxs)("div",{ | |
| 671 | -className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Editor Options","ablocks")}),(0,S.jsx)(Sn,{name:"default_container_width",title:(0,r.__)("Container Width","ablocks"),subtitle:(0,r.__)("Set a default container width to ensure consistent layout and design.","ablocks"),unit:"px"}),(0,S.jsx)(Sn,{name:"container_padding",title:(0,r.__)("Container Padding","ablocks"),subtitle:(0,r.__)("Define the default padding for containers.","ablocks"),unit:"px"}),(0,S.jsx)(Dn,{name:"enabled_block_copy_paste_style",title:(0,r.__)("Copy & Paste Block Styles","ablocks"),subtitle:(0,r.__)("Duplicate your block designs on same blocks across websites. (Works only on blocks from aBlocks).","ablocks"),isPro:!1}),(0,S.jsx)("h3",{className:"ablocks-general-content__heading ablocks-general-content__heading--sub",children:(0,r.__)("Design System","ablocks")}),(0,S.jsx)(Dn,{name:"lock_global_typography",title:(0, | |
| 672 | -r.__)("Lock the typeface","ablocks"),subtitle:(0,r.__)("Authors can no longer pick a font family — only a global typography preset (the globe button). Size, line height, spacing and weight stay editable, because adjusting those is normal design work. A block that sets only a size declares no family at all, so it inherits your global body typeface.","ablocks"),isPro:!1}),e.lock_global_typography&&(0,S.jsx)(Dn,{name:"lock_global_typography_strict",title:(0,r.__)("…and lock size, spacing and weight too","ablocks"),subtitle:(0,r.__)("Shuts the custom typography popover completely, so a global preset is the only way to style type. Choose this only if your presets already cover every size you need — otherwise authors will have no way to make a heading smaller.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"lock_global_colors",title:(0,r.__)("Lock colors to the global palette","ablocks"),subtitle:(0, | |
| 673 | -r.__)("Turns off the custom color and gradient picker everywhere in the editor. Authors can only apply a global color (the globe button). Existing custom colors are left alone — the audit below lists them.","ablocks"),isPro:!1}),(0,S.jsx)(Tn,{}),(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Pasting from Google Docs","ablocks")}),(0,S.jsx)(Dn,{name:"paste_google_docs",title:(0,r.__)("Convert pasted documents to aBlocks blocks","ablocks"),subtitle:(0,r.__)("Paste a Google Doc and its headings, paragraphs, lists, tables and images become aBlocks blocks instead of core blocks. Pastes from anywhere else are left alone.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"paste_convert_webp",title:(0,r.__)("Import pasted images as WebP","ablocks"),subtitle:(0, | |
| 674 | -r.__)("Images in a pasted document are added to the media library as WebP. Charts, diagrams and screenshots are stored losslessly — identical to the original at a fraction of the size — and photographs use the quality below. An image that would come out larger as WebP keeps its original format.","ablocks"),isPro:!1}),(0,S.jsx)(Sn,{name:"paste_webp_quality",title:(0,r.__)("WebP Quality","ablocks"),subtitle:(0,r.__)("Quality for pasted photographs, 1–100. Charts, diagrams and screenshots ignore this — they are stored losslessly, which is both smaller and exact.","ablocks")}),(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Responsive Breakpoints","ablocks")}),(0,S.jsx)(Sn,{name:"breakpoint_tablet",title:(0,r.__)("Tablet Breakpoint","ablocks"),subtitle:(0,r.__)("Max screen width (px) at which tablet styles apply. Used by every block’s responsive controls.","ablocks"),unit:"px"}),(0,S.jsx)(Sn,{name:"breakpoint_mobile",title:(0, | |
| 675 | -r.__)("Mobile Breakpoint","ablocks"),subtitle:(0,r.__)("Max screen width (px) at which mobile styles apply. Must be smaller than the tablet breakpoint.","ablocks"),unit:"px"}),(0,S.jsx)(Xi,{name:"breakpoint_mode",title:(0,r.__)("Breakpoint Behaviour","ablocks"),subtitle:(0,r.__)("Cascade: a value set on Tablet also applies on Mobile unless Mobile overrides it — set it once and it flows down. Strict: each breakpoint applies only within its own range, matching WordPress core and block themes.","ablocks"),options:tl}),(0,S.jsxs)("div",{style:{marginTop:"8px"},children:[(0,S.jsx)("strong",{children:(0,r.__)("Custom Breakpoints","ablocks")}),(0,S.jsx)("p",{style:{margin:"4px 0 12px",color:"#6b7280"},children:(0,r.__)("Register extra breakpoints. They appear in the block device switcher and generate their own responsive styles.","ablocks")}),(0,S.jsx)(al,{})]})]})},sl=()=>{const{values:e}=ta(),t=w();return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{ | |
| 676 | -className:"ablocks-general-content__heading",children:(0,r.__)("Asset Generation","ablocks")}),(0,S.jsx)(Dn,{name:"enabled_assets_file_generation",title:(0,r.__)("Enable asset file generation","ablocks"),subtitle:(0,r.__)("Turn on this option to enable asset file generation.","ablocks"),isPro:!1}),e.enabled_assets_file_generation&&(0,S.jsxs)("div",{className:"ablocks-column-items form-group",children:[(0,S.jsx)("div",{className:"ablocks-label-tooltip",children:(0,S.jsx)("div",{className:"ablocks-title-subtitle",children:(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"regenerate_assets",children:(0,r.__)("Regenerate Assets","ablocks")})})}),(0,S.jsx)("div",{className:"ablocks-input-desc",children:(0,S.jsx)(Ja,{type:"button",preset:"purple",label:(0,r.__)("Regenerate Assets","ablocks"),onClick:()=>{(0,i.In)({action:"ablocks/regenerate_assets"}).then(()=>{t(wt({message:(0,r.__)("Assets Successfully Regenerated!","ablocks"),isShow:!0,type:"success"}))})}})})]})]}) | |
| 677 | -},rl=e=>Array.isArray(e)?e.join(", "):e||"",ol=e=>String(e||"").split(",").map(e=>e.trim()).filter(Boolean);let il=null;const ll={enabled_assets_file_generation:!0,perf_inline_css:!0,perf_defer_js:!0,perf_lazy_images:!0,perf_image_dimensions:!0,perf_responsive_images:!0,perf_preload_lcp:!0,perf_touch_targets:!0,perf_disable_emojis:!0,perf_disable_embeds:!0,perf_disable_dashicons:!0,perf_disable_jquery_migrate:!0},cl="ablocks_perf_recommendation_dismissed",dl=[{name:"caching",title:(0,r.__)("Caching","ablocks"),component:()=>{const{values:e,setFieldValue:t}=ta(),n=w(),[s,o]=(0,a.useState)(null),[l,c]=(0,a.useState)(!1),d=()=>(0,i.In)({action:"ablocks/page_cache_status"}).then(e=>o(e?.data?.data||null)).catch(()=>o(null));return(0,a.useEffect)(()=>{d()},[]),(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsxs)("div",{className:"ablocks-cache-status",children:[(0,S.jsx)("span",{children:s?(0, | |
| 678 | -r.sprintf)(/* translators: 1: number of cached pages, 2: disk size, 3: number of stylesheets */ /* translators: 1: number of cached pages, 2: disk size, 3: number of stylesheets */ | |
| 667 | +var t=e.defaultInputValue,n=void 0===t?"":t,s=e.defaultMenuIsOpen,r=void 0!==s&&s,o=e.defaultValue,i=void 0===o?null:o,l=e.inputValue,c=e.menuIsOpen,d=e.onChange,u=e.onInputChange,m=e.onMenuClose,_=e.onMenuOpen,h=e.value,p=In(e,Fn),f=Rn((0,a.useState)(void 0!==l?l:n),2),b=f[0],g=f[1],y=Rn((0,a.useState)(void 0!==c?c:r),2),k=y[0],v=y[1],x=Rn((0,a.useState)(void 0!==h?h:i),2),w=x[0],M=x[1],L=(0,a.useCallback)(function(e,t){"function"==typeof d&&d(e,t),M(e)},[d]),j=(0,a.useCallback)(function(e,t){var a;"function"==typeof u&&(a=u(e,t)),g(void 0!==a?a:e)},[u]),S=(0,a.useCallback)(function(){"function"==typeof _&&_(),v(!0)},[_]),Y=(0,a.useCallback)(function(){"function"==typeof m&&m(),v(!1)},[m]),D=void 0!==l?l:b,T=void 0!==c?c:k,C=void 0!==h?h:w;return An(An({},p),{},{inputValue:D,menuIsOpen:T,onChange:L,onInputChange:j,onMenuClose:Y,onMenuOpen:S,value:C})}(e);return a.createElement($i,Wn({ref:t},n))}),Ji=qi;const Gi=()=>({placeholder:(0,r.__)("Select…","ablocks"),loadingMessage:()=>(0, | |
| 668 | +r.__)("Loading…","ablocks"),noOptionsMessage:()=>(0,r.__)("No options","ablocks")}),Ki=({field:e,form:t,...a})=>{const n=Gi();return(0,S.jsx)("div",{children:(0,S.jsx)(Ji,{...n,...a,placeholder:a.placeholder??n.placeholder})})},Xi={title:Aa().string,subtitle:Aa().string,desc:Aa().string,name:Aa().string,placeholder:Aa().string,options:Aa().array};function Zi({title:e,name:t,subtitle:a,desc:n,options:s,placeholder:r}){const{values:o,setFieldValue:i}=ta(),l=t;return(0,S.jsxs)("div",{className:"form-group",children:[(0,S.jsxs)("div",{className:"form-info",children:[(0,S.jsx)("label",{htmlFor:l,children:e}),a&&(0,S.jsx)("span",{className:"sub-title",children:a})]}),(0,S.jsxs)("div",{className:"form-body",children:[(0,S.jsx)(ka,{id:l,name:t,className:"academy-select",classNamePrefix:"academy-react-select",placeholder:r,component:Ki,value:s.filter(e=>e.value===o[t]),options:s,onChange:e=>i(t,e.value)}),n&&(0,S.jsx)("span",{className:"desc",children:n})]})]})}Zi.propTypes=Xi;const Qi={ | |
| 669 | +border:"none",background:"var(--abpm-btn-bg, #f3f4f6)",borderRadius:6,width:30,height:30,cursor:"pointer",fontSize:14,flex:"none"},el={height:34,padding:"0 8px",borderRadius:6,border:"1px solid var(--abpm-border, #dcdfe6)",boxSizing:"border-box"},tl=({value:e=[],onChange:t})=>{const a=Array.isArray(e)?e:[],n=(e,n,s)=>t(a.map((t,a)=>a===e?{...t,[n]:s}:t)),s=(e,n)=>{const s=e+n;if(s<0||s>=a.length)return;const r=[...a];[r[e],r[s]]=[r[s],r[e]],t(r)};return(0,S.jsxs)("div",{className:"ablocks-bpm",children:[(0,S.jsxs)("div",{className:"ablocks-bpm__head",style:{display:"flex",gap:8,marginBottom:6,fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",color:"var(--abpm-muted, #6b7280)"},children:[(0,S.jsx)("span",{style:{flex:1},children:(0,r.__)("Label","ablocks")}),(0,S.jsx)("span",{style:{width:90},children:(0,r.__)("Min","ablocks")}),(0,S.jsx)("span",{style:{width:90},children:(0,r.__)("Max","ablocks")}),(0,S.jsx)("span",{style:{width:98}})]}),0===a.length&&(0, | |
| 670 | +S.jsx)("p",{style:{margin:"0 0 8px",color:"var(--abpm-muted, #6b7280)",fontSize:13},children:(0,r.__)("No custom breakpoints yet.","ablocks")}),a.map((e,o)=>{return(0,S.jsxs)("div",{className:"ablocks-bpm__row",style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,S.jsx)("input",{type:"text",placeholder:(0,r.__)("e.g. Laptop","ablocks"),value:e.label||"",onChange:e=>n(o,"label",e.target.value),style:{...el,flex:1}}),(0,S.jsx)("input",{type:"number",placeholder:"–",value:e.minWidth??"",onChange:e=>n(o,"minWidth",e.target.value),style:{...el,width:90}}),(0,S.jsx)("input",{type:"number",placeholder:"–",value:(i=e,void 0!==i.maxWidth&&""!==i.maxWidth?i.maxWidth:i.width??""),onChange:e=>n(o,"maxWidth",e.target.value),style:{...el,width:90}}),(0,S.jsx)("button",{type:"button",title:(0,r.__)("Move up","ablocks"),disabled:0===o,onClick:()=>s(o,-1),style:{...Qi,opacity:0===o?.4:1},children:"↑"}),(0,S.jsx)("button",{type:"button",title:(0,r.__)("Move down","ablocks"), | |
| 671 | +disabled:o===a.length-1,onClick:()=>s(o,1),style:{...Qi,opacity:o===a.length-1?.4:1},children:"↓"}),(0,S.jsx)("button",{type:"button",title:(0,r.__)("Remove","ablocks"),onClick:()=>(e=>t(a.filter((t,a)=>a!==e)))(o),style:{...Qi,color:"#ef4444"},children:"×"})]},e.key||o);var i}),(0,S.jsx)("button",{type:"button",onClick:()=>t([...a,{key:"k"+Math.random().toString(36).slice(2,8),label:"",minWidth:"",maxWidth:""}]),style:{border:"1px dashed var(--abpm-border, #c7cbd6)",background:"transparent",borderRadius:8,padding:"8px 14px",cursor:"pointer",fontWeight:600,color:"var(--abpm-accent, #4f46e5)"},children:(0,r.__)("+ Add breakpoint","ablocks")}),(0,S.jsx)("p",{style:{margin:"8px 0 0",color:"var(--abpm-muted, #6b7280)",fontSize:12},children:(0,r.__)("Set a min and/or max width. Order controls the cascade (top = widest).","ablocks")})]})},al=[{value:"cascade",label:(0,r.__)("Cascade — larger sizes flow down","ablocks")},{value:"strict",label:(0, | |
| 672 | +r.__)("Strict — each breakpoint stands alone","ablocks")}],nl=()=>{const{values:e,setFieldValue:t}=ta();return(0,S.jsx)(tl,{value:e.breakpoint_custom||[],onChange:e=>t("breakpoint_custom",e)})},sl=()=>{const{values:e}=ta();return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Editor Options","ablocks")}),(0,S.jsx)(Sn,{name:"default_container_width",title:(0,r.__)("Container Width","ablocks"),subtitle:(0,r.__)("Set a default container width to ensure consistent layout and design.","ablocks"),unit:"px"}),(0,S.jsx)(Sn,{name:"container_padding",title:(0,r.__)("Container Padding","ablocks"),subtitle:(0,r.__)("Define the default padding for containers.","ablocks"),unit:"px"}),(0,S.jsx)(Dn,{name:"enabled_block_copy_paste_style",title:(0,r.__)("Copy & Paste Block Styles","ablocks"),subtitle:(0, | |
| 673 | +r.__)("Duplicate your block designs on same blocks across websites. (Works only on blocks from aBlocks).","ablocks"),isPro:!1}),(0,S.jsx)("h3",{className:"ablocks-general-content__heading ablocks-general-content__heading--sub",children:(0,r.__)("Design System","ablocks")}),(0,S.jsx)(Dn,{name:"lock_global_typography",title:(0,r.__)("Lock the typeface","ablocks"),subtitle:(0,r.__)("Authors can no longer pick a font family — only a global typography preset (the globe button). Size, line height, spacing and weight stay editable, because adjusting those is normal design work. A block that sets only a size declares no family at all, so it inherits your global body typeface.","ablocks"),isPro:!1}),e.lock_global_typography&&(0,S.jsx)(Dn,{name:"lock_global_typography_strict",title:(0,r.__)("…and lock size, spacing and weight too","ablocks"),subtitle:(0, | |
| 674 | +r.__)("Shuts the custom typography popover completely, so a global preset is the only way to style type. Choose this only if your presets already cover every size you need — otherwise authors will have no way to make a heading smaller.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"lock_global_colors",title:(0,r.__)("Lock colors to the global palette","ablocks"),subtitle:(0,r.__)("Turns off the custom color and gradient picker everywhere in the editor. Authors can only apply a global color (the globe button). Existing custom colors are left alone — the audit below lists them.","ablocks"),isPro:!1}),(0,S.jsx)(Tn,{}),(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Pasting from Google Docs","ablocks")}),(0,S.jsx)(Dn,{name:"paste_google_docs",title:(0,r.__)("Convert pasted documents to aBlocks blocks","ablocks"),subtitle:(0, | |
| 675 | +r.__)("Paste a Google Doc and its headings, paragraphs, lists, tables and images become aBlocks blocks instead of core blocks. Pastes from anywhere else are left alone.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"paste_convert_webp",title:(0,r.__)("Import pasted images as WebP","ablocks"),subtitle:(0,r.__)("Images in a pasted document are added to the media library as WebP. Charts, diagrams and screenshots are stored losslessly — identical to the original at a fraction of the size — and photographs use the quality below. An image that would come out larger as WebP keeps its original format.","ablocks"),isPro:!1}),(0,S.jsx)(Sn,{name:"paste_webp_quality",title:(0,r.__)("WebP Quality","ablocks"),subtitle:(0,r.__)("Quality for pasted photographs, 1–100. Charts, diagrams and screenshots ignore this — they are stored losslessly, which is both smaller and exact.","ablocks")}),(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Responsive Breakpoints","ablocks") | |
| 676 | +}),(0,S.jsx)(Sn,{name:"breakpoint_tablet",title:(0,r.__)("Tablet Breakpoint","ablocks"),subtitle:(0,r.__)("Max screen width (px) at which tablet styles apply. Used by every block’s responsive controls.","ablocks"),unit:"px"}),(0,S.jsx)(Sn,{name:"breakpoint_mobile",title:(0,r.__)("Mobile Breakpoint","ablocks"),subtitle:(0,r.__)("Max screen width (px) at which mobile styles apply. Must be smaller than the tablet breakpoint.","ablocks"),unit:"px"}),(0,S.jsx)(Zi,{name:"breakpoint_mode",title:(0,r.__)("Breakpoint Behaviour","ablocks"),subtitle:(0,r.__)("Cascade: a value set on Tablet also applies on Mobile unless Mobile overrides it — set it once and it flows down. Strict: each breakpoint applies only within its own range, matching WordPress core and block themes.","ablocks"),options:al}),(0,S.jsxs)("div",{style:{marginTop:"8px"},children:[(0,S.jsx)("strong",{children:(0,r.__)("Custom Breakpoints","ablocks")}),(0,S.jsx)("p",{style:{margin:"4px 0 12px",color:"#6b7280"},children:(0, | |
| 677 | +r.__)("Register extra breakpoints. They appear in the block device switcher and generate their own responsive styles.","ablocks")}),(0,S.jsx)(nl,{})]})]})},rl=()=>{const{values:e}=ta(),t=w();return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Asset Generation","ablocks")}),(0,S.jsx)(Dn,{name:"enabled_assets_file_generation",title:(0,r.__)("Enable asset file generation","ablocks"),subtitle:(0,r.__)("Turn on this option to enable asset file generation.","ablocks"),isPro:!1}),e.enabled_assets_file_generation&&(0,S.jsxs)("div",{className:"ablocks-column-items form-group",children:[(0,S.jsx)("div",{className:"ablocks-label-tooltip",children:(0,S.jsx)("div",{className:"ablocks-title-subtitle",children:(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"regenerate_assets",children:(0,r.__)("Regenerate Assets","ablocks")})})}),(0,S.jsx)("div",{className:"ablocks-input-desc",children:(0, | |
| 678 | +S.jsx)(Ja,{type:"button",preset:"purple",label:(0,r.__)("Regenerate Assets","ablocks"),onClick:()=>{(0,i.In)({action:"ablocks/regenerate_assets"}).then(()=>{t(wt({message:(0,r.__)("Assets Successfully Regenerated!","ablocks"),isShow:!0,type:"success"}))})}})})]})]})},ol=e=>Array.isArray(e)?e.join(", "):e||"",il=e=>String(e||"").split(",").map(e=>e.trim()).filter(Boolean);let ll=null;const cl={enabled_assets_file_generation:!0,perf_inline_css:!0,perf_defer_js:!0,perf_lazy_images:!0,perf_image_dimensions:!0,perf_responsive_images:!0,perf_preload_lcp:!0,perf_touch_targets:!0,perf_disable_emojis:!0,perf_disable_embeds:!0,perf_disable_dashicons:!0,perf_disable_jquery_migrate:!0},dl="ablocks_perf_recommendation_dismissed",ul=[{name:"caching",title:(0,r.__)("Caching","ablocks"),component:()=>{const{values:e,setFieldValue:t}=ta(),n=w(),[s,o]=(0,a.useState)(null),[l,c]=(0,a.useState)(!1),d=()=>(0,i.In)({action:"ablocks/page_cache_status"}).then(e=>o(e?.data?.data||null)).catch(()=>o(null)) | |
| 679 | +;return(0,a.useEffect)(()=>{d()},[]),(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsxs)("div",{className:"ablocks-cache-status",children:[(0,S.jsx)("span",{children:s?(0,r.sprintf)(/* translators: 1: number of cached pages, 2: disk size, 3: number of stylesheets */ /* translators: 1: number of cached pages, 2: disk size, 3: number of stylesheets */ | |
| 679 | 680 | (0,r.__)("%1$s pages cached · %2$s on disk · %3$s consolidated stylesheets","ablocks"),s.pages??0,s.size||"0 B",s.css_files??0):(0,r.__)("Reading cache status…","ablocks")}),(0,S.jsx)(Ja,{type:"button",preset:"purple",label:l?(0,r.__)("Purging…","ablocks"):(0,r.__)("Purge cache","ablocks"),onClick:()=>{l||(c(!0),(0,i.In)({action:"ablocks/purge_page_cache"}).then(e=>(n(wt({message:(0,r.sprintf)(/* translators: %d: number of files removed */ /* translators: %d: number of files removed */ |
| 680 | 681 | (0,r.__)("Cache purged (%d files removed).","ablocks"),e?.data?.data?.removed??0),isShow:!0,type:"success"})),d())).catch(()=>{n(wt({message:(0,r.__)("Could not purge the cache.","ablocks"),isShow:!0,type:"error"}))}).finally(()=>c(!1)))}})]}),(0,S.jsx)(Dn,{name:"perf_page_cache",title:(0,r.__)("Full-page cache","ablocks"),subtitle:(0,r.__)("Save each rendered page to disk so repeat visitors are served a finished HTML file instead of re-running WordPress, block parsing and theme rendering. Logged-in visitors, carts, previews, searches and password-protected pages are never cached.","ablocks"),isPro:!1}),e.perf_page_cache&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"ablocks-d-flex ablocks-cache-row",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"perf_page_cache_scope",children:(0,r.__)("Cache which pages","ablocks")}),(0,S.jsxs)("select",{id:"perf_page_cache_scope",className:"ablocks-input",value:e.perf_page_cache_scope??"all", |
| 681 | 682 | onChange:e=>t("perf_page_cache_scope",e.target.value),children:[(0,S.jsx)("option",{value:"all",children:(0,r.__)("All public pages","ablocks")}),(0,S.jsx)("option",{value:"ablocks_only",children:(0,r.__)("Only pages built with aBlocks","ablocks")})]})]}),(0,S.jsxs)("div",{className:"ablocks-d-flex ablocks-cache-row",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"perf_page_cache_ttl",children:(0,r.__)("Expire after (hours, 0 = never)","ablocks")}),(0,S.jsx)("input",{id:"perf_page_cache_ttl",type:"number",min:0,className:"ablocks-input",value:e.perf_page_cache_ttl??0,onChange:e=>t("perf_page_cache_ttl",parseInt(e.target.value,10)||0)})]}),(0,S.jsxs)("div",{className:"ablocks-d-flex ablocks-cache-row",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"perf_page_cache_query_args",children:(0,r.__)("Allowed query parameters","ablocks")}),(0,S.jsx)("input",{id:"perf_page_cache_query_args",type:"text",className:"ablocks-input",placeholder:(0, |
| 682 | -r.__)("e.g. lang, currency","ablocks"),value:rl(e.perf_page_cache_query_args),onChange:e=>t("perf_page_cache_query_args",ol(e.target.value))})]}),(0,S.jsx)("p",{className:"ablocks-field-help",children:(0,r.__)("Any URL carrying a parameter not listed here is served fresh and never cached. Leave empty unless a parameter genuinely changes the page — this is what stops ?utm_source=… from overwriting the cached copy of a page.","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-d-flex ablocks-cache-row",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"perf_page_cache_exclusions",children:(0,r.__)("Never cache these URLs","ablocks")}),(0,S.jsx)("input",{id:"perf_page_cache_exclusions",type:"text",className:"ablocks-input",placeholder:(0,r.__)("e.g. /account/*, /cart","ablocks"),value:rl(e.perf_page_cache_exclusions),onChange:e=>t("perf_page_cache_exclusions",ol(e.target.value))})]}),(0,S.jsx)(Dn,{name:"perf_page_cache_prewarm",title:(0, | |
| 683 | +r.__)("e.g. lang, currency","ablocks"),value:ol(e.perf_page_cache_query_args),onChange:e=>t("perf_page_cache_query_args",il(e.target.value))})]}),(0,S.jsx)("p",{className:"ablocks-field-help",children:(0,r.__)("Any URL carrying a parameter not listed here is served fresh and never cached. Leave empty unless a parameter genuinely changes the page — this is what stops ?utm_source=… from overwriting the cached copy of a page.","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-d-flex ablocks-cache-row",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"perf_page_cache_exclusions",children:(0,r.__)("Never cache these URLs","ablocks")}),(0,S.jsx)("input",{id:"perf_page_cache_exclusions",type:"text",className:"ablocks-input",placeholder:(0,r.__)("e.g. /account/*, /cart","ablocks"),value:ol(e.perf_page_cache_exclusions),onChange:e=>t("perf_page_cache_exclusions",il(e.target.value))})]}),(0,S.jsx)(Dn,{name:"perf_page_cache_prewarm",title:(0, | |
| 683 | 684 | r.__)("Rebuild pages after saving","ablocks"),subtitle:(0,r.__)("After a page is edited, rebuild its cached copy in the background so the next visitor does not pay for the render.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"perf_page_cache_gzip",title:(0,r.__)("Store compressed copies","ablocks"),subtitle:(0,r.__)("Write a gzipped copy alongside each cached page. Costs a little disk, and lets the web server send the compressed file directly.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"perf_page_cache_mobile_variant",title:(0,r.__)("Separate mobile cache","ablocks"),subtitle:(0,r.__)("Keep a second copy of every page for mobile visitors. Only needed if your theme sends different HTML to phones — responsive CSS does not, so leave this off unless you know otherwise.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"perf_page_cache_crawler",title:(0,r.__)("Cache pages in the background","ablocks"),subtitle:(0, |
| 684 | 685 | r.__)("Every hour, quietly build cached copies of pages nobody has visited yet, a few at a time. Without this a page is only cached once someone waits for it. Pages that can never be cached, like cart and account pages, are dropped after a few tries rather than retried forever.","ablocks"),isPro:!1}),e.perf_page_cache_crawler&&(0,S.jsxs)("div",{className:"ablocks-d-flex ablocks-cache-row",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"perf_page_cache_crawl_batch",children:(0,r.__)("Pages per hour","ablocks")}),(0,S.jsx)("input",{id:"perf_page_cache_crawl_batch",type:"number",min:1,max:200,className:"ablocks-input",value:e.perf_page_cache_crawl_batch??20,onChange:e=>t("perf_page_cache_crawl_batch",parseInt(e.target.value,10)||1)})]})]}),(0,S.jsx)(Dn,{name:"perf_consolidate_css",title:(0,r.__)("Move inline CSS into cached files","ablocks"),subtitle:(0, |
| 685 | 686 | r.__)("Block themes print tens of kilobytes of CSS into every page, which the browser cannot reuse between pages. This moves it into files it can cache once and share across your whole site — measured at 110KB down to 69KB per page on Twenty Twenty-Four.","ablocks"),isPro:!1}),e.perf_consolidate_css&&(0,S.jsxs)("div",{className:"ablocks-d-flex ablocks-cache-row",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"perf_consolidate_css_min",children:(0,r.__)("Keep CSS inline below (bytes)","ablocks")}),(0,S.jsx)("input",{id:"perf_consolidate_css_min",type:"number",min:0,step:256,className:"ablocks-input",value:e.perf_consolidate_css_min??2048,onChange:e=>t("perf_consolidate_css_min",parseInt(e.target.value,10)||0)})]}),(0,S.jsx)(Dn,{name:"perf_fragment_cache",title:(0,r.__)("Cache header and footer","ablocks"),subtitle:(0, |
| 686 | 687 | r.__)("Reuse the rendered header and footer instead of rebuilding them on every request. Unlike the page cache this also helps logged-in visitors and first-time views. Only logged-out output is shared.","ablocks"),isPro:!1}),e.perf_fragment_cache&&(0,S.jsxs)("div",{className:"ablocks-d-flex ablocks-cache-row",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"perf_fragment_cache_ttl",children:(0,r.__)("Expire after (seconds)","ablocks")}),(0,S.jsx)("input",{id:"perf_fragment_cache_ttl",type:"number",min:60,step:600,className:"ablocks-input",value:e.perf_fragment_cache_ttl??43200,onChange:e=>t("perf_fragment_cache_ttl",parseInt(e.target.value,10)||60)})]}),(0,S.jsx)(Dn,{name:"perf_template_cache",title:(0,r.__)("Cache template lookups","ablocks"),subtitle:(0,r.__)("Remember which block template each URL uses, instead of scanning the theme and querying the database every request.","ablocks"),isPro:!1}),s&&!s.object_cache&&(0,S.jsx)("p",{ |
| @@ -693,223 +694,223 @@ | ||
| 693 | 694 | r.__)("Alt text cannot be demanded while a file is uploading — WordPress only creates the field to type it into once the upload has finished. So this stops the image being used instead, which reaches the same result without throwing away a file someone just waited to upload.","ablocks")}),(0,S.jsxs)("p",{className:"ablocks-field-help",children:[(0,r.__)("To compress the images already in your library, or to review media that nothing appears to use, open the Site Scanner.","ablocks")," ",(0,S.jsx)(s.N_,{to:`${i.Y3}admin.php?page=ablocks-scanner`,children:(0,r.__)("Open image tools","ablocks")})]})]})}},{name:"assets",title:(0,r.__)("Assets","ablocks"),component:()=>{const{values:e,setFieldValue:t}=ta(),a=w();return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)(Dn,{name:"enabled_assets_file_generation",title:(0,r.__)("Enable asset file generation","ablocks"),subtitle:(0, |
| 694 | 695 | r.__)("Combine each block's CSS/JS into a single per-page file (inlined when small) instead of loading a separate render-blocking stylesheet per block. Recommended once your site is built.","ablocks"),isPro:!1}),e.enabled_assets_file_generation&&(0,S.jsxs)("div",{className:"ablocks-column-items form-group",children:[(0,S.jsx)("div",{className:"ablocks-label-tooltip",children:(0,S.jsx)("div",{className:"ablocks-title-subtitle",children:(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"regenerate_assets",children:(0,r.__)("Regenerate Assets","ablocks")})})}),(0,S.jsx)("div",{className:"ablocks-input-desc",children:(0,S.jsx)(Ja,{type:"button",preset:"purple",label:(0,r.__)("Regenerate Assets","ablocks"),onClick:()=>{(0,i.In)({action:"ablocks/regenerate_assets"}).then(()=>{a(wt({message:(0,r.__)("Assets Successfully Regenerated!","ablocks"),isShow:!0,type:"success"}))})}})})]}),(0,S.jsx)("h3",{className:"ablocks-general-content__heading ablocks-general-content__heading--sub", |
| 695 | 696 | children:(0,r.__)("CSS","ablocks")}),(0,S.jsx)(Dn,{name:"perf_inline_css",title:(0,r.__)("Inline small page CSS","ablocks"),subtitle:(0,r.__)("Inline the generated per-page stylesheet when it is small (under ~50KB) to remove a render-blocking request. Larger stylesheets keep loading as a file.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"perf_critical_css",title:(0,r.__)("Inline critical CSS","ablocks"),subtitle:(0,r.__)("Inline all layout-affecting CSS in the head and load the rest (colors, shadows, hover states) without blocking. Content paints sooner with correct spacing — the deferred CSS is cosmetic only, so it does not shift the layout.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"perf_async_css",title:(0,r.__)("Load large page CSS asynchronously","ablocks"),subtitle:(0,r.__)("Load the full page stylesheet without blocking rendering (with a no-JS fallback). Uses the same layout-safe critical inline as above, so it will not cause a flash of unstyled content.","ablocks"),isPro:!1}),(0, |
| 696 | 697 | S.jsx)("h3",{className:"ablocks-general-content__heading ablocks-general-content__heading--sub",children:(0,r.__)("JavaScript","ablocks")}),(0,S.jsx)(Dn,{name:"perf_defer_js",title:(0,r.__)("Defer render-blocking scripts","ablocks"),subtitle:(0,r.__)("Add defer to scripts that load in the page head (WordPress utilities and aBlocks scripts) so they no longer block first paint. Execution order is preserved. Third-party scripts are not affected.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"perf_delay_js",title:(0,r.__)("Delay JavaScript until interaction","ablocks"),subtitle:(0,r.__)("Hold aBlocks scripts until the first user interaction (scroll, tap, keypress) or a fallback timeout, reducing main-thread work on load. Third-party scripts are not affected.","ablocks"),isPro:!1}),e.perf_delay_js&&(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"perf_delay_js_timeout",children:(0,r.__)("Fallback timeout (ms)","ablocks")}),(0, |
| 697 | -S.jsx)("input",{id:"perf_delay_js_timeout",type:"number",min:0,step:500,className:"ablocks-input",value:e.perf_delay_js_timeout??5e3,onChange:e=>t("perf_delay_js_timeout",parseInt(e.target.value,10)||0)})]})]})}},{name:"fonts",title:(0,r.__)("Fonts","ablocks"),component:()=>{const{values:e,setFieldValue:t}=ta(),{enabled_load_google_font_locally:n}=e,[s,l]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let e=!0;return(async()=>(await(il||(il=o.e(8399).then(o.bind(o,18722))),il)).googleFontsAll)().then(t=>{e&&t&&l(t.families||[])}),()=>{e=!1}},[]),(0,a.useEffect)(()=>{n&&(0,i.In)({action:"ablocks/download_google_fonts"})},[n]),(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)(Dn,{name:"enabled_load_google_font_locally",title:(0,r.__)("Load Google Fonts locally","ablocks"),subtitle:(0, | |
| 698 | +S.jsx)("input",{id:"perf_delay_js_timeout",type:"number",min:0,step:500,className:"ablocks-input",value:e.perf_delay_js_timeout??5e3,onChange:e=>t("perf_delay_js_timeout",parseInt(e.target.value,10)||0)})]})]})}},{name:"fonts",title:(0,r.__)("Fonts","ablocks"),component:()=>{const{values:e,setFieldValue:t}=ta(),{enabled_load_google_font_locally:n}=e,[s,l]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let e=!0;return(async()=>(await(ll||(ll=o.e(8399).then(o.bind(o,18722))),ll)).googleFontsAll)().then(t=>{e&&t&&l(t.families||[])}),()=>{e=!1}},[]),(0,a.useEffect)(()=>{n&&(0,i.In)({action:"ablocks/download_google_fonts"})},[n]),(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)(Dn,{name:"enabled_load_google_font_locally",title:(0,r.__)("Load Google Fonts locally","ablocks"),subtitle:(0, | |
| 698 | 699 | r.__)("To enhance page load speed and protect user privacy, replace Google Fonts CDN links with self-hosted font files. By serving the fonts directly from your own server, you eliminate external requests to Google's servers and maintain full control over font delivery.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"font_metric_fallback",title:(0,r.__)("Zero-shift font fallbacks","ablocks"),subtitle:(0,r.__)("While a web font loads, render the text in a locally installed font re-scaled to the web font’s own metrics. The line takes up the same space either way, so nothing jumps when the real font arrives (better CLS). Nothing extra is downloaded.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"enabled_only_selected_fonts",title:(0,r.__)("Font Selection Control","ablocks"),subtitle:(0,r.__)("Limit font options to only the selected ones from 1500+ Google fonts.","ablocks"),isPro:!1}),e.enabled_only_selected_fonts&&(0,S.jsxs)("div",{className:"ablocks-d-flex ablocks-cache-row",children:[(0, |
| 699 | -S.jsx)("label",{className:"ablocks-title",htmlFor:"selected_fonts",children:(0,r.__)("Select Fonts","ablocks")}),(0,S.jsx)(Ji,{className:"ablocks-select ablocks-select--selected-fonts",classNamePrefix:"ablocks-react-select",options:s,defaultValue:e?.selected_fonts,isMulti:!0,searchable:!0,menuPlacement:"auto",onChange:e=>{t("selected_fonts",e)}})]}),(0,S.jsxs)("p",{className:"ablocks-field-help",children:[(0,r.__)("The Font Usage report — which families and weights each page actually loads — has moved to the Site Scanner, next to the other reports.","ablocks")," ",(0,S.jsx)("a",{href:`${i.Y3}admin.php?page=ablocks-scanner`,children:(0,r.__)("Open the Font Usage report","ablocks")})]})]})}},{name:"platform",title:(0,r.__)("Platform","ablocks"),component:()=>{const{values:e,setFieldValue:t}=ta();return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading ablocks-general-content__heading--sub",children:(0, | |
| 700 | +S.jsx)("label",{className:"ablocks-title",htmlFor:"selected_fonts",children:(0,r.__)("Select Fonts","ablocks")}),(0,S.jsx)(Ji,{...Gi(),className:"ablocks-select ablocks-select--selected-fonts",classNamePrefix:"ablocks-react-select",options:s,defaultValue:e?.selected_fonts,isMulti:!0,searchable:!0,menuPlacement:"auto",onChange:e=>{t("selected_fonts",e)}})]}),(0,S.jsxs)("p",{className:"ablocks-field-help",children:[(0,r.__)("The Font Usage report — which families and weights each page actually loads — has moved to the Site Scanner, next to the other reports.","ablocks")," ",(0,S.jsx)("a",{href:`${i.Y3}admin.php?page=ablocks-scanner`,children:(0,r.__)("Open the Font Usage report","ablocks")})]})]})}},{name:"platform",title:(0,r.__)("Platform","ablocks"),component:()=>{const{values:e,setFieldValue:t}=ta();return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading ablocks-general-content__heading--sub",children:(0, | |
| 700 | 701 | r.__)("Platform Optimizations","ablocks")}),(0,S.jsx)(Dn,{name:"perf_disable_emojis",title:(0,r.__)("Disable Emojis","ablocks"),subtitle:(0,r.__)("Remove the WordPress emoji detection script and styles from front-end pages. The admin area keeps them, so emojis still render there.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"perf_disable_embeds",title:(0,r.__)("Disable Embeds (wp-embed)","ablocks"),subtitle:(0,r.__)("Remove the oEmbed discovery links and the wp-embed script used for embedding this site elsewhere.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"perf_disable_dashicons",title:(0,r.__)("Disable Dashicons on frontend","ablocks"),subtitle:(0,r.__)("Remove the Dashicons stylesheet for logged-out visitors (kept for logged-in users so the admin bar still renders).","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"perf_disable_jquery_migrate",title:(0,r.__)("Remove jQuery Migrate","ablocks"),subtitle:(0, |
| 701 | 702 | r.__)("Drop the legacy jquery-migrate script on the frontend. Disable if an old theme/plugin needs it.","ablocks"),isPro:!1}),(0,S.jsx)(Dn,{name:"perf_control_heartbeat",title:(0,r.__)("Control Heartbeat API","ablocks"),subtitle:(0,r.__)("Throttle the WordPress Heartbeat API to reduce background admin-ajax requests.","ablocks"),isPro:!1}),e.perf_control_heartbeat&&(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"perf_heartbeat_frequency",children:(0,r.__)("Heartbeat interval (seconds)","ablocks")}),(0,S.jsx)("input",{id:"perf_heartbeat_frequency",type:"number",min:15,max:300,className:"ablocks-input",value:e.perf_heartbeat_frequency??60,onChange:e=>t("perf_heartbeat_frequency",parseInt(e.target.value,10)||60)})]}),(0,S.jsx)("h3",{className:"ablocks-general-content__heading ablocks-general-content__heading--sub",children:(0,r.__)("Mobile","ablocks")}),(0,S.jsx)(Dn,{name:"perf_touch_targets",title:(0, |
| 702 | -r.__)("Larger touch targets on mobile","ablocks"),subtitle:(0,r.__)("Give buttons and linked icons a minimum tap size on small screens so they are easier to tap and pass the accessibility check. Slightly changes sizing on mobile.","ablocks"),isPro:!1})]})}}],ul=()=>{const{values:e,setValues:t,submitForm:n}=ta(),{search:o}=(0,s.zy)(),i=new URLSearchParams(o).get("sub"),l=dl.find(e=>e.name===i)||dl[0],c=l.component,d=Object.entries(ll).every(([t,a])=>e[t]===a),[u,m]=(0,a.useState)(()=>{try{return"1"===window.localStorage.getItem(cl)}catch(e){return!1}}),[_,h]=(0,a.useState)(!1);(0,a.useEffect)(()=>{_&&d&&(h(!1),n())},[_,d,n]);const p=!d&&!u;return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:l.title}),p&&(0,S.jsxs)("div",{className:"ablocks-perf-recommendation",children:[(0,S.jsxs)("div",{className:"ablocks-perf-recommendation__body",children:[(0,S.jsx)("span",{ | |
| 703 | -className:"ablocks-perf-recommendation__icon","aria-hidden":"true",children:"⚡"}),(0,S.jsxs)("div",{children:[(0,S.jsx)("strong",{className:"ablocks-perf-recommendation__title",children:(0,r.__)("Boost your page speed","ablocks")}),(0,S.jsx)("p",{className:"ablocks-perf-recommendation__text",children:(0,r.__)("Once your website is complete, we recommend turning on a set of speed optimizations — combine & inline block CSS, defer scripts, lazy-load images, and remove WordPress bloat. Apply them in one click.","ablocks")})]})]}),(0,S.jsxs)("div",{className:"ablocks-perf-recommendation__actions",children:[(0,S.jsx)("button",{type:"button",className:"ablocks-perf-recommendation__apply",onClick:()=>{t({...e,...ll}),h(!0)},children:(0,r.__)("Apply recommended settings","ablocks")}),(0,S.jsx)("button",{type:"button",className:"ablocks-perf-recommendation__dismiss",onClick:()=>{try{window.localStorage.setItem(cl,"1")}catch(e){}m(!0)},children:(0,r.__)("Not now","ablocks")})]})]}),(0, | |
| 704 | -S.jsx)(c,{})]})},ml={title:Aa().string,subtitle:Aa().string,desc:Aa().string,name:Aa().string,value:Aa().string};function _l({title:e,name:t,subtitle:a,desc:n}){const{setFieldValue:s}=ta(),r=Ln().uniqueId(t+"_");return(0,S.jsxs)("div",{className:"academy-textarea-container academy-mb-6",children:[(0,S.jsxs)("div",{className:"academy-title-subtitle",children:[(0,S.jsx)("label",{htmlFor:r,className:"academy-title",children:e}),a&&(0,S.jsx)("span",{className:"academy-sub-title",children:a})]}),(0,S.jsxs)("div",{className:"academy-column-items",children:[(0,S.jsx)(ka,{component:"textarea",cols:"55",id:r,name:t,onChange:e=>s(t,e.target.value),className:"academy-input"}),n&&(0,S.jsx)("span",{className:"desc",children:n})]})]})}_l.propTypes=ml;const hl=()=>{const{values:e,setFieldValue:t}=ta(),a=e.param_passthrough_match||"class",n=[{label:(0,r.__)("Links with a CSS class","ablocks"),value:"class"},{label:(0,r.__)("All links on the site","ablocks"),value:"all"},{label:(0, | |
| 705 | -r.__)("Links whose URL contains a word","ablocks"),value:"keyword"}];return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Affiliate / Query Param Passthrough","ablocks")}),(0,S.jsx)(Dn,{name:"param_passthrough_enabled",title:(0,r.__)("Enable query param passthrough","ablocks"),subtitle:(0,r.__)("When a visitor lands with a tracking param in the URL (e.g. ?ref=xyz), automatically append it to your links so it is carried as they click through the site. Does nothing unless a matching link is present and a tracked param exists in the current URL.","ablocks"),isPro:!1}),e.param_passthrough_enabled&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(_l,{name:"param_passthrough_keys",title:(0,r.__)("Params to carry","ablocks"),subtitle:(0,r.__)("Comma-separated query-string keys to pass through, e.g. ref,utm_source,utm_medium. Only params present in the incoming URL are added.","ablocks")}),(0, | |
| 706 | -S.jsxs)("div",{className:"ablocks-column-items form-group",children:[(0,S.jsx)("div",{className:"ablocks-label-tooltip",children:(0,S.jsxs)("div",{className:"ablocks-title-subtitle",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"param_passthrough_match",children:(0,r.__)("Which links to update","ablocks")}),(0,S.jsx)("span",{className:"ablocks-sub-title",children:(0,r.__)("Choose which links on the page receive the params.","ablocks")})]})}),(0,S.jsx)(Ji,{inputId:"param_passthrough_match",className:"ablocks-select",classNamePrefix:"ablocks-react-select",options:n,value:n.find(e=>e.value===a)||null,isSearchable:!1,onChange:e=>t("param_passthrough_match",e.value)})]}),"class"===a&&(0,S.jsx)(Sn,{name:"param_passthrough_class",title:(0,r.__)("Link CSS class","ablocks"),subtitle:(0,r.__)("Add this CSS class to any button/link (Advanced → Additional CSS class) that should receive the params. The class may sit on the link or on its wrapping block.","ablocks"), | |
| 707 | -placeholder:"aff-link"}),"all"===a&&(0,S.jsx)("p",{className:"ablocks-sub-title",children:(0,r.__)("Every same-site link gets the params. External links are left untouched so the ref is not leaked to other domains.","ablocks")}),"keyword"===a&&(0,S.jsx)(_l,{name:"param_passthrough_keyword",title:(0,r.__)("Match words","ablocks"),subtitle:(0,r.__)("Comma-separated words. A link is updated when its URL contains any of them, e.g. checkout, pricing, product.","ablocks")}),(0,S.jsx)(Dn,{name:"param_passthrough_persist",title:(0,r.__)("Remember with a cookie","ablocks"),subtitle:(0,r.__)("Store the incoming params in a cookie so they keep being applied even after the visitor lands on a page whose URL no longer carries them (e.g. after clicking an untagged menu link).","ablocks"),isPro:!1}),e.param_passthrough_persist&&(0,S.jsx)(Sn,{name:"param_passthrough_cookie_days",title:(0,r.__)("Cookie lifetime (days)","ablocks"),subtitle:(0, | |
| 708 | -r.__)("How long to remember the params, in days. Use 0 for a session-only cookie that clears when the browser closes.","ablocks"),placeholder:"30"})]})]})},pl=()=>{const{values:e,setFieldValue:t}=ta(),[n,s]=(0,a.useState)(!1),[o,l]=(0,a.useState)([]);(0,a.useEffect)(()=>{e.enabled_coming_soon_page&&t("enabled_maintenance_page",!1)},[e.enabled_coming_soon_page]),(0,a.useEffect)(()=>{e.enabled_maintenance_page&&t("enabled_coming_soon_page",!1)},[e.enabled_maintenance_page]),(0,a.useEffect)(()=>{(0,i.In)({action:"ablocks/fetch_posts"}).then(e=>{l(e?.data?.data)})},[]);const c=(e="")=>{s(!0),(0,i.In)({action:"ablocks/fetch_posts",keyword:e}).then(e=>{s(!1),l(e?.data?.data)})},d=Wa(e=>{0===o.filter(t=>t.label.toLowerCase().includes(e)).length&&c(e)},500);return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Site Visibility","ablocks")}),(0,S.jsxs)("div",{className:"ablocks--coming-soon-page", | |
| 709 | -children:[(0,S.jsx)(Dn,{name:"enabled_coming_soon_page",title:(0,r.__)("Enable Coming Soon Mode","ablocks"),subtitle:(0,r.__)("Display a 'Coming Soon' page while your site or any page is under development.","ablocks"),isPro:!1}),e.enabled_coming_soon_page&&(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"coming-soon-page-select",children:(0,r.__)("Coming Soon Page","ablocks")}),(0,S.jsx)(Ji,{id:"coming-soon-page-select",className:"ablocks-select ablocks-select--coming_soon_page",classNamePrefix:"ablocks-react-select",placeholder:(0,r.__)("Select Coming Soon Page","ablocks"),options:o,value:o.find(t=>parseInt(t.value)===parseInt(e.coming_soon_page)),onChange:e=>t("coming_soon_page",e.value),onInputChange:d,isLoading:n,onMenuOpen:c,menuPlacement:"top",styles:{menu:e=>({...e,maxHeight:"150px",overflowY:"scroll",scrollBehavior:"smooth"})}})]})]}),(0,S.jsxs)("div",{className:"ablocks--maintenance-page",children:[(0,S.jsx)(Dn,{ | |
| 710 | -name:"enabled_maintenance_page",title:(0,r.__)("Enable Maintenance Mode","ablocks"),subtitle:(0,r.__)("Temporarily take your site offline with a 503 status code for maintenance.","ablocks"),isPro:!1}),e.enabled_maintenance_page&&(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"maintenance-page",children:(0,r.__)("Maintenance Page","ablocks")}),(0,S.jsx)(Ji,{id:"maintenance-page",className:"ablocks-select ablocks-select--maintenance_page",classNamePrefix:"ablocks-react-select",placeholder:(0,r.__)("Select Maintenance Page","ablocks"),options:o,value:o.find(t=>parseInt(t.value)===parseInt(e.maintenance_page)),onChange:e=>t("maintenance_page",e.value),onInputChange:d,isLoading:n,onMenuOpen:c,menuPlacement:"top",styles:{menu:e=>({...e,maxHeight:"150px",overflowY:"scroll",scrollBehavior:"smooth"})}})]})]})]})},fl=()=>{const[e,t]=(0,a.useState)([]),[n,s]=(0,a.useState)(!0),[o,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(""),u=()=>{ | |
| 711 | -s(!0),(0,i.In)({action:"ablocks/global_classes/get"}).then(e=>{const a=e?.data?.data;t(Array.isArray(a)?a:[]),s(!1)})};(0,a.useEffect)(()=>{u()},[]);const m=e=>{if(e.css)return e.css;const t=new Set;return Object.values(e.styles||{}).forEach(e=>{Object.entries(e||{}).forEach(([e,a])=>{"typography"===e&&a&&Object.keys(a).some(e=>a[e])?t.add("typography"):a&&("string"==typeof a?a:Object.keys(a).length)&&t.add(e)})}),[...t].join(", ")||(0,r.__)("empty","ablocks")};return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Reusable Classes","ablocks")}),(0,S.jsx)("p",{style:{opacity:.7,marginTop:-8},children:(0,r.__)("Classes created on Atomic blocks. Edit one here and every block using it updates.","ablocks")}),n&&(0,S.jsx)("p",{children:(0,r.__)("Loading…","ablocks")}),!n&&0===e.length&&(0,S.jsx)("p",{style:{opacity:.6},children:(0,r.__)("No classes yet.","ablocks")}),e.map(e=>(0,S.jsxs)("div",{ | |
| 712 | -style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8},children:[(0,S.jsx)("div",{style:{flex:1},children:o===e.id?(0,S.jsx)(Pa.TextControl,{value:c,onChange:d,__nextHasNoMarginBottom:!0}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("strong",{children:e.label||e.id}),(0,S.jsxs)("code",{style:{marginLeft:8,fontSize:12,opacity:.6},children:[".ablocks-gc-",e.id]}),(0,S.jsx)("div",{style:{fontSize:12,opacity:.6},children:m(e)})]})}),o===e.id?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Pa.Button,{variant:"primary",onClick:()=>(e=>{const t=c.trim();if(!t)return;const a={action:"ablocks/global_classes/save",id:e.id,label:t};e.styles?a.styles=JSON.stringify(e.styles):a.css=e.css||"",(0,i.In)(a).then(()=>{l(null),u()})})(e),children:(0,r.__)("Save","ablocks")}),(0,S.jsx)(Pa.Button,{variant:"tertiary",onClick:()=>l(null),children:(0,r.__)("Cancel","ablocks")})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Pa.Button,{ | |
| 713 | -variant:"secondary",onClick:()=>{l(e.id),d(e.label||e.id)},children:(0,r.__)("Rename","ablocks")}),(0,S.jsx)(Pa.Button,{variant:"tertiary",isDestructive:!0,onClick:()=>{return t=e.id,void(window.confirm((0,r.__)("Delete this class? Blocks using it lose those styles.","ablocks"))&&(0,i.In)({action:"ablocks/global_classes/delete",id:t}).then(u));var t},children:(0,r.__)("Delete","ablocks")})]})]},e.id))]})},bl={name:Aa().string,postType:Aa().string,productType:Aa().string,title:Aa().string,action:Aa().string,placeholder:Aa().string,subtitle:Aa().oneOfType([Aa().object,Aa().string]),desc:Aa().string,isMulti:Aa().bool};function gl({name:e,postType:t="",productType:s="",title:o="",action:l="ablocks/fetch_posts",placeholder:c="",subtitle:d="",desc:u="",isMulti:m=!1,position:_="bottom"}){const{values:h,setFieldValue:p}=ta(),f=e.split("."),b=f[1]?h[f[0]][f[1]]:h[f[0]],[g,y]=(0,a.useState)(!1),[k,v]=(0,a.useState)([]);(0,a.useEffect)(()=>{!m&&parseInt(b)&&(y(!0),(0,i.In)({action:l,postType:t, | |
| 714 | -postId:parseInt(b)}).then(e=>{y(!1),v(e?.data?.data)}))},[b]);const x=(e="")=>{y(!0),(0,i.In)({action:l,postType:t,productType:s,keyword:e}).then(e=>{y(!1),v(e?.data?.data)})},w=Wa(e=>{0===k.filter(t=>t.label.toLowerCase().includes(e)).length&&x(e)},500),M=e;return(0,S.jsx)(n().Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-post-form-group",children:[(0,S.jsxs)("div",{className:"ablocks-post-form-info",children:[o&&(0,S.jsx)("label",{htmlFor:M,className:"ablocks-title",children:o}),d&&(0,S.jsx)("span",{className:"ablocks-sub-title",children:d})]}),(0,S.jsxs)("div",{className:"ablocks-post-form-body",children:[(0,S.jsx)(Ji,{id:M,className:"ablocks-select--full",classNamePrefix:"ablocks-react-select",menuPlacement:_,placeholder:c||(0,r.sprintf)( | |
| 703 | +r.__)("Larger touch targets on mobile","ablocks"),subtitle:(0,r.__)("Give buttons and linked icons a minimum tap size on small screens so they are easier to tap and pass the accessibility check. Slightly changes sizing on mobile.","ablocks"),isPro:!1})]})}}],ml=()=>{const{values:e,setValues:t,submitForm:n}=ta(),{search:o}=(0,s.zy)(),i=new URLSearchParams(o).get("sub"),l=ul.find(e=>e.name===i)||ul[0],c=l.component,d=Object.entries(cl).every(([t,a])=>e[t]===a),[u,m]=(0,a.useState)(()=>{try{return"1"===window.localStorage.getItem(dl)}catch(e){return!1}}),[_,h]=(0,a.useState)(!1);(0,a.useEffect)(()=>{_&&d&&(h(!1),n())},[_,d,n]);const p=!d&&!u;return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:l.title}),p&&(0,S.jsxs)("div",{className:"ablocks-perf-recommendation",children:[(0,S.jsxs)("div",{className:"ablocks-perf-recommendation__body",children:[(0,S.jsx)("span",{ | |
| 704 | +className:"ablocks-perf-recommendation__icon","aria-hidden":"true",children:"⚡"}),(0,S.jsxs)("div",{children:[(0,S.jsx)("strong",{className:"ablocks-perf-recommendation__title",children:(0,r.__)("Boost your page speed","ablocks")}),(0,S.jsx)("p",{className:"ablocks-perf-recommendation__text",children:(0,r.__)("Once your website is complete, we recommend turning on a set of speed optimizations — combine & inline block CSS, defer scripts, lazy-load images, and remove WordPress bloat. Apply them in one click.","ablocks")})]})]}),(0,S.jsxs)("div",{className:"ablocks-perf-recommendation__actions",children:[(0,S.jsx)("button",{type:"button",className:"ablocks-perf-recommendation__apply",onClick:()=>{t({...e,...cl}),h(!0)},children:(0,r.__)("Apply recommended settings","ablocks")}),(0,S.jsx)("button",{type:"button",className:"ablocks-perf-recommendation__dismiss",onClick:()=>{try{window.localStorage.setItem(dl,"1")}catch(e){}m(!0)},children:(0,r.__)("Not now","ablocks")})]})]}),(0, | |
| 705 | +S.jsx)(c,{})]})},_l={title:Aa().string,subtitle:Aa().string,desc:Aa().string,name:Aa().string,value:Aa().string};function hl({title:e,name:t,subtitle:a,desc:n}){const{setFieldValue:s}=ta(),r=Ln().uniqueId(t+"_");return(0,S.jsxs)("div",{className:"academy-textarea-container academy-mb-6",children:[(0,S.jsxs)("div",{className:"academy-title-subtitle",children:[(0,S.jsx)("label",{htmlFor:r,className:"academy-title",children:e}),a&&(0,S.jsx)("span",{className:"academy-sub-title",children:a})]}),(0,S.jsxs)("div",{className:"academy-column-items",children:[(0,S.jsx)(ka,{component:"textarea",cols:"55",id:r,name:t,onChange:e=>s(t,e.target.value),className:"academy-input"}),n&&(0,S.jsx)("span",{className:"desc",children:n})]})]})}hl.propTypes=_l;const pl=()=>{const{values:e,setFieldValue:t}=ta(),a=e.param_passthrough_match||"class",n=[{label:(0,r.__)("Links with a CSS class","ablocks"),value:"class"},{label:(0,r.__)("All links on the site","ablocks"),value:"all"},{label:(0, | |
| 706 | +r.__)("Links whose URL contains a word","ablocks"),value:"keyword"}];return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Affiliate / Query Param Passthrough","ablocks")}),(0,S.jsx)(Dn,{name:"param_passthrough_enabled",title:(0,r.__)("Enable query param passthrough","ablocks"),subtitle:(0,r.__)("When a visitor lands with a tracking param in the URL (e.g. ?ref=xyz), automatically append it to your links so it is carried as they click through the site. Does nothing unless a matching link is present and a tracked param exists in the current URL.","ablocks"),isPro:!1}),e.param_passthrough_enabled&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(hl,{name:"param_passthrough_keys",title:(0,r.__)("Params to carry","ablocks"),subtitle:(0,r.__)("Comma-separated query-string keys to pass through, e.g. ref,utm_source,utm_medium. Only params present in the incoming URL are added.","ablocks")}),(0, | |
| 707 | +S.jsxs)("div",{className:"ablocks-column-items form-group",children:[(0,S.jsx)("div",{className:"ablocks-label-tooltip",children:(0,S.jsxs)("div",{className:"ablocks-title-subtitle",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"param_passthrough_match",children:(0,r.__)("Which links to update","ablocks")}),(0,S.jsx)("span",{className:"ablocks-sub-title",children:(0,r.__)("Choose which links on the page receive the params.","ablocks")})]})}),(0,S.jsx)(Ji,{...Gi(),inputId:"param_passthrough_match",className:"ablocks-select",classNamePrefix:"ablocks-react-select",options:n,value:n.find(e=>e.value===a)||null,isSearchable:!1,onChange:e=>t("param_passthrough_match",e.value)})]}),"class"===a&&(0,S.jsx)(Sn,{name:"param_passthrough_class",title:(0,r.__)("Link CSS class","ablocks"),subtitle:(0,r.__)("Add this CSS class to any button/link (Advanced → Additional CSS class) that should receive the params. The class may sit on the link or on its wrapping block.","ablocks"), | |
| 708 | +placeholder:"aff-link"}),"all"===a&&(0,S.jsx)("p",{className:"ablocks-sub-title",children:(0,r.__)("Every same-site link gets the params. External links are left untouched so the ref is not leaked to other domains.","ablocks")}),"keyword"===a&&(0,S.jsx)(hl,{name:"param_passthrough_keyword",title:(0,r.__)("Match words","ablocks"),subtitle:(0,r.__)("Comma-separated words. A link is updated when its URL contains any of them, e.g. checkout, pricing, product.","ablocks")}),(0,S.jsx)(Dn,{name:"param_passthrough_persist",title:(0,r.__)("Remember with a cookie","ablocks"),subtitle:(0,r.__)("Store the incoming params in a cookie so they keep being applied even after the visitor lands on a page whose URL no longer carries them (e.g. after clicking an untagged menu link).","ablocks"),isPro:!1}),e.param_passthrough_persist&&(0,S.jsx)(Sn,{name:"param_passthrough_cookie_days",title:(0,r.__)("Cookie lifetime (days)","ablocks"),subtitle:(0, | |
| 709 | +r.__)("How long to remember the params, in days. Use 0 for a session-only cookie that clears when the browser closes.","ablocks"),placeholder:"30"})]})]})},fl=()=>{const{values:e,setFieldValue:t}=ta(),[n,s]=(0,a.useState)(!1),[o,l]=(0,a.useState)([]);(0,a.useEffect)(()=>{e.enabled_coming_soon_page&&t("enabled_maintenance_page",!1)},[e.enabled_coming_soon_page]),(0,a.useEffect)(()=>{e.enabled_maintenance_page&&t("enabled_coming_soon_page",!1)},[e.enabled_maintenance_page]),(0,a.useEffect)(()=>{(0,i.In)({action:"ablocks/fetch_posts"}).then(e=>{l(e?.data?.data)})},[]);const c=(e="")=>{s(!0),(0,i.In)({action:"ablocks/fetch_posts",keyword:e}).then(e=>{s(!1),l(e?.data?.data)})},d=Wa(e=>{0===o.filter(t=>t.label.toLowerCase().includes(e)).length&&c(e)},500);return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Site Visibility","ablocks")}),(0,S.jsxs)("div",{className:"ablocks--coming-soon-page", | |
| 710 | +children:[(0,S.jsx)(Dn,{name:"enabled_coming_soon_page",title:(0,r.__)("Enable Coming Soon Mode","ablocks"),subtitle:(0,r.__)("Display a 'Coming Soon' page while your site or any page is under development.","ablocks"),isPro:!1}),e.enabled_coming_soon_page&&(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"coming-soon-page-select",children:(0,r.__)("Coming Soon Page","ablocks")}),(0,S.jsx)(Ji,{...Gi(),id:"coming-soon-page-select",className:"ablocks-select ablocks-select--coming_soon_page",classNamePrefix:"ablocks-react-select",placeholder:(0,r.__)("Select Coming Soon Page","ablocks"),options:o,value:o.find(t=>parseInt(t.value)===parseInt(e.coming_soon_page)),onChange:e=>t("coming_soon_page",e.value),onInputChange:d,isLoading:n,onMenuOpen:c,menuPlacement:"top",styles:{menu:e=>({...e,maxHeight:"150px",overflowY:"scroll",scrollBehavior:"smooth"})}})]})]}),(0,S.jsxs)("div",{className:"ablocks--maintenance-page",children:[(0, | |
| 711 | +S.jsx)(Dn,{name:"enabled_maintenance_page",title:(0,r.__)("Enable Maintenance Mode","ablocks"),subtitle:(0,r.__)("Temporarily take your site offline with a 503 status code for maintenance.","ablocks"),isPro:!1}),e.enabled_maintenance_page&&(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"maintenance-page",children:(0,r.__)("Maintenance Page","ablocks")}),(0,S.jsx)(Ji,{...Gi(),id:"maintenance-page",className:"ablocks-select ablocks-select--maintenance_page",classNamePrefix:"ablocks-react-select",placeholder:(0,r.__)("Select Maintenance Page","ablocks"),options:o,value:o.find(t=>parseInt(t.value)===parseInt(e.maintenance_page)),onChange:e=>t("maintenance_page",e.value),onInputChange:d,isLoading:n,onMenuOpen:c,menuPlacement:"top",styles:{menu:e=>({...e,maxHeight:"150px",overflowY:"scroll",scrollBehavior:"smooth"})}})]})]})]})},bl=()=>{const[e,t]=(0,a.useState)([]),[n,s]=(0,a.useState)(!0),[o,l]=(0,a.useState)(null),[c,d]=(0, | |
| 712 | +a.useState)(""),u=()=>{s(!0),(0,i.In)({action:"ablocks/global_classes/get"}).then(e=>{const a=e?.data?.data;t(Array.isArray(a)?a:[]),s(!1)})};(0,a.useEffect)(()=>{u()},[]);const m=e=>{if(e.css)return e.css;const t=new Set;return Object.values(e.styles||{}).forEach(e=>{Object.entries(e||{}).forEach(([e,a])=>{"typography"===e&&a&&Object.keys(a).some(e=>a[e])?t.add("typography"):a&&("string"==typeof a?a:Object.keys(a).length)&&t.add(e)})}),[...t].join(", ")||(0,r.__)("empty","ablocks")};return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Reusable Classes","ablocks")}),(0,S.jsx)("p",{style:{opacity:.7,marginTop:-8},children:(0,r.__)("Classes created on Atomic blocks. Edit one here and every block using it updates.","ablocks")}),n&&(0,S.jsx)("p",{children:(0,r.__)("Loading…","ablocks")}),!n&&0===e.length&&(0,S.jsx)("p",{style:{opacity:.6},children:(0,r.__)("No classes yet.","ablocks") | |
| 713 | +}),e.map(e=>(0,S.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8},children:[(0,S.jsx)("div",{style:{flex:1},children:o===e.id?(0,S.jsx)(Pa.TextControl,{value:c,onChange:d,__nextHasNoMarginBottom:!0}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("strong",{children:e.label||e.id}),(0,S.jsxs)("code",{style:{marginLeft:8,fontSize:12,opacity:.6},children:[".ablocks-gc-",e.id]}),(0,S.jsx)("div",{style:{fontSize:12,opacity:.6},children:m(e)})]})}),o===e.id?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Pa.Button,{variant:"primary",onClick:()=>(e=>{const t=c.trim();if(!t)return;const a={action:"ablocks/global_classes/save",id:e.id,label:t};e.styles?a.styles=JSON.stringify(e.styles):a.css=e.css||"",(0,i.In)(a).then(()=>{l(null),u()})})(e),children:(0,r.__)("Save","ablocks")}),(0,S.jsx)(Pa.Button,{variant:"tertiary",onClick:()=>l(null),children:(0,r.__)("Cancel","ablocks")})]}):(0,S.jsxs)(S.Fragment,{ | |
| 714 | +children:[(0,S.jsx)(Pa.Button,{variant:"secondary",onClick:()=>{l(e.id),d(e.label||e.id)},children:(0,r.__)("Rename","ablocks")}),(0,S.jsx)(Pa.Button,{variant:"tertiary",isDestructive:!0,onClick:()=>{return t=e.id,void(window.confirm((0,r.__)("Delete this class? Blocks using it lose those styles.","ablocks"))&&(0,i.In)({action:"ablocks/global_classes/delete",id:t}).then(u));var t},children:(0,r.__)("Delete","ablocks")})]})]},e.id))]})},gl={name:Aa().string,postType:Aa().string,productType:Aa().string,title:Aa().string,action:Aa().string,placeholder:Aa().string,subtitle:Aa().oneOfType([Aa().object,Aa().string]),desc:Aa().string,isMulti:Aa().bool};function yl({name:e,postType:t="",productType:s="",title:o="",action:l="ablocks/fetch_posts",placeholder:c="",subtitle:d="",desc:u="",isMulti:m=!1,position:_="bottom"}){const{values:h,setFieldValue:p}=ta(),f=e.split("."),b=f[1]?h[f[0]][f[1]]:h[f[0]],[g,y]=(0,a.useState)(!1),[k,v]=(0,a.useState)([]);(0,a.useEffect)(()=>{!m&&parseInt(b)&&(y(!0), | |
| 715 | +(0,i.In)({action:l,postType:t,postId:parseInt(b)}).then(e=>{y(!1),v(e?.data?.data)}))},[b]);const x=(e="")=>{y(!0),(0,i.In)({action:l,postType:t,productType:s,keyword:e}).then(e=>{y(!1),v(e?.data?.data)})},w=Wa(e=>{0===k.filter(t=>t.label.toLowerCase().includes(e)).length&&x(e)},500),M=e;return(0,S.jsx)(n().Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-post-form-group",children:[(0,S.jsxs)("div",{className:"ablocks-post-form-info",children:[o&&(0,S.jsx)("label",{htmlFor:M,className:"ablocks-title",children:o}),d&&(0,S.jsx)("span",{className:"ablocks-sub-title",children:d})]}),(0,S.jsxs)("div",{className:"ablocks-post-form-body",children:[(0,S.jsx)(Ji,{...Gi(),id:M,className:"ablocks-select--full",classNamePrefix:"ablocks-react-select",menuPlacement:_,placeholder:c||(0,r.sprintf)( | |
| 715 | 716 | // translators: %s: postType |
| 716 | 717 | // translators: %s: postType |
| 717 | -(0,r.__)("Select a %s","ablocks"),t),name:e,value:m?b:k?.length&&k?.filter(e=>e.value===parseInt(b)),onChange:t=>p(e,m?t:t?t.value:0),onInputChange:w,options:k,maxMenuHeight:160,minMenuHeight:70,isSearchable:!0,isLoading:g,onMenuOpen:x,theme:e=>({...e,colors:{...e.colors,primary:"#6104ff"}}),styles:{control:e=>({...e,cursor:"pointer"})},isClearable:!0,isMulti:m}),u&&(0,S.jsx)("span",{className:"ablocks-desc",children:u})]})]})})}gl.propTypes=bl;const yl="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function kl(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function vl(e){return"nodeType"in e}function xl(e){var t,a;return e?kl(e)?e:vl(e)&&null!=(t=null==(a=e.ownerDocument)?void 0:a.defaultView)?t:window:window}function wl(e){const{Document:t}=xl(e);return e instanceof t}function Ml(e){return!kl(e)&&e instanceof xl(e).HTMLElement}function Ll(e){return e instanceof xl(e).SVGElement} | |
| 718 | -function jl(e){return e?kl(e)?e.document:vl(e)?wl(e)?e:Ml(e)||Ll(e)?e.ownerDocument:document:document:document}const Sl=yl?a.useLayoutEffect:a.useEffect;function Yl(e){const t=(0,a.useRef)(e);return Sl(()=>{t.current=e}),(0,a.useCallback)(function(){for(var e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return null==t.current?void 0:t.current(...a)},[])}function Dl(e,t){void 0===t&&(t=[e]);const n=(0,a.useRef)(e);return Sl(()=>{n.current!==e&&(n.current=e)},t),n}function Tl(e,t){const n=(0,a.useRef)();return(0,a.useMemo)(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Cl(e){const t=Yl(e),n=(0,a.useRef)(null),s=(0,a.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,s]}function Nl(e){const t=(0,a.useRef)();return(0,a.useEffect)(()=>{t.current=e},[e]),t.current}let El={};function Ol(e,t){return(0,a.useMemo)(()=>{if(t)return t;const a=null==El[e]?0:El[e]+1;return El[e]=a,e+"-"+a},[e,t])}function Al(e){return function(t){ | |
| 719 | -for(var a=arguments.length,n=new Array(a>1?a-1:0),s=1;s<a;s++)n[s-1]=arguments[s];return n.reduce((t,a)=>{const n=Object.entries(a);for(const[a,s]of n){const n=t[a];null!=n&&(t[a]=n+e*s)}return t},{...t})}}const Pl=Al(1),Hl=Al(-1);function Rl(e){if(!e)return!1;const{KeyboardEvent:t}=xl(e.target);return t&&e instanceof t}function Il(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=xl(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:a}=e.touches[0];return{x:t,y:a}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:a}=e.changedTouches[0];return{x:t,y:a}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Fl=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:a}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(a?Math.round(a):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:a}=e;return"scaleX("+t+") scaleY("+a+")"}},Transform:{toString(e){ | |
| 720 | -if(e)return[Fl.Translate.toString(e),Fl.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:a,easing:n}=e;return t+" "+a+"ms "+n}}}),Wl="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function zl(e){return e.matches(Wl)?e:e.querySelector(Wl)}const Ul={display:"none"};function Bl(e){let{id:t,value:a}=e;return n().createElement("div",{id:t,style:Ul},a)}function Vl(e){let{id:t,announcement:a,ariaLiveType:s="assertive"}=e;return n().createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":s,"aria-atomic":!0},a)}const $l=(0,a.createContext)(null),ql={ | |
| 721 | -draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Jl={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:a}=e;return a?"Draggable item "+t.id+" was moved over droppable area "+a.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:a}=e;return a?"Draggable item "+t.id+" was dropped over droppable area "+a.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Gl(e){let{announcements:t=Jl,container:s,hiddenTextDescribedById:r,screenReaderInstructions:o=ql}=e;const{announce:i,announcement:l}=function(){const[e,t]=(0,a.useState)("");return{announce:(0,a.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e} | |
| 722 | -}(),c=Ol("DndLiveRegion"),[d,u]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{u(!0)},[]),function(e){const t=(0,a.useContext)($l);(0,a.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}((0,a.useMemo)(()=>({onDragStart(e){let{active:a}=e;i(t.onDragStart({active:a}))},onDragMove(e){let{active:a,over:n}=e;t.onDragMove&&i(t.onDragMove({active:a,over:n}))},onDragOver(e){let{active:a,over:n}=e;i(t.onDragOver({active:a,over:n}))},onDragEnd(e){let{active:a,over:n}=e;i(t.onDragEnd({active:a,over:n}))},onDragCancel(e){let{active:a,over:n}=e;i(t.onDragCancel({active:a,over:n}))}}),[i,t])),!d)return null;const m=n().createElement(n().Fragment,null,n().createElement(Bl,{id:r,value:o.draggable}),n().createElement(Vl,{id:c,announcement:l}));return s?(0,jr.createPortal)(m,s):m}var Kl;function Xl(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver", | |
| 723 | -e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Kl||(Kl={}));const Zl=Object.freeze({x:0,y:0});function Ql(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ec(e,t){const a=Il(e);return a?(a.x-t.left)/t.width*100+"% "+(a.y-t.top)/t.height*100+"%":"0 0"}function tc(e,t){let{data:{value:a}}=e,{data:{value:n}}=t;return a-n}function ac(e,t){let{data:{value:a}}=e,{data:{value:n}}=t;return n-a}function nc(e,t,a){return void 0===t&&(t=e.left),void 0===a&&(a=e.top),{x:t+.5*e.width,y:a+.5*e.height}}const sc=e=>{let{collisionRect:t,droppableRects:a,droppableContainers:n}=e;const s=nc(t,t.left,t.top),r=[];for(const e of n){const{id:t}=e,n=a.get(t);if(n){const a=Ql(nc(n),s);r.push({id:t,data:{droppableContainer:e,value:a}})}}return r.sort(tc)};function rc(e,t){ | |
| 724 | -const a=Math.max(t.top,e.top),n=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),r=Math.min(t.top+t.height,e.top+e.height),o=s-n,i=r-a;if(n<s&&a<r){const a=t.width*t.height,n=e.width*e.height,s=o*i;return Number((s/(a+n-s)).toFixed(4))}return 0}const oc=e=>{let{collisionRect:t,droppableRects:a,droppableContainers:n}=e;const s=[];for(const e of n){const{id:n}=e,r=a.get(n);if(r){const a=rc(r,t);a>0&&s.push({id:n,data:{droppableContainer:e,value:a}})}}return s.sort(ac)};function ic(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Zl}function lc(e){return function(t){for(var a=arguments.length,n=new Array(a>1?a-1:0),s=1;s<a;s++)n[s-1]=arguments[s];return n.reduce((t,a)=>({...t,top:t.top+e*a.y,bottom:t.bottom+e*a.y,left:t.left+e*a.x,right:t.right+e*a.x}),{...t})}}const cc=lc(1);function dc(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /) | |
| 725 | -;return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const uc={ignoreTransform:!1};function mc(e,t){void 0===t&&(t=uc);let a=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:n}=xl(e).getComputedStyle(e);t&&(a=function(e,t,a){const n=dc(t);if(!n)return e;const{scaleX:s,scaleY:r,x:o,y:i}=n,l=e.left-o-(1-s)*parseFloat(a),c=e.top-i-(1-r)*parseFloat(a.slice(a.indexOf(" ")+1)),d=s?e.width/s:e.width,u=r?e.height/r:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(a,t,n))}const{top:n,left:s,width:r,height:o,bottom:i,right:l}=a;return{top:n,left:s,width:r,height:o,bottom:i,right:l}}function _c(e){return mc(e,{ignoreTransform:!0})}function hc(e,t){const a=[];return e?function n(s){if(null!=t&&a.length>=t)return a;if(!s)return a;if(wl(s)&&null!=s.scrollingElement&&!a.includes(s.scrollingElement))return a.push(s.scrollingElement),a;if(!Ml(s)||Ll(s))return a;if(a.includes(s))return a;const r=xl(e).getComputedStyle(s) | |
| 726 | -;return s!==e&&function(e,t){void 0===t&&(t=xl(e).getComputedStyle(e));const a=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const n=t[e];return"string"==typeof n&&a.test(n)})}(s,r)&&a.push(s),function(e,t){return void 0===t&&(t=xl(e).getComputedStyle(e)),"fixed"===t.position}(s,r)?a:n(s.parentNode)}(e):a}function pc(e){const[t]=hc(e,1);return null!=t?t:null}function fc(e){return yl&&e?kl(e)?e:vl(e)?wl(e)||e===jl(e).scrollingElement?window:Ml(e)?e:null:null:null}function bc(e){return kl(e)?e.scrollX:e.scrollLeft}function gc(e){return kl(e)?e.scrollY:e.scrollTop}function yc(e){return{x:bc(e),y:gc(e)}}var kc;function vc(e){return!(!yl||!e)&&e===document.scrollingElement}function xc(e){const t={x:0,y:0},a=vc(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-a.width,y:e.scrollHeight-a.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y, | |
| 727 | -isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(kc||(kc={}));const wc={x:.2,y:.2};function Mc(e,t,a,n,s){let{top:r,left:o,right:i,bottom:l}=a;void 0===n&&(n=10),void 0===s&&(s=wc);const{isTop:c,isBottom:d,isLeft:u,isRight:m}=xc(e),_={x:0,y:0},h={x:0,y:0},p=t.height*s.y,f=t.width*s.x;return!c&&r<=t.top+p?(_.y=kc.Backward,h.y=n*Math.abs((t.top+p-r)/p)):!d&&l>=t.bottom-p&&(_.y=kc.Forward,h.y=n*Math.abs((t.bottom-p-l)/p)),!m&&i>=t.right-f?(_.x=kc.Forward,h.x=n*Math.abs((t.right-f-i)/f)):!u&&o<=t.left+f&&(_.x=kc.Backward,h.x=n*Math.abs((t.left+f-o)/f)),{direction:_,speed:h}}function Lc(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:a,right:n,bottom:s}=e.getBoundingClientRect();return{top:t,left:a,right:n,bottom:s,width:e.clientWidth,height:e.clientHeight}}function jc(e){return e.reduce((e,t)=>Pl(e,yc(t)),Zl)} | |
| 728 | -function Sc(e,t){if(void 0===t&&(t=mc),!e)return;const{top:a,left:n,bottom:s,right:r}=t(e);pc(e)&&(s<=0||r<=0||a>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Yc=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+bc(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+gc(t),0)}]];class Dc{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const a=hc(t),n=jc(a);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,s]of Yc)for(const r of t)Object.defineProperty(this,r,{get:()=>{const t=s(a),o=n[e]-t;return this.rect[r]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Tc{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,a){var n | |
| 729 | -;null==(n=this.target)||n.addEventListener(e,t,a),this.listeners.push([e,t,a])}}function Cc(e,t){const a=Math.abs(e.x),n=Math.abs(e.y);return"number"==typeof t?Math.sqrt(a**2+n**2)>t:"x"in t&&"y"in t?a>t.x&&n>t.y:"x"in t?a>t.x:"y"in t&&n>t.y}var Nc,Ec;function Oc(e){e.preventDefault()}function Ac(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Nc||(Nc={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Ec||(Ec={}));const Pc={start:[Ec.Space,Ec.Enter],cancel:[Ec.Esc],end:[Ec.Space,Ec.Enter,Ec.Tab]},Hc=(e,t)=>{let{currentCoordinates:a}=t;switch(e.code){case Ec.Right:return{...a,x:a.x+25};case Ec.Left:return{...a,x:a.x-25};case Ec.Down:return{...a,y:a.y+25};case Ec.Up:return{...a,y:a.y-25}}};class Rc{constructor(e){ | |
| 730 | -this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Tc(jl(t)),this.windowListeners=new Tc(xl(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Nc.Resize,this.handleCancel),this.windowListeners.add(Nc.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Nc.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,a=e.node.current;a&&Sc(a),t(Zl)}handleKeyDown(e){if(Rl(e)){const{active:t,context:a,options:n}=this.props,{keyboardCodes:s=Pc,coordinateGetter:r=Hc,scrollBehavior:o="smooth"}=n,{code:i}=e;if(s.end.includes(i))return void this.handleEnd(e);if(s.cancel.includes(i))return void this.handleCancel(e);const{collisionRect:l}=a.current,c=l?{x:l.left,y:l.top}:Zl | |
| 731 | -;this.referenceCoordinates||(this.referenceCoordinates=c);const d=r(e,{active:t,context:a.current,currentCoordinates:c});if(d){const t=Hl(d,c),n={x:0,y:0},{scrollableAncestors:s}=a.current;for(const a of s){const s=e.code,{isTop:r,isRight:i,isLeft:l,isBottom:c,maxScroll:u,minScroll:m}=xc(a),_=Lc(a),h={x:Math.min(s===Ec.Right?_.right-_.width/2:_.right,Math.max(s===Ec.Right?_.left:_.left+_.width/2,d.x)),y:Math.min(s===Ec.Down?_.bottom-_.height/2:_.bottom,Math.max(s===Ec.Down?_.top:_.top+_.height/2,d.y))},p=s===Ec.Right&&!i||s===Ec.Left&&!l,f=s===Ec.Down&&!c||s===Ec.Up&&!r;if(p&&h.x!==d.x){const e=a.scrollLeft+t.x,r=s===Ec.Right&&e<=u.x||s===Ec.Left&&e>=m.x;if(r&&!t.y)return void a.scrollTo({left:e,behavior:o});n.x=r?a.scrollLeft-e:s===Ec.Right?a.scrollLeft-u.x:a.scrollLeft-m.x,n.x&&a.scrollBy({left:-n.x,behavior:o});break}if(f&&h.y!==d.y){const e=a.scrollTop+t.y,r=s===Ec.Down&&e<=u.y||s===Ec.Up&&e>=m.y;if(r&&!t.x)return void a.scrollTo({top:e,behavior:o}) | |
| 732 | -;n.y=r?a.scrollTop-e:s===Ec.Down?a.scrollTop-u.y:a.scrollTop-m.y,n.y&&a.scrollBy({top:-n.y,behavior:o});break}}this.handleMove(e,Pl(Hl(d,this.referenceCoordinates),n))}}}handleMove(e,t){const{onMove:a}=this.props;e.preventDefault(),a(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Ic(e){return Boolean(e&&"distance"in e)}function Fc(e){return Boolean(e&&"delay"in e)}Rc.activators=[{eventName:"onKeyDown",handler:(e,t,a)=>{let{keyboardCodes:n=Pc,onActivation:s}=t,{active:r}=a;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const t=r.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==s||s({event:e.nativeEvent}),0))}return!1}}];class Wc{constructor(e,t,a){var n;void 0===a&&(a=function(e){const{EventTarget:t}=xl(e);return e instanceof t?e:jl(e)}(e.event.target)), | |
| 733 | -this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:s}=e,{target:r}=s;this.props=e,this.events=t,this.document=jl(r),this.documentListeners=new Tc(this.document),this.listeners=new Tc(a),this.windowListeners=new Tc(xl(r)),this.initialCoordinates=null!=(n=Il(s))?n:Zl,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:a}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd), | |
| 734 | -e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Nc.Resize,this.handleCancel),this.windowListeners.add(Nc.DragStart,Oc),this.windowListeners.add(Nc.VisibilityChange,this.handleCancel),this.windowListeners.add(Nc.ContextMenu,Oc),this.documentListeners.add(Nc.Keydown,this.handleKeydown),t){if(null!=a&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Fc(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Ic(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:a,onPending:n}=this.props;n(a,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0, | |
| 735 | -this.documentListeners.add(Nc.Click,Ac,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Nc.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:a,initialCoordinates:n,props:s}=this,{onMove:r,options:{activationConstraint:o}}=s;if(!n)return;const i=null!=(t=Il(e))?t:Zl,l=Hl(n,i);if(!a&&o){if(Ic(o)){if(null!=o.tolerance&&Cc(l,o.tolerance))return this.handleCancel();if(Cc(l,o.distance))return this.handleStart()}return Fc(o)&&Cc(l,o.tolerance)?this.handleCancel():void this.handlePending(o,l)}e.cancelable&&e.preventDefault(),r(i)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Ec.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const zc={cancel:{name:"pointercancel"},move:{name:"pointermove" | |
| 736 | -},end:{name:"pointerup"}};class Uc extends Wc{constructor(e){const{event:t}=e,a=jl(t.target);super(e,zc,a)}}Uc.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:a}=e,{onActivation:n}=t;return!(!a.isPrimary||0!==a.button||(null==n||n({event:a}),0))}}];const Bc={move:{name:"mousemove"},end:{name:"mouseup"}};var Vc;!function(e){e[e.RightClick=2]="RightClick"}(Vc||(Vc={})),class extends Wc{constructor(e){super(e,Bc,jl(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:a}=e,{onActivation:n}=t;return a.button!==Vc.RightClick&&(null==n||n({event:a}),!0)}}];const $c={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var qc,Jc;(class extends Wc{constructor(e){super(e,$c)}static setup(){return window.addEventListener($c.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener($c.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{ | |
| 737 | -let{nativeEvent:a}=e,{onActivation:n}=t;const{touches:s}=a;return!(s.length>1||(null==n||n({event:a}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(qc||(qc={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Jc||(Jc={}));const Gc={x:{[kc.Backward]:!1,[kc.Forward]:!1},y:{[kc.Backward]:!1,[kc.Forward]:!1}};var Kc,Xc;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Kc||(Kc={})),function(e){e.Optimized="optimized"}(Xc||(Xc={}));const Zc=new Map;function Qc(e,t){return Tl(a=>e?a||("function"==typeof t?t(e):e):null,[t,e])}function ed(e){let{callback:t,disabled:n}=e;const s=Yl(t),r=(0,a.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(s)},[n]);return(0,a.useEffect)(()=>()=>null==r?void 0:r.disconnect(),[r]),r}function td(e){return new Dc(mc(e),e)}function ad(e,t,n){ | |
| 738 | -void 0===t&&(t=td);const[s,r]=(0,a.useState)(null);function o(){r(a=>{if(!e)return null;var s;if(!1===e.isConnected)return null!=(s=null!=a?a:n)?s:null;const r=t(e);return JSON.stringify(a)===JSON.stringify(r)?a:r})}const i=function(e){let{callback:t,disabled:n}=e;const s=Yl(t),r=(0,a.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(s)},[s,n]);return(0,a.useEffect)(()=>()=>null==r?void 0:r.disconnect(),[r]),r}({callback(t){if(e)for(const a of t){const{type:t,target:n}=a;if("childList"===t&&n instanceof HTMLElement&&n.contains(e)){o();break}}}}),l=ed({callback:o});return Sl(()=>{o(),e?(null==l||l.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==i||i.disconnect())},[e]),s}const nd=[];function sd(e,t){void 0===t&&(t=[]);const n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{n.current=null},t),(0,a.useEffect)(()=>{const t=e!==Zl | |
| 739 | -;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Hl(e,n.current):Zl}function rd(e){return(0,a.useMemo)(()=>e?function(e){const t=e.innerWidth,a=e.innerHeight;return{top:0,left:0,right:t,bottom:a,width:t,height:a}}(e):null,[e])}const od=[];function id(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ml(t)?t:e}const ld=[{sensor:Uc,options:{}},{sensor:Rc,options:{}}],cd={current:{}},dd={draggable:{measure:_c},droppable:{measure:_c,strategy:Kc.WhileDragging,frequency:Xc.Optimized},dragOverlay:{measure:mc}};class ud extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,a;return null!=(t=null==(a=this.get(e))?void 0:a.node.current)?t:void 0}}const md={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null, | |
| 740 | -draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ud,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Xl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:dd,measureDroppableContainers:Xl,windowRect:null,measuringScheduled:!1},_d={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Xl,draggableNodes:new Map,over:null,measureDroppableContainers:Xl},hd=(0,a.createContext)(_d),pd=(0,a.createContext)(md);function fd(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ud}}}function bd(e,t){switch(t.type){case Kl.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Kl.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}} | |
| 741 | -};case Kl.DragEnd:case Kl.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Kl.RegisterDroppable:{const{element:a}=t,{id:n}=a,s=new ud(e.droppable.containers);return s.set(n,a),{...e,droppable:{...e.droppable,containers:s}}}case Kl.SetDroppableDisabled:{const{id:a,key:n,disabled:s}=t,r=e.droppable.containers.get(a);if(!r||n!==r.key)return e;const o=new ud(e.droppable.containers);return o.set(a,{...r,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case Kl.UnregisterDroppable:{const{id:a,key:n}=t,s=e.droppable.containers.get(a);if(!s||n!==s.key)return e;const r=new ud(e.droppable.containers);return r.delete(a),{...e,droppable:{...e.droppable,containers:r}}}default:return e}}function gd(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:r}=(0,a.useContext)(hd),o=Nl(s),i=Nl(null==n?void 0:n.id);return(0,a.useEffect)(()=>{if(!t&&!s&&o&&null!=i){if(!Rl(o))return | |
| 742 | -;if(document.activeElement===o.target)return;const e=r.get(i);if(!e)return;const{activatorNode:t,node:a}=e;if(!t.current&&!a.current)return;requestAnimationFrame(()=>{for(const e of[t.current,a.current]){if(!e)continue;const t=zl(e);if(t){t.focus();break}}})}},[s,t,r,i,o]),null}function yd(e,t){let{transform:a,...n}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...n}),a):a}const kd=(0,a.createContext)({...Zl,scaleX:1,scaleY:1});var vd;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(vd||(vd={}));const xd=(0,a.memo)(function(e){var t,s,r,o;let{id:i,accessibility:l,autoScroll:c=!0,children:d,sensors:u=ld,collisionDetection:m=oc,measuring:_,modifiers:h,...p}=e;const f=(0,a.useReducer)(bd,void 0,fd),[b,g]=f,[y,k]=function(){const[e]=(0,a.useState)(()=>new Set),t=(0,a.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]),n=(0,a.useCallback)(t=>{let{type:a,event:n}=t;e.forEach(e=>{var t | |
| 743 | -;return null==(t=e[a])?void 0:t.call(e,n)})},[e]);return[n,t]}(),[v,x]=(0,a.useState)(vd.Uninitialized),w=v===vd.Initialized,{draggable:{active:M,nodes:L,translate:j},droppable:{containers:S}}=b,Y=null!=M?L.get(M):null,D=(0,a.useRef)({initial:null,translated:null}),T=(0,a.useMemo)(()=>{var e;return null!=M?{id:M,data:null!=(e=null==Y?void 0:Y.data)?e:cd,rect:D}:null},[M,Y]),C=(0,a.useRef)(null),[N,E]=(0,a.useState)(null),[O,A]=(0,a.useState)(null),P=Dl(p,Object.values(p)),H=Ol("DndDescribedBy",i),R=(0,a.useMemo)(()=>S.getEnabled(),[S]),I=function(e){return(0,a.useMemo)(()=>({draggable:{...dd.draggable,...null==e?void 0:e.draggable},droppable:{...dd.droppable,...null==e?void 0:e.droppable},dragOverlay:{...dd.dragOverlay,...null==e?void 0:e.dragOverlay}}),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(_),{droppableRects:F,measureDroppableContainers:W,measuringScheduled:z}=function(e,t){let{dragging:n,dependencies:s,config:r}=t;const[o,i]=(0, | |
| 744 | -a.useState)(null),{frequency:l,measure:c,strategy:d}=r,u=(0,a.useRef)(e),m=function(){switch(d){case Kc.Always:return!1;case Kc.BeforeDragging:return n;default:return!n}}(),_=Dl(m),h=(0,a.useCallback)(function(e){void 0===e&&(e=[]),_.current||i(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[_]),p=(0,a.useRef)(null),f=Tl(t=>{if(m&&!n)return Zc;if(!t||t===Zc||u.current!==e||null!=o){const t=new Map;for(let a of e){if(!a)continue;if(o&&o.length>0&&!o.includes(a.id)&&a.rect.current){t.set(a.id,a.rect.current);continue}const e=a.node.current,n=e?new Dc(c(e),e):null;a.rect.current=n,n&&t.set(a.id,n)}return t}return t},[e,o,n,m,c]);return(0,a.useEffect)(()=>{u.current=e},[e]),(0,a.useEffect)(()=>{m||h()},[n,m]),(0,a.useEffect)(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),(0,a.useEffect)(()=>{m||"number"!=typeof l||null!==p.current||(p.current=setTimeout(()=>{h(),p.current=null},l))},[l,m,h,...s]),{droppableRects:f,measureDroppableContainers:h,measuringScheduled:null!=o}}(R,{ | |
| 745 | -dragging:w,dependencies:[j.x,j.y],config:I.droppable}),U=function(e,t){const a=null!=t?e.get(t):void 0,n=a?a.node.current:null;return Tl(e=>{var a;return null==t?null:null!=(a=null!=n?n:e)?a:null},[n,t])}(L,M),B=(0,a.useMemo)(()=>O?Il(O):null,[O]),V=function(){const e=!1===(null==N?void 0:N.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,a=w&&!e&&!t;return"object"==typeof c?{...c,enabled:a}:{enabled:a}}(),$=function(e,t){return Qc(e,t)}(U,I.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:s,config:r=!0}=e;const o=(0,a.useRef)(!1),{x:i,y:l}="boolean"==typeof r?{x:r,y:r}:r;Sl(()=>{if(!i&&!l||!t)return void(o.current=!1);if(o.current||!s)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const a=ic(n(e),s);if(i||(a.x=0),l||(a.y=0),o.current=!0,Math.abs(a.x)>0||Math.abs(a.y)>0){const t=pc(e);t&&t.scrollBy({top:a.y,left:a.x})}},[t,i,l,s,n])}({activeNode:null!=M?L.get(M):null,config:V.layoutShiftCompensation,initialRect:$, | |
| 746 | -measure:I.draggable.measure});const q=ad(U,I.draggable.measure,$),J=ad(U?U.parentElement:null),G=(0,a.useRef)({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),K=S.getNodeFor(null==(t=G.current.over)?void 0:t.id),X=function(e){let{measure:t}=e;const[n,s]=(0,a.useState)(null),r=ed({callback:(0,a.useCallback)(e=>{for(const{target:a}of e)if(Ml(a)){s(e=>{const n=t(a);return e?{...e,width:n.width,height:n.height}:n});break}},[t])}),o=(0,a.useCallback)(e=>{const a=id(e);null==r||r.disconnect(),a&&(null==r||r.observe(a)),s(a?t(a):null)},[t,r]),[i,l]=Cl(o);return(0,a.useMemo)(()=>({nodeRef:i,rect:n,setRef:l}),[n,i,l])}({measure:I.dragOverlay.measure}),Z=null!=(s=X.nodeRef.current)?s:U,Q=w?null!=(r=X.rect)?r:q:null,ee=Boolean(X.nodeRef.current&&X.rect),te=ic(ae=ee?null:q,Qc(ae));var ae | |
| 747 | -;const ne=rd(Z?xl(Z):null),se=function(e){const t=(0,a.useRef)(e),n=Tl(a=>e?a&&a!==nd&&e&&t.current&&e.parentNode===t.current.parentNode?a:hc(e):nd,[e]);return(0,a.useEffect)(()=>{t.current=e},[e]),n}(w?null!=K?K:U:null),re=function(e,t){void 0===t&&(t=mc);const[n]=e,s=rd(n?xl(n):null),[r,o]=(0,a.useState)(od);function i(){o(()=>e.length?e.map(e=>vc(e)?s:new Dc(t(e),e)):od)}const l=ed({callback:i});return Sl(()=>{null==l||l.disconnect(),i(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),r}(se),oe=yd(h,{transform:{x:j.x-te.x,y:j.y-te.y,scaleX:1,scaleY:1},activatorEvent:O,active:T,activeNodeRect:q,containerNodeRect:J,draggingNodeRect:Q,over:G.current.over,overlayNodeRect:X.rect,scrollableAncestors:se,scrollableAncestorRects:re,windowRect:ne}),ie=B?Pl(B,j):null,le=function(e){const[t,n]=(0,a.useState)(null),s=(0,a.useRef)(e),r=(0,a.useCallback)(e=>{const t=fc(e.target);t&&n(e=>e?(e.set(t,yc(t)),new Map(e)):null)},[]);return(0,a.useEffect)(()=>{const t=s.current;if(e!==t){a(t) | |
| 748 | -;const o=e.map(e=>{const t=fc(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,yc(t)]):null}).filter(e=>null!=e);n(o.length?new Map(o):null),s.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{const t=fc(e);null==t||t.removeEventListener("scroll",r)})}},[r,e]),(0,a.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Pl(e,t),Zl):jc(e):Zl,[e,t])}(se),ce=sd(le),de=sd(le,[q]),ue=Pl(oe,ce),me=Q?cc(Q,oe):null,_e=T&&me?m({active:T,collisionRect:me,droppableRects:F,droppableContainers:R,pointerCoordinates:ie}):null,he=function(e){if(!e||0===e.length)return null;const[t]=e;return t.id}(_e),[pe,fe]=(0,a.useState)(null),be=function(e,t,a){return{...e,scaleX:t&&a?t.width/a.width:1,scaleY:t&&a?t.height/a.height:1}}(ee?oe:Pl(oe,de),null!=(o=null==pe?void 0:pe.rect)?o:null,q),ge=(0,a.useRef)(null),ye=(0,a.useCallback)((e,t)=>{let{sensor:a,options:n}=t;if(null==C.current)return;const s=L.get(C.current);if(!s)return;const r=e.nativeEvent,o=new a({active:C.current, | |
| 749 | -activeNode:s,event:r,options:n,context:G,onAbort(e){if(!L.get(e))return;const{onDragAbort:t}=P.current,a={id:e};null==t||t(a),y({type:"onDragAbort",event:a})},onPending(e,t,a,n){if(!L.get(e))return;const{onDragPending:s}=P.current,r={id:e,constraint:t,initialCoordinates:a,offset:n};null==s||s(r),y({type:"onDragPending",event:r})},onStart(e){const t=C.current;if(null==t)return;const a=L.get(t);if(!a)return;const{onDragStart:n}=P.current,s={activatorEvent:r,active:{id:t,data:a.data,rect:D}};(0,jr.unstable_batchedUpdates)(()=>{null==n||n(s),x(vd.Initializing),g({type:Kl.DragStart,initialCoordinates:e,active:t}),y({type:"onDragStart",event:s}),E(ge.current),A(r)})},onMove(e){g({type:Kl.DragMove,coordinates:e})},onEnd:i(Kl.DragEnd),onCancel:i(Kl.DragCancel)});function i(e){return async function(){const{active:t,collisions:a,over:n,scrollAdjustedTranslate:s}=G.current;let o=null;if(t&&s){const{cancelDrop:i}=P.current;o={activatorEvent:r,active:t,collisions:a,delta:s,over:n}, | |
| 750 | -e===Kl.DragEnd&&"function"==typeof i&&await Promise.resolve(i(o))&&(e=Kl.DragCancel)}C.current=null,(0,jr.unstable_batchedUpdates)(()=>{g({type:e}),x(vd.Uninitialized),fe(null),E(null),A(null),ge.current=null;const t=e===Kl.DragEnd?"onDragEnd":"onDragCancel";if(o){const e=P.current[t];null==e||e(o),y({type:t,event:o})}})}}ge.current=o},[L]),ke=(0,a.useCallback)((e,t)=>(a,n)=>{const s=a.nativeEvent,r=L.get(n);if(null!==C.current||!r||s.dndKit||s.defaultPrevented)return;const o={active:r};!0===e(a,t.options,o)&&(s.dndKit={capturedBy:t.sensor},C.current=n,ye(a,t))},[L,ye]),ve=function(e,t){return(0,a.useMemo)(()=>e.reduce((e,a)=>{const{sensor:n}=a;return[...e,...n.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,a)}))]},[]),[e,t])}(u,ke);!function(e){(0,a.useEffect)(()=>{if(!yl)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(u),Sl(()=>{ | |
| 751 | -q&&v===vd.Initializing&&x(vd.Initialized)},[q,v]),(0,a.useEffect)(()=>{const{onDragMove:e}=P.current,{active:t,activatorEvent:a,collisions:n,over:s}=G.current;if(!t||!a)return;const r={active:t,activatorEvent:a,collisions:n,delta:{x:ue.x,y:ue.y},over:s};(0,jr.unstable_batchedUpdates)(()=>{null==e||e(r),y({type:"onDragMove",event:r})})},[ue.x,ue.y]),(0,a.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:a,droppableContainers:n,scrollAdjustedTranslate:s}=G.current;if(!e||null==C.current||!t||!s)return;const{onDragOver:r}=P.current,o=n.get(he),i=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,l={active:e,activatorEvent:t,collisions:a,delta:{x:s.x,y:s.y},over:i};(0,jr.unstable_batchedUpdates)(()=>{fe(i),null==r||r(l),y({type:"onDragOver",event:l})})},[he]),Sl(()=>{G.current={activatorEvent:O,active:T,activeNode:U,collisionRect:me,collisions:_e,droppableRects:F,draggableNodes:L,draggingNode:Z,draggingNodeRect:Q,droppableContainers:S,over:pe, | |
| 752 | -scrollableAncestors:se,scrollAdjustedTranslate:ue},D.current={initial:Q,translated:me}},[T,U,_e,me,L,Z,Q,F,S,pe,se,ue]),function(e){let{acceleration:t,activator:n=qc.Pointer,canScroll:s,draggingRect:r,enabled:o,interval:i=5,order:l=Jc.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:m,threshold:_}=e;const h=function(e){let{delta:t,disabled:a}=e;const n=Nl(t);return Tl(e=>{if(a||!n||!e)return Gc;const s=Math.sign(t.x-n.x),r=Math.sign(t.y-n.y);return{x:{[kc.Backward]:e.x[kc.Backward]||-1===s,[kc.Forward]:e.x[kc.Forward]||1===s},y:{[kc.Backward]:e.y[kc.Backward]||-1===r,[kc.Forward]:e.y[kc.Forward]||1===r}}},[a,t,n])}({delta:m,disabled:!o}),[p,f]=function(){const e=(0,a.useRef)(null);return[(0,a.useCallback)((t,a)=>{e.current=setInterval(t,a)},[]),(0,a.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),b=(0,a.useRef)({x:0,y:0}),g=(0,a.useRef)({x:0,y:0}),y=(0,a.useMemo)(()=>{switch(n){case qc.Pointer:return c?{top:c.y, | |
| 753 | -bottom:c.y,left:c.x,right:c.x}:null;case qc.DraggableRect:return r}},[n,r,c]),k=(0,a.useRef)(null),v=(0,a.useCallback)(()=>{const e=k.current;if(!e)return;const t=b.current.x*g.current.x,a=b.current.y*g.current.y;e.scrollBy(t,a)},[]),x=(0,a.useMemo)(()=>l===Jc.TreeOrder?[...d].reverse():d,[l,d]);(0,a.useEffect)(()=>{if(o&&d.length&&y){for(const e of x){if(!1===(null==s?void 0:s(e)))continue;const a=d.indexOf(e),n=u[a];if(!n)continue;const{direction:r,speed:o}=Mc(e,n,y,t,_);for(const e of["x","y"])h[e][r[e]]||(o[e]=0,r[e]=0);if(o.x>0||o.y>0)return f(),k.current=e,p(v,i),b.current=o,void(g.current=r)}b.current={x:0,y:0},g.current={x:0,y:0},f()}else f()},[t,v,s,f,o,i,JSON.stringify(y),JSON.stringify(h),p,d,x,u,JSON.stringify(_)])}({...V,delta:j,draggingRect:me,pointerCoordinates:ie,scrollableAncestors:se,scrollableAncestorRects:re});const xe=(0,a.useMemo)(()=>({active:T,activeNode:U,activeNodeRect:q,activatorEvent:O,collisions:_e,containerNodeRect:J,dragOverlay:X,draggableNodes:L, | |
| 754 | -droppableContainers:S,droppableRects:F,over:pe,measureDroppableContainers:W,scrollableAncestors:se,scrollableAncestorRects:re,measuringConfiguration:I,measuringScheduled:z,windowRect:ne}),[T,U,q,O,_e,J,X,L,S,F,pe,W,se,re,I,z,ne]),we=(0,a.useMemo)(()=>({activatorEvent:O,activators:ve,active:T,activeNodeRect:q,ariaDescribedById:{draggable:H},dispatch:g,draggableNodes:L,over:pe,measureDroppableContainers:W}),[O,ve,T,q,g,H,L,pe,W]);return n().createElement($l.Provider,{value:k},n().createElement(hd.Provider,{value:we},n().createElement(pd.Provider,{value:xe},n().createElement(kd.Provider,{value:be},d)),n().createElement(gd,{disabled:!1===(null==l?void 0:l.restoreFocus)})),n().createElement(Gl,{...l,hiddenTextDescribedById:H}))}),wd=(0,a.createContext)(null),Md="button";function Ld(){return(0,a.useContext)(pd)}const jd={timeout:25};function Sd(e){let{animation:t,children:s}=e;const[r,o]=(0,a.useState)(null),[i,l]=(0,a.useState)(null),c=Nl(s);return s||r||!c||o(c),Sl(()=>{if(!i)return | |
| 755 | -;const e=null==r?void 0:r.key,a=null==r?void 0:r.props.id;null!=e&&null!=a?Promise.resolve(t(a,i)).then(()=>{o(null)}):o(null)},[t,r,i]),n().createElement(n().Fragment,null,s,r?(0,a.cloneElement)(r,{ref:l}):null)}const Yd={x:0,y:0,scaleX:1,scaleY:1};function Dd(e){let{children:t}=e;return n().createElement(hd.Provider,{value:_d},n().createElement(kd.Provider,{value:Yd},t))}const Td={position:"fixed",touchAction:"none"},Cd=e=>Rl(e)?"transform 250ms ease":void 0,Nd=(0,a.forwardRef)((e,t)=>{let{as:a,activatorEvent:s,adjustScale:r,children:o,className:i,rect:l,style:c,transform:d,transition:u=Cd}=e;if(!l)return null;const m=r?d:{...d,scaleX:1,scaleY:1},_={...Td,width:l.width,height:l.height,top:l.top,left:l.left,transform:Fl.Transform.toString(m),transformOrigin:r&&s?ec(s,l):void 0,transition:"function"==typeof u?u(s):u,...c};return n().createElement(a,{className:i,style:_,ref:t},o)}),Ed=e=>t=>{let{active:a,dragOverlay:n}=t;const s={},{styles:r,className:o}=e | |
| 756 | -;if(null!=r&&r.active)for(const[e,t]of Object.entries(r.active))void 0!==t&&(s[e]=a.node.style.getPropertyValue(e),a.node.style.setProperty(e,t));if(null!=r&&r.dragOverlay)for(const[e,t]of Object.entries(r.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return null!=o&&o.active&&a.node.classList.add(o.active),null!=o&&o.dragOverlay&&n.node.classList.add(o.dragOverlay),function(){for(const[e,t]of Object.entries(s))a.node.style.setProperty(e,t);null!=o&&o.active&&a.node.classList.remove(o.active)}},Od={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:a}}=e;return[{transform:Fl.Transform.toString(t)},{transform:Fl.Transform.toString(a)}]},sideEffects:Ed({styles:{active:{opacity:"0"}}})};let Ad=0;function Pd(e){return(0,a.useMemo)(()=>{if(null!=e)return Ad++,Ad},[e])}const Hd=n().memo(e=>{let{adjustScale:t=!1,children:s,dropAnimation:r,style:o,transition:i,modifiers:l,wrapperElement:c="div",className:d,zIndex:u=999}=e | |
| 757 | -;const{activatorEvent:m,active:_,activeNodeRect:h,containerNodeRect:p,draggableNodes:f,droppableContainers:b,dragOverlay:g,over:y,measuringConfiguration:k,scrollableAncestors:v,scrollableAncestorRects:x,windowRect:w}=Ld(),M=(0,a.useContext)(kd),L=Pd(null==_?void 0:_.id),j=yd(l,{activatorEvent:m,active:_,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:g.rect,over:y,overlayNodeRect:g.rect,scrollableAncestors:v,scrollableAncestorRects:x,transform:M,windowRect:w}),S=Qc(h),Y=function(e){let{config:t,draggableNodes:a,droppableContainers:n,measuringConfiguration:s}=e;return Yl((e,r)=>{if(null===t)return;const o=a.get(e);if(!o)return;const i=o.node.current;if(!i)return;const l=id(r);if(!l)return;const{transform:c}=xl(r).getComputedStyle(r),d=dc(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:a,sideEffects:n,keyframes:s}={...Od,...e};return e=>{let{active:r,dragOverlay:o,transform:i,...l}=e;if(!t)return | |
| 758 | -;const c=o.rect.left-r.rect.left,d=o.rect.top-r.rect.top,u={scaleX:1!==i.scaleX?r.rect.width*i.scaleX/o.rect.width:1,scaleY:1!==i.scaleY?r.rect.height*i.scaleY/o.rect.height:1},m={x:i.x-c,y:i.y-d,...u},_=s({...l,active:r,dragOverlay:o,transform:{initial:i,final:m}}),[h]=_,p=_[_.length-1];if(JSON.stringify(h)===JSON.stringify(p))return;const f=null==n?void 0:n({active:r,dragOverlay:o,...l}),b=o.node.animate(_,{duration:t,easing:a,fill:"forwards"});return new Promise(e=>{b.onfinish=()=>{null==f||f(),e()}})}}(t);return Sc(i,s.draggable.measure),u({active:{id:e,data:o.data,node:i,rect:s.draggable.measure(i)},draggableNodes:a,dragOverlay:{node:r,rect:s.dragOverlay.measure(l)},droppableContainers:n,measuringConfiguration:s,transform:d})})}({config:r,draggableNodes:f,droppableContainers:b,measuringConfiguration:k}),D=S?g.setRef:void 0;return n().createElement(Dd,null,n().createElement(Sd,{animation:Y},_&&L?n().createElement(Nd,{key:L,id:_.id,ref:D,as:c,activatorEvent:m,adjustScale:t, | |
| 759 | -className:d,transition:i,rect:S,style:{zIndex:u,...o},transform:j},s):null))});function Rd(e,t,a){const n=e.slice();return n.splice(a<0?n.length+a:a,0,n.splice(t,1)[0]),n}function Id(e,t){return e.reduce((e,a,n)=>{const s=t.get(a);return s&&(e[n]=s),e},Array(e.length))}function Fd(e){return null!==e&&e>=0}const Wd=e=>{let{rects:t,activeIndex:a,overIndex:n,index:s}=e;const r=Rd(t,n,a),o=t[s],i=r[s];return i&&o?{x:i.left-o.left,y:i.top-o.top,scaleX:i.width/o.width,scaleY:i.height/o.height}:null},zd={scaleX:1,scaleY:1},Ud=e=>{var t;let{activeIndex:a,activeNodeRect:n,index:s,rects:r,overIndex:o}=e;const i=null!=(t=r[a])?t:n;if(!i)return null;if(s===a){const e=r[o];return e?{x:0,y:a<o?e.top+e.height-(i.top+i.height):e.top-i.top,...zd}:null}const l=function(e,t,a){const n=e[t],s=e[t-1],r=e[t+1];return n?a<t?s?n.top-(s.top+s.height):r?r.top-(n.top+n.height):0:r?r.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}(r,s,a);return s>a&&s<=o?{x:0,y:-i.height-l,...zd}:s<a&&s>=o?{x:0,y:i.height+l, | |
| 760 | -...zd}:{x:0,y:0,...zd}},Bd="Sortable",Vd=n().createContext({activeIndex:-1,containerId:Bd,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Wd,disabled:{draggable:!1,droppable:!1}});function $d(e){let{children:t,id:s,items:r,strategy:o=Wd,disabled:i=!1}=e;const{active:l,dragOverlay:c,droppableRects:d,over:u,measureDroppableContainers:m}=Ld(),_=Ol(Bd,s),h=Boolean(null!==c.rect),p=(0,a.useMemo)(()=>r.map(e=>"object"==typeof e&&"id"in e?e.id:e),[r]),f=null!=l,b=l?p.indexOf(l.id):-1,g=u?p.indexOf(u.id):-1,y=(0,a.useRef)(p),k=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}(p,y.current),v=-1!==g&&-1===b||k,x=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(i);Sl(()=>{k&&f&&m(p)},[k,p,f,m]),(0,a.useEffect)(()=>{y.current=p},[p]);const w=(0,a.useMemo)(()=>({activeIndex:b,containerId:_,disabled:x,disableTransforms:v,items:p,overIndex:g,useDragOverlay:h, | |
| 761 | -sortedRects:Id(p,d),strategy:o}),[b,_,x.draggable,x.droppable,v,p,g,d,h,o]);return n().createElement(Vd.Provider,{value:w},t)}const qd=e=>{let{id:t,items:a,activeIndex:n,overIndex:s}=e;return Rd(a,n,s).indexOf(t)},Jd=e=>{let{containerId:t,isSorting:a,wasDragging:n,index:s,items:r,newIndex:o,previousItems:i,previousContainerId:l,transition:c}=e;return!(!c||!n||i!==r&&s===o||!a&&(o===s||t!==l))},Gd={duration:200,easing:"ease"},Kd="transform",Xd=Fl.Transition.toString({property:Kd,duration:0,easing:"linear"}),Zd={roleDescription:"sortable"};function Qd(e){let{animateLayoutChanges:t=Jd,attributes:n,disabled:s,data:r,getNewIndex:o=qd,id:i,strategy:l,resizeObserverConfig:c,transition:d=Gd}=e;const{items:u,containerId:m,activeIndex:_,disabled:h,disableTransforms:p,sortedRects:f,overIndex:b,useDragOverlay:g,strategy:y}=(0,a.useContext)(Vd),k=function(e,t){var a,n;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(a=null==e?void 0:e.draggable)?a:t.draggable, | |
| 762 | -droppable:null!=(n=null==e?void 0:e.droppable)?n:t.droppable}}(s,h),v=u.indexOf(i),x=(0,a.useMemo)(()=>({sortable:{containerId:m,index:v,items:u},...r}),[m,r,v,u]),w=(0,a.useMemo)(()=>u.slice(u.indexOf(i)),[u,i]),{rect:M,node:L,isOver:j,setNodeRef:S}=function(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:r}=e;const o=Ol("Droppable"),{active:i,dispatch:l,over:c,measureDroppableContainers:d}=(0,a.useContext)(hd),u=(0,a.useRef)({disabled:n}),m=(0,a.useRef)(!1),_=(0,a.useRef)(null),h=(0,a.useRef)(null),{disabled:p,updateMeasurementsFor:f,timeout:b}={...jd,...r},g=Dl(null!=f?f:s),y=ed({callback:(0,a.useCallback)(()=>{m.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(Array.isArray(g.current)?g.current:[g.current]),h.current=null},b)):m.current=!0},[b]),disabled:p||!i}),k=(0,a.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),m.current=!1),e&&y.observe(e))},[y]),[v,x]=Cl(k),w=Dl(t);return(0,a.useEffect)(()=>{y&&v.current&&(y.disconnect(),m.current=!1, | |
| 763 | -y.observe(v.current))},[v,y]),(0,a.useEffect)(()=>(l({type:Kl.RegisterDroppable,element:{id:s,key:o,disabled:n,node:v,rect:_,data:w}}),()=>l({type:Kl.UnregisterDroppable,key:o,id:s})),[s]),(0,a.useEffect)(()=>{n!==u.current.disabled&&(l({type:Kl.SetDroppableDisabled,id:s,key:o,disabled:n}),u.current.disabled=n)},[s,o,n,l]),{active:i,rect:_,isOver:(null==c?void 0:c.id)===s,node:v,over:c,setNodeRef:x}}({id:i,data:x,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...c}}),{active:Y,activatorEvent:D,activeNodeRect:T,attributes:C,setNodeRef:N,listeners:E,isDragging:O,over:A,setActivatorNodeRef:P,transform:H}=function(e){let{id:t,data:n,disabled:s=!1,attributes:r}=e;const o=Ol("Draggable"),{activators:i,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:m,over:_}=(0,a.useContext)(hd),{role:h=Md,roleDescription:p="draggable",tabIndex:f=0}=null!=r?r:{},b=(null==c?void 0:c.id)===t,g=(0,a.useContext)(b?kd:wd),[y,k]=Cl(),[v,x]=Cl(),w=function(e,t){ | |
| 764 | -return(0,a.useMemo)(()=>e.reduce((e,a)=>{let{eventName:n,handler:s}=a;return e[n]=e=>{s(e,t)},e},{}),[e,t])}(i,t),M=Dl(n);return Sl(()=>(m.set(t,{id:t,key:o,node:y,activatorNode:v,data:M}),()=>{const e=m.get(t);e&&e.key===o&&m.delete(t)}),[m,t]),{active:c,activatorEvent:l,activeNodeRect:d,attributes:(0,a.useMemo)(()=>({role:h,tabIndex:f,"aria-disabled":s,"aria-pressed":!(!b||h!==Md)||void 0,"aria-roledescription":p,"aria-describedby":u.draggable}),[s,h,f,b,p,u.draggable]),isDragging:b,listeners:s?void 0:w,node:y,over:_,setNodeRef:k,setActivatorNodeRef:x,transform:g}}({id:i,data:x,attributes:{...Zd,...n},disabled:k.draggable}),R=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}(S,N),I=Boolean(Y),F=I&&!p&&Fd(_)&&Fd(b),W=!g&&O,z=W&&F?H:null,U=F?null!=z?z:(null!=l?l:y)({rects:f,activeNodeRect:T,activeIndex:_,overIndex:b,index:v}):null,B=Fd(_)&&Fd(b)?o({id:i,items:u,activeIndex:_,overIndex:b | |
| 765 | -}):v,V=null==Y?void 0:Y.id,$=(0,a.useRef)({activeId:V,items:u,newIndex:B,containerId:m}),q=u!==$.current.items,J=t({active:Y,containerId:m,isDragging:O,isSorting:I,id:i,index:v,items:u,newIndex:$.current.newIndex,previousItems:$.current.items,previousContainerId:$.current.containerId,transition:d,wasDragging:null!=$.current.activeId}),G=function(e){let{disabled:t,index:n,node:s,rect:r}=e;const[o,i]=(0,a.useState)(null),l=(0,a.useRef)(n);return Sl(()=>{if(!t&&n!==l.current&&s.current){const e=r.current;if(e){const t=mc(s.current,{ignoreTransform:!0}),a={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(a.x||a.y)&&i(a)}}n!==l.current&&(l.current=n)},[t,n,s,r]),(0,a.useEffect)(()=>{o&&i(null)},[o]),o}({disabled:!J,index:v,node:L,rect:M});return(0,a.useEffect)(()=>{I&&$.current.newIndex!==B&&($.current.newIndex=B),m!==$.current.containerId&&($.current.containerId=m),u!==$.current.items&&($.current.items=u)},[I,B,m,u]),(0,a.useEffect)(()=>{ | |
| 766 | -if(V===$.current.activeId)return;if(null!=V&&null==$.current.activeId)return void($.current.activeId=V);const e=setTimeout(()=>{$.current.activeId=V},50);return()=>clearTimeout(e)},[V]),{active:Y,activeIndex:_,attributes:C,data:x,rect:M,index:v,newIndex:B,items:u,isOver:j,isSorting:I,isDragging:O,listeners:E,node:L,overIndex:b,over:A,setNodeRef:R,setActivatorNodeRef:P,setDroppableNodeRef:S,setDraggableNodeRef:N,transform:null!=G?G:U,transition:G||q&&$.current.newIndex===v?Xd:W&&!Rl(D)||!d?void 0:I||J?Fl.Transition.toString({...d,property:Kd}):void 0}}Ec.Down,Ec.Right,Ec.Up,Ec.Left;const eu={item:Aa().shape({page_id:Aa().number.isRequired,label:Aa().string,icon:Aa().string,slug:Aa().string,className:Aa().string,children:Aa().array}).isRequired,depth:Aa().number.isRequired,isDragging:Aa().bool.isRequired,setItems:Aa().func.isRequired,onAddChild:Aa().func.isRequired,onEditItem:Aa().func.isRequired,children:Aa().node,listeners:Aa().object,attributes:Aa().object} | |
| 767 | -;function tu({item:e,depth:t,isDragging:n,setItems:s,onAddChild:o,onEditItem:l,children:c,listeners:d,attributes:u}){const[m,_]=(0,a.useState)(!1),h=(0,a.useRef)(null),p=()=>{(0,i.In)({action:"link"===e?.type?"ablocks/delete_fronted_dashboard_link":"ablocks/delete_fronted_dashboard_page",slug:e?.slug,page_id:e?.page_id}).then(()=>{s(t=>{const a=t=>(t||[]).filter(t=>t.page_id!==e.page_id).map(e=>e.children?{...e,children:a(e.children)}:e);return a(t)})})};(0,a.useEffect)(()=>{if(!m)return;const e=e=>{h.current&&!h.current.contains(e.target)&&_(!1)},t=e=>{"Escape"===e.key&&_(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[m]);const f=0===t;return(0,S.jsxs)("div",{className:"ablocks-sub-pages-selected"+(n?" dragging":""),...u,style:{cursor:n?"grabbing":"default",background:n?"#f0f0f0":void 0,transition:"background 150ms ease",position:"relative", | |
| 718 | +(0,r.__)("Select a %s","ablocks"),t),name:e,value:m?b:k?.length&&k?.filter(e=>e.value===parseInt(b)),onChange:t=>p(e,m?t:t?t.value:0),onInputChange:w,options:k,maxMenuHeight:160,minMenuHeight:70,isSearchable:!0,isLoading:g,onMenuOpen:x,theme:e=>({...e,colors:{...e.colors,primary:"#6104ff"}}),styles:{control:e=>({...e,cursor:"pointer"})},isClearable:!0,isMulti:m}),u&&(0,S.jsx)("span",{className:"ablocks-desc",children:u})]})]})})}yl.propTypes=gl;const kl="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function vl(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function xl(e){return"nodeType"in e}function wl(e){var t,a;return e?vl(e)?e:xl(e)&&null!=(t=null==(a=e.ownerDocument)?void 0:a.defaultView)?t:window:window}function Ml(e){const{Document:t}=wl(e);return e instanceof t}function Ll(e){return!vl(e)&&e instanceof wl(e).HTMLElement}function jl(e){return e instanceof wl(e).SVGElement} | |
| 719 | +function Sl(e){return e?vl(e)?e.document:xl(e)?Ml(e)?e:Ll(e)||jl(e)?e.ownerDocument:document:document:document}const Yl=kl?a.useLayoutEffect:a.useEffect;function Dl(e){const t=(0,a.useRef)(e);return Yl(()=>{t.current=e}),(0,a.useCallback)(function(){for(var e=arguments.length,a=new Array(e),n=0;n<e;n++)a[n]=arguments[n];return null==t.current?void 0:t.current(...a)},[])}function Tl(e,t){void 0===t&&(t=[e]);const n=(0,a.useRef)(e);return Yl(()=>{n.current!==e&&(n.current=e)},t),n}function Cl(e,t){const n=(0,a.useRef)();return(0,a.useMemo)(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Nl(e){const t=Dl(e),n=(0,a.useRef)(null),s=(0,a.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,s]}function El(e){const t=(0,a.useRef)();return(0,a.useEffect)(()=>{t.current=e},[e]),t.current}let Ol={};function Al(e,t){return(0,a.useMemo)(()=>{if(t)return t;const a=null==Ol[e]?0:Ol[e]+1;return Ol[e]=a,e+"-"+a},[e,t])}function Pl(e){return function(t){ | |
| 720 | +for(var a=arguments.length,n=new Array(a>1?a-1:0),s=1;s<a;s++)n[s-1]=arguments[s];return n.reduce((t,a)=>{const n=Object.entries(a);for(const[a,s]of n){const n=t[a];null!=n&&(t[a]=n+e*s)}return t},{...t})}}const Hl=Pl(1),Rl=Pl(-1);function Il(e){if(!e)return!1;const{KeyboardEvent:t}=wl(e.target);return t&&e instanceof t}function Fl(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=wl(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:a}=e.touches[0];return{x:t,y:a}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:a}=e.changedTouches[0];return{x:t,y:a}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Wl=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:a}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(a?Math.round(a):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:a}=e;return"scaleX("+t+") scaleY("+a+")"}},Transform:{toString(e){ | |
| 721 | +if(e)return[Wl.Translate.toString(e),Wl.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:a,easing:n}=e;return t+" "+a+"ms "+n}}}),zl="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ul(e){return e.matches(zl)?e:e.querySelector(zl)}const Bl={display:"none"};function Vl(e){let{id:t,value:a}=e;return n().createElement("div",{id:t,style:Bl},a)}function $l(e){let{id:t,announcement:a,ariaLiveType:s="assertive"}=e;return n().createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":s,"aria-atomic":!0},a)}const ql=(0,a.createContext)(null),Jl={ | |
| 722 | +draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Gl={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:a}=e;return a?"Draggable item "+t.id+" was moved over droppable area "+a.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:a}=e;return a?"Draggable item "+t.id+" was dropped over droppable area "+a.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Kl(e){let{announcements:t=Gl,container:s,hiddenTextDescribedById:r,screenReaderInstructions:o=Jl}=e;const{announce:i,announcement:l}=function(){const[e,t]=(0,a.useState)("");return{announce:(0,a.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e} | |
| 723 | +}(),c=Al("DndLiveRegion"),[d,u]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{u(!0)},[]),function(e){const t=(0,a.useContext)(ql);(0,a.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}((0,a.useMemo)(()=>({onDragStart(e){let{active:a}=e;i(t.onDragStart({active:a}))},onDragMove(e){let{active:a,over:n}=e;t.onDragMove&&i(t.onDragMove({active:a,over:n}))},onDragOver(e){let{active:a,over:n}=e;i(t.onDragOver({active:a,over:n}))},onDragEnd(e){let{active:a,over:n}=e;i(t.onDragEnd({active:a,over:n}))},onDragCancel(e){let{active:a,over:n}=e;i(t.onDragCancel({active:a,over:n}))}}),[i,t])),!d)return null;const m=n().createElement(n().Fragment,null,n().createElement(Vl,{id:r,value:o.draggable}),n().createElement($l,{id:c,announcement:l}));return s?(0,jr.createPortal)(m,s):m}var Xl;function Zl(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver", | |
| 724 | +e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Xl||(Xl={}));const Ql=Object.freeze({x:0,y:0});function ec(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function tc(e,t){const a=Fl(e);return a?(a.x-t.left)/t.width*100+"% "+(a.y-t.top)/t.height*100+"%":"0 0"}function ac(e,t){let{data:{value:a}}=e,{data:{value:n}}=t;return a-n}function nc(e,t){let{data:{value:a}}=e,{data:{value:n}}=t;return n-a}function sc(e,t,a){return void 0===t&&(t=e.left),void 0===a&&(a=e.top),{x:t+.5*e.width,y:a+.5*e.height}}const rc=e=>{let{collisionRect:t,droppableRects:a,droppableContainers:n}=e;const s=sc(t,t.left,t.top),r=[];for(const e of n){const{id:t}=e,n=a.get(t);if(n){const a=ec(sc(n),s);r.push({id:t,data:{droppableContainer:e,value:a}})}}return r.sort(ac)};function oc(e,t){ | |
| 725 | +const a=Math.max(t.top,e.top),n=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),r=Math.min(t.top+t.height,e.top+e.height),o=s-n,i=r-a;if(n<s&&a<r){const a=t.width*t.height,n=e.width*e.height,s=o*i;return Number((s/(a+n-s)).toFixed(4))}return 0}const ic=e=>{let{collisionRect:t,droppableRects:a,droppableContainers:n}=e;const s=[];for(const e of n){const{id:n}=e,r=a.get(n);if(r){const a=oc(r,t);a>0&&s.push({id:n,data:{droppableContainer:e,value:a}})}}return s.sort(nc)};function lc(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ql}function cc(e){return function(t){for(var a=arguments.length,n=new Array(a>1?a-1:0),s=1;s<a;s++)n[s-1]=arguments[s];return n.reduce((t,a)=>({...t,top:t.top+e*a.y,bottom:t.bottom+e*a.y,left:t.left+e*a.x,right:t.right+e*a.x}),{...t})}}const dc=cc(1);function uc(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /) | |
| 726 | +;return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const mc={ignoreTransform:!1};function _c(e,t){void 0===t&&(t=mc);let a=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:n}=wl(e).getComputedStyle(e);t&&(a=function(e,t,a){const n=uc(t);if(!n)return e;const{scaleX:s,scaleY:r,x:o,y:i}=n,l=e.left-o-(1-s)*parseFloat(a),c=e.top-i-(1-r)*parseFloat(a.slice(a.indexOf(" ")+1)),d=s?e.width/s:e.width,u=r?e.height/r:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(a,t,n))}const{top:n,left:s,width:r,height:o,bottom:i,right:l}=a;return{top:n,left:s,width:r,height:o,bottom:i,right:l}}function hc(e){return _c(e,{ignoreTransform:!0})}function pc(e,t){const a=[];return e?function n(s){if(null!=t&&a.length>=t)return a;if(!s)return a;if(Ml(s)&&null!=s.scrollingElement&&!a.includes(s.scrollingElement))return a.push(s.scrollingElement),a;if(!Ll(s)||jl(s))return a;if(a.includes(s))return a;const r=wl(e).getComputedStyle(s) | |
| 727 | +;return s!==e&&function(e,t){void 0===t&&(t=wl(e).getComputedStyle(e));const a=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const n=t[e];return"string"==typeof n&&a.test(n)})}(s,r)&&a.push(s),function(e,t){return void 0===t&&(t=wl(e).getComputedStyle(e)),"fixed"===t.position}(s,r)?a:n(s.parentNode)}(e):a}function fc(e){const[t]=pc(e,1);return null!=t?t:null}function bc(e){return kl&&e?vl(e)?e:xl(e)?Ml(e)||e===Sl(e).scrollingElement?window:Ll(e)?e:null:null:null}function gc(e){return vl(e)?e.scrollX:e.scrollLeft}function yc(e){return vl(e)?e.scrollY:e.scrollTop}function kc(e){return{x:gc(e),y:yc(e)}}var vc;function xc(e){return!(!kl||!e)&&e===document.scrollingElement}function wc(e){const t={x:0,y:0},a=xc(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-a.width,y:e.scrollHeight-a.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y, | |
| 728 | +isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(vc||(vc={}));const Mc={x:.2,y:.2};function Lc(e,t,a,n,s){let{top:r,left:o,right:i,bottom:l}=a;void 0===n&&(n=10),void 0===s&&(s=Mc);const{isTop:c,isBottom:d,isLeft:u,isRight:m}=wc(e),_={x:0,y:0},h={x:0,y:0},p=t.height*s.y,f=t.width*s.x;return!c&&r<=t.top+p?(_.y=vc.Backward,h.y=n*Math.abs((t.top+p-r)/p)):!d&&l>=t.bottom-p&&(_.y=vc.Forward,h.y=n*Math.abs((t.bottom-p-l)/p)),!m&&i>=t.right-f?(_.x=vc.Forward,h.x=n*Math.abs((t.right-f-i)/f)):!u&&o<=t.left+f&&(_.x=vc.Backward,h.x=n*Math.abs((t.left+f-o)/f)),{direction:_,speed:h}}function jc(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:a,right:n,bottom:s}=e.getBoundingClientRect();return{top:t,left:a,right:n,bottom:s,width:e.clientWidth,height:e.clientHeight}}function Sc(e){return e.reduce((e,t)=>Hl(e,kc(t)),Ql)} | |
| 729 | +function Yc(e,t){if(void 0===t&&(t=_c),!e)return;const{top:a,left:n,bottom:s,right:r}=t(e);fc(e)&&(s<=0||r<=0||a>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Dc=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+gc(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+yc(t),0)}]];class Tc{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const a=pc(t),n=Sc(a);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,s]of Dc)for(const r of t)Object.defineProperty(this,r,{get:()=>{const t=s(a),o=n[e]-t;return this.rect[r]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Cc{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,a){var n | |
| 730 | +;null==(n=this.target)||n.addEventListener(e,t,a),this.listeners.push([e,t,a])}}function Nc(e,t){const a=Math.abs(e.x),n=Math.abs(e.y);return"number"==typeof t?Math.sqrt(a**2+n**2)>t:"x"in t&&"y"in t?a>t.x&&n>t.y:"x"in t?a>t.x:"y"in t&&n>t.y}var Ec,Oc;function Ac(e){e.preventDefault()}function Pc(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Ec||(Ec={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Oc||(Oc={}));const Hc={start:[Oc.Space,Oc.Enter],cancel:[Oc.Esc],end:[Oc.Space,Oc.Enter,Oc.Tab]},Rc=(e,t)=>{let{currentCoordinates:a}=t;switch(e.code){case Oc.Right:return{...a,x:a.x+25};case Oc.Left:return{...a,x:a.x-25};case Oc.Down:return{...a,y:a.y+25};case Oc.Up:return{...a,y:a.y-25}}};class Ic{constructor(e){ | |
| 731 | +this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Cc(Sl(t)),this.windowListeners=new Cc(wl(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ec.Resize,this.handleCancel),this.windowListeners.add(Ec.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ec.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,a=e.node.current;a&&Yc(a),t(Ql)}handleKeyDown(e){if(Il(e)){const{active:t,context:a,options:n}=this.props,{keyboardCodes:s=Hc,coordinateGetter:r=Rc,scrollBehavior:o="smooth"}=n,{code:i}=e;if(s.end.includes(i))return void this.handleEnd(e);if(s.cancel.includes(i))return void this.handleCancel(e);const{collisionRect:l}=a.current,c=l?{x:l.left,y:l.top}:Ql | |
| 732 | +;this.referenceCoordinates||(this.referenceCoordinates=c);const d=r(e,{active:t,context:a.current,currentCoordinates:c});if(d){const t=Rl(d,c),n={x:0,y:0},{scrollableAncestors:s}=a.current;for(const a of s){const s=e.code,{isTop:r,isRight:i,isLeft:l,isBottom:c,maxScroll:u,minScroll:m}=wc(a),_=jc(a),h={x:Math.min(s===Oc.Right?_.right-_.width/2:_.right,Math.max(s===Oc.Right?_.left:_.left+_.width/2,d.x)),y:Math.min(s===Oc.Down?_.bottom-_.height/2:_.bottom,Math.max(s===Oc.Down?_.top:_.top+_.height/2,d.y))},p=s===Oc.Right&&!i||s===Oc.Left&&!l,f=s===Oc.Down&&!c||s===Oc.Up&&!r;if(p&&h.x!==d.x){const e=a.scrollLeft+t.x,r=s===Oc.Right&&e<=u.x||s===Oc.Left&&e>=m.x;if(r&&!t.y)return void a.scrollTo({left:e,behavior:o});n.x=r?a.scrollLeft-e:s===Oc.Right?a.scrollLeft-u.x:a.scrollLeft-m.x,n.x&&a.scrollBy({left:-n.x,behavior:o});break}if(f&&h.y!==d.y){const e=a.scrollTop+t.y,r=s===Oc.Down&&e<=u.y||s===Oc.Up&&e>=m.y;if(r&&!t.x)return void a.scrollTo({top:e,behavior:o}) | |
| 733 | +;n.y=r?a.scrollTop-e:s===Oc.Down?a.scrollTop-u.y:a.scrollTop-m.y,n.y&&a.scrollBy({top:-n.y,behavior:o});break}}this.handleMove(e,Hl(Rl(d,this.referenceCoordinates),n))}}}handleMove(e,t){const{onMove:a}=this.props;e.preventDefault(),a(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Fc(e){return Boolean(e&&"distance"in e)}function Wc(e){return Boolean(e&&"delay"in e)}Ic.activators=[{eventName:"onKeyDown",handler:(e,t,a)=>{let{keyboardCodes:n=Hc,onActivation:s}=t,{active:r}=a;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const t=r.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==s||s({event:e.nativeEvent}),0))}return!1}}];class zc{constructor(e,t,a){var n;void 0===a&&(a=function(e){const{EventTarget:t}=wl(e);return e instanceof t?e:Sl(e)}(e.event.target)), | |
| 734 | +this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:s}=e,{target:r}=s;this.props=e,this.events=t,this.document=Sl(r),this.documentListeners=new Cc(this.document),this.listeners=new Cc(a),this.windowListeners=new Cc(wl(r)),this.initialCoordinates=null!=(n=Fl(s))?n:Ql,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:a}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd), | |
| 735 | +e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Ec.Resize,this.handleCancel),this.windowListeners.add(Ec.DragStart,Ac),this.windowListeners.add(Ec.VisibilityChange,this.handleCancel),this.windowListeners.add(Ec.ContextMenu,Ac),this.documentListeners.add(Ec.Keydown,this.handleKeydown),t){if(null!=a&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Wc(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Fc(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:a,onPending:n}=this.props;n(a,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0, | |
| 736 | +this.documentListeners.add(Ec.Click,Pc,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ec.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:a,initialCoordinates:n,props:s}=this,{onMove:r,options:{activationConstraint:o}}=s;if(!n)return;const i=null!=(t=Fl(e))?t:Ql,l=Rl(n,i);if(!a&&o){if(Fc(o)){if(null!=o.tolerance&&Nc(l,o.tolerance))return this.handleCancel();if(Nc(l,o.distance))return this.handleStart()}return Wc(o)&&Nc(l,o.tolerance)?this.handleCancel():void this.handlePending(o,l)}e.cancelable&&e.preventDefault(),r(i)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Oc.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Uc={cancel:{name:"pointercancel"},move:{name:"pointermove" | |
| 737 | +},end:{name:"pointerup"}};class Bc extends zc{constructor(e){const{event:t}=e,a=Sl(t.target);super(e,Uc,a)}}Bc.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:a}=e,{onActivation:n}=t;return!(!a.isPrimary||0!==a.button||(null==n||n({event:a}),0))}}];const Vc={move:{name:"mousemove"},end:{name:"mouseup"}};var $c;!function(e){e[e.RightClick=2]="RightClick"}($c||($c={})),class extends zc{constructor(e){super(e,Vc,Sl(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:a}=e,{onActivation:n}=t;return a.button!==$c.RightClick&&(null==n||n({event:a}),!0)}}];const qc={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Jc,Gc;(class extends zc{constructor(e){super(e,qc)}static setup(){return window.addEventListener(qc.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(qc.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{ | |
| 738 | +let{nativeEvent:a}=e,{onActivation:n}=t;const{touches:s}=a;return!(s.length>1||(null==n||n({event:a}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Jc||(Jc={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Gc||(Gc={}));const Kc={x:{[vc.Backward]:!1,[vc.Forward]:!1},y:{[vc.Backward]:!1,[vc.Forward]:!1}};var Xc,Zc;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Xc||(Xc={})),function(e){e.Optimized="optimized"}(Zc||(Zc={}));const Qc=new Map;function ed(e,t){return Cl(a=>e?a||("function"==typeof t?t(e):e):null,[t,e])}function td(e){let{callback:t,disabled:n}=e;const s=Dl(t),r=(0,a.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(s)},[n]);return(0,a.useEffect)(()=>()=>null==r?void 0:r.disconnect(),[r]),r}function ad(e){return new Tc(_c(e),e)}function nd(e,t,n){ | |
| 739 | +void 0===t&&(t=ad);const[s,r]=(0,a.useState)(null);function o(){r(a=>{if(!e)return null;var s;if(!1===e.isConnected)return null!=(s=null!=a?a:n)?s:null;const r=t(e);return JSON.stringify(a)===JSON.stringify(r)?a:r})}const i=function(e){let{callback:t,disabled:n}=e;const s=Dl(t),r=(0,a.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(s)},[s,n]);return(0,a.useEffect)(()=>()=>null==r?void 0:r.disconnect(),[r]),r}({callback(t){if(e)for(const a of t){const{type:t,target:n}=a;if("childList"===t&&n instanceof HTMLElement&&n.contains(e)){o();break}}}}),l=td({callback:o});return Yl(()=>{o(),e?(null==l||l.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==i||i.disconnect())},[e]),s}const sd=[];function rd(e,t){void 0===t&&(t=[]);const n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{n.current=null},t),(0,a.useEffect)(()=>{const t=e!==Ql | |
| 740 | +;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Rl(e,n.current):Ql}function od(e){return(0,a.useMemo)(()=>e?function(e){const t=e.innerWidth,a=e.innerHeight;return{top:0,left:0,right:t,bottom:a,width:t,height:a}}(e):null,[e])}const id=[];function ld(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ll(t)?t:e}const cd=[{sensor:Bc,options:{}},{sensor:Ic,options:{}}],dd={current:{}},ud={draggable:{measure:hc},droppable:{measure:hc,strategy:Xc.WhileDragging,frequency:Zc.Optimized},dragOverlay:{measure:_c}};class md extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,a;return null!=(t=null==(a=this.get(e))?void 0:a.node.current)?t:void 0}}const _d={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null, | |
| 741 | +draggableNodes:new Map,droppableRects:new Map,droppableContainers:new md,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Zl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ud,measureDroppableContainers:Zl,windowRect:null,measuringScheduled:!1},hd={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Zl,draggableNodes:new Map,over:null,measureDroppableContainers:Zl},pd=(0,a.createContext)(hd),fd=(0,a.createContext)(_d);function bd(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new md}}}function gd(e,t){switch(t.type){case Xl.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Xl.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}} | |
| 742 | +};case Xl.DragEnd:case Xl.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Xl.RegisterDroppable:{const{element:a}=t,{id:n}=a,s=new md(e.droppable.containers);return s.set(n,a),{...e,droppable:{...e.droppable,containers:s}}}case Xl.SetDroppableDisabled:{const{id:a,key:n,disabled:s}=t,r=e.droppable.containers.get(a);if(!r||n!==r.key)return e;const o=new md(e.droppable.containers);return o.set(a,{...r,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case Xl.UnregisterDroppable:{const{id:a,key:n}=t,s=e.droppable.containers.get(a);if(!s||n!==s.key)return e;const r=new md(e.droppable.containers);return r.delete(a),{...e,droppable:{...e.droppable,containers:r}}}default:return e}}function yd(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:r}=(0,a.useContext)(pd),o=El(s),i=El(null==n?void 0:n.id);return(0,a.useEffect)(()=>{if(!t&&!s&&o&&null!=i){if(!Il(o))return | |
| 743 | +;if(document.activeElement===o.target)return;const e=r.get(i);if(!e)return;const{activatorNode:t,node:a}=e;if(!t.current&&!a.current)return;requestAnimationFrame(()=>{for(const e of[t.current,a.current]){if(!e)continue;const t=Ul(e);if(t){t.focus();break}}})}},[s,t,r,i,o]),null}function kd(e,t){let{transform:a,...n}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...n}),a):a}const vd=(0,a.createContext)({...Ql,scaleX:1,scaleY:1});var xd;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(xd||(xd={}));const wd=(0,a.memo)(function(e){var t,s,r,o;let{id:i,accessibility:l,autoScroll:c=!0,children:d,sensors:u=cd,collisionDetection:m=ic,measuring:_,modifiers:h,...p}=e;const f=(0,a.useReducer)(gd,void 0,bd),[b,g]=f,[y,k]=function(){const[e]=(0,a.useState)(()=>new Set),t=(0,a.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]),n=(0,a.useCallback)(t=>{let{type:a,event:n}=t;e.forEach(e=>{var t | |
| 744 | +;return null==(t=e[a])?void 0:t.call(e,n)})},[e]);return[n,t]}(),[v,x]=(0,a.useState)(xd.Uninitialized),w=v===xd.Initialized,{draggable:{active:M,nodes:L,translate:j},droppable:{containers:S}}=b,Y=null!=M?L.get(M):null,D=(0,a.useRef)({initial:null,translated:null}),T=(0,a.useMemo)(()=>{var e;return null!=M?{id:M,data:null!=(e=null==Y?void 0:Y.data)?e:dd,rect:D}:null},[M,Y]),C=(0,a.useRef)(null),[N,E]=(0,a.useState)(null),[O,A]=(0,a.useState)(null),P=Tl(p,Object.values(p)),H=Al("DndDescribedBy",i),R=(0,a.useMemo)(()=>S.getEnabled(),[S]),I=function(e){return(0,a.useMemo)(()=>({draggable:{...ud.draggable,...null==e?void 0:e.draggable},droppable:{...ud.droppable,...null==e?void 0:e.droppable},dragOverlay:{...ud.dragOverlay,...null==e?void 0:e.dragOverlay}}),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(_),{droppableRects:F,measureDroppableContainers:W,measuringScheduled:z}=function(e,t){let{dragging:n,dependencies:s,config:r}=t;const[o,i]=(0, | |
| 745 | +a.useState)(null),{frequency:l,measure:c,strategy:d}=r,u=(0,a.useRef)(e),m=function(){switch(d){case Xc.Always:return!1;case Xc.BeforeDragging:return n;default:return!n}}(),_=Tl(m),h=(0,a.useCallback)(function(e){void 0===e&&(e=[]),_.current||i(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[_]),p=(0,a.useRef)(null),f=Cl(t=>{if(m&&!n)return Qc;if(!t||t===Qc||u.current!==e||null!=o){const t=new Map;for(let a of e){if(!a)continue;if(o&&o.length>0&&!o.includes(a.id)&&a.rect.current){t.set(a.id,a.rect.current);continue}const e=a.node.current,n=e?new Tc(c(e),e):null;a.rect.current=n,n&&t.set(a.id,n)}return t}return t},[e,o,n,m,c]);return(0,a.useEffect)(()=>{u.current=e},[e]),(0,a.useEffect)(()=>{m||h()},[n,m]),(0,a.useEffect)(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),(0,a.useEffect)(()=>{m||"number"!=typeof l||null!==p.current||(p.current=setTimeout(()=>{h(),p.current=null},l))},[l,m,h,...s]),{droppableRects:f,measureDroppableContainers:h,measuringScheduled:null!=o}}(R,{ | |
| 746 | +dragging:w,dependencies:[j.x,j.y],config:I.droppable}),U=function(e,t){const a=null!=t?e.get(t):void 0,n=a?a.node.current:null;return Cl(e=>{var a;return null==t?null:null!=(a=null!=n?n:e)?a:null},[n,t])}(L,M),B=(0,a.useMemo)(()=>O?Fl(O):null,[O]),V=function(){const e=!1===(null==N?void 0:N.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,a=w&&!e&&!t;return"object"==typeof c?{...c,enabled:a}:{enabled:a}}(),$=function(e,t){return ed(e,t)}(U,I.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:s,config:r=!0}=e;const o=(0,a.useRef)(!1),{x:i,y:l}="boolean"==typeof r?{x:r,y:r}:r;Yl(()=>{if(!i&&!l||!t)return void(o.current=!1);if(o.current||!s)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const a=lc(n(e),s);if(i||(a.x=0),l||(a.y=0),o.current=!0,Math.abs(a.x)>0||Math.abs(a.y)>0){const t=fc(e);t&&t.scrollBy({top:a.y,left:a.x})}},[t,i,l,s,n])}({activeNode:null!=M?L.get(M):null,config:V.layoutShiftCompensation,initialRect:$, | |
| 747 | +measure:I.draggable.measure});const q=nd(U,I.draggable.measure,$),J=nd(U?U.parentElement:null),G=(0,a.useRef)({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),K=S.getNodeFor(null==(t=G.current.over)?void 0:t.id),X=function(e){let{measure:t}=e;const[n,s]=(0,a.useState)(null),r=td({callback:(0,a.useCallback)(e=>{for(const{target:a}of e)if(Ll(a)){s(e=>{const n=t(a);return e?{...e,width:n.width,height:n.height}:n});break}},[t])}),o=(0,a.useCallback)(e=>{const a=ld(e);null==r||r.disconnect(),a&&(null==r||r.observe(a)),s(a?t(a):null)},[t,r]),[i,l]=Nl(o);return(0,a.useMemo)(()=>({nodeRef:i,rect:n,setRef:l}),[n,i,l])}({measure:I.dragOverlay.measure}),Z=null!=(s=X.nodeRef.current)?s:U,Q=w?null!=(r=X.rect)?r:q:null,ee=Boolean(X.nodeRef.current&&X.rect),te=lc(ae=ee?null:q,ed(ae));var ae | |
| 748 | +;const ne=od(Z?wl(Z):null),se=function(e){const t=(0,a.useRef)(e),n=Cl(a=>e?a&&a!==sd&&e&&t.current&&e.parentNode===t.current.parentNode?a:pc(e):sd,[e]);return(0,a.useEffect)(()=>{t.current=e},[e]),n}(w?null!=K?K:U:null),re=function(e,t){void 0===t&&(t=_c);const[n]=e,s=od(n?wl(n):null),[r,o]=(0,a.useState)(id);function i(){o(()=>e.length?e.map(e=>xc(e)?s:new Tc(t(e),e)):id)}const l=td({callback:i});return Yl(()=>{null==l||l.disconnect(),i(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),r}(se),oe=kd(h,{transform:{x:j.x-te.x,y:j.y-te.y,scaleX:1,scaleY:1},activatorEvent:O,active:T,activeNodeRect:q,containerNodeRect:J,draggingNodeRect:Q,over:G.current.over,overlayNodeRect:X.rect,scrollableAncestors:se,scrollableAncestorRects:re,windowRect:ne}),ie=B?Hl(B,j):null,le=function(e){const[t,n]=(0,a.useState)(null),s=(0,a.useRef)(e),r=(0,a.useCallback)(e=>{const t=bc(e.target);t&&n(e=>e?(e.set(t,kc(t)),new Map(e)):null)},[]);return(0,a.useEffect)(()=>{const t=s.current;if(e!==t){a(t) | |
| 749 | +;const o=e.map(e=>{const t=bc(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,kc(t)]):null}).filter(e=>null!=e);n(o.length?new Map(o):null),s.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{const t=bc(e);null==t||t.removeEventListener("scroll",r)})}},[r,e]),(0,a.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Hl(e,t),Ql):Sc(e):Ql,[e,t])}(se),ce=rd(le),de=rd(le,[q]),ue=Hl(oe,ce),me=Q?dc(Q,oe):null,_e=T&&me?m({active:T,collisionRect:me,droppableRects:F,droppableContainers:R,pointerCoordinates:ie}):null,he=function(e){if(!e||0===e.length)return null;const[t]=e;return t.id}(_e),[pe,fe]=(0,a.useState)(null),be=function(e,t,a){return{...e,scaleX:t&&a?t.width/a.width:1,scaleY:t&&a?t.height/a.height:1}}(ee?oe:Hl(oe,de),null!=(o=null==pe?void 0:pe.rect)?o:null,q),ge=(0,a.useRef)(null),ye=(0,a.useCallback)((e,t)=>{let{sensor:a,options:n}=t;if(null==C.current)return;const s=L.get(C.current);if(!s)return;const r=e.nativeEvent,o=new a({active:C.current, | |
| 750 | +activeNode:s,event:r,options:n,context:G,onAbort(e){if(!L.get(e))return;const{onDragAbort:t}=P.current,a={id:e};null==t||t(a),y({type:"onDragAbort",event:a})},onPending(e,t,a,n){if(!L.get(e))return;const{onDragPending:s}=P.current,r={id:e,constraint:t,initialCoordinates:a,offset:n};null==s||s(r),y({type:"onDragPending",event:r})},onStart(e){const t=C.current;if(null==t)return;const a=L.get(t);if(!a)return;const{onDragStart:n}=P.current,s={activatorEvent:r,active:{id:t,data:a.data,rect:D}};(0,jr.unstable_batchedUpdates)(()=>{null==n||n(s),x(xd.Initializing),g({type:Xl.DragStart,initialCoordinates:e,active:t}),y({type:"onDragStart",event:s}),E(ge.current),A(r)})},onMove(e){g({type:Xl.DragMove,coordinates:e})},onEnd:i(Xl.DragEnd),onCancel:i(Xl.DragCancel)});function i(e){return async function(){const{active:t,collisions:a,over:n,scrollAdjustedTranslate:s}=G.current;let o=null;if(t&&s){const{cancelDrop:i}=P.current;o={activatorEvent:r,active:t,collisions:a,delta:s,over:n}, | |
| 751 | +e===Xl.DragEnd&&"function"==typeof i&&await Promise.resolve(i(o))&&(e=Xl.DragCancel)}C.current=null,(0,jr.unstable_batchedUpdates)(()=>{g({type:e}),x(xd.Uninitialized),fe(null),E(null),A(null),ge.current=null;const t=e===Xl.DragEnd?"onDragEnd":"onDragCancel";if(o){const e=P.current[t];null==e||e(o),y({type:t,event:o})}})}}ge.current=o},[L]),ke=(0,a.useCallback)((e,t)=>(a,n)=>{const s=a.nativeEvent,r=L.get(n);if(null!==C.current||!r||s.dndKit||s.defaultPrevented)return;const o={active:r};!0===e(a,t.options,o)&&(s.dndKit={capturedBy:t.sensor},C.current=n,ye(a,t))},[L,ye]),ve=function(e,t){return(0,a.useMemo)(()=>e.reduce((e,a)=>{const{sensor:n}=a;return[...e,...n.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,a)}))]},[]),[e,t])}(u,ke);!function(e){(0,a.useEffect)(()=>{if(!kl)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(u),Yl(()=>{ | |
| 752 | +q&&v===xd.Initializing&&x(xd.Initialized)},[q,v]),(0,a.useEffect)(()=>{const{onDragMove:e}=P.current,{active:t,activatorEvent:a,collisions:n,over:s}=G.current;if(!t||!a)return;const r={active:t,activatorEvent:a,collisions:n,delta:{x:ue.x,y:ue.y},over:s};(0,jr.unstable_batchedUpdates)(()=>{null==e||e(r),y({type:"onDragMove",event:r})})},[ue.x,ue.y]),(0,a.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:a,droppableContainers:n,scrollAdjustedTranslate:s}=G.current;if(!e||null==C.current||!t||!s)return;const{onDragOver:r}=P.current,o=n.get(he),i=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,l={active:e,activatorEvent:t,collisions:a,delta:{x:s.x,y:s.y},over:i};(0,jr.unstable_batchedUpdates)(()=>{fe(i),null==r||r(l),y({type:"onDragOver",event:l})})},[he]),Yl(()=>{G.current={activatorEvent:O,active:T,activeNode:U,collisionRect:me,collisions:_e,droppableRects:F,draggableNodes:L,draggingNode:Z,draggingNodeRect:Q,droppableContainers:S,over:pe, | |
| 753 | +scrollableAncestors:se,scrollAdjustedTranslate:ue},D.current={initial:Q,translated:me}},[T,U,_e,me,L,Z,Q,F,S,pe,se,ue]),function(e){let{acceleration:t,activator:n=Jc.Pointer,canScroll:s,draggingRect:r,enabled:o,interval:i=5,order:l=Gc.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:m,threshold:_}=e;const h=function(e){let{delta:t,disabled:a}=e;const n=El(t);return Cl(e=>{if(a||!n||!e)return Kc;const s=Math.sign(t.x-n.x),r=Math.sign(t.y-n.y);return{x:{[vc.Backward]:e.x[vc.Backward]||-1===s,[vc.Forward]:e.x[vc.Forward]||1===s},y:{[vc.Backward]:e.y[vc.Backward]||-1===r,[vc.Forward]:e.y[vc.Forward]||1===r}}},[a,t,n])}({delta:m,disabled:!o}),[p,f]=function(){const e=(0,a.useRef)(null);return[(0,a.useCallback)((t,a)=>{e.current=setInterval(t,a)},[]),(0,a.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),b=(0,a.useRef)({x:0,y:0}),g=(0,a.useRef)({x:0,y:0}),y=(0,a.useMemo)(()=>{switch(n){case Jc.Pointer:return c?{top:c.y, | |
| 754 | +bottom:c.y,left:c.x,right:c.x}:null;case Jc.DraggableRect:return r}},[n,r,c]),k=(0,a.useRef)(null),v=(0,a.useCallback)(()=>{const e=k.current;if(!e)return;const t=b.current.x*g.current.x,a=b.current.y*g.current.y;e.scrollBy(t,a)},[]),x=(0,a.useMemo)(()=>l===Gc.TreeOrder?[...d].reverse():d,[l,d]);(0,a.useEffect)(()=>{if(o&&d.length&&y){for(const e of x){if(!1===(null==s?void 0:s(e)))continue;const a=d.indexOf(e),n=u[a];if(!n)continue;const{direction:r,speed:o}=Lc(e,n,y,t,_);for(const e of["x","y"])h[e][r[e]]||(o[e]=0,r[e]=0);if(o.x>0||o.y>0)return f(),k.current=e,p(v,i),b.current=o,void(g.current=r)}b.current={x:0,y:0},g.current={x:0,y:0},f()}else f()},[t,v,s,f,o,i,JSON.stringify(y),JSON.stringify(h),p,d,x,u,JSON.stringify(_)])}({...V,delta:j,draggingRect:me,pointerCoordinates:ie,scrollableAncestors:se,scrollableAncestorRects:re});const xe=(0,a.useMemo)(()=>({active:T,activeNode:U,activeNodeRect:q,activatorEvent:O,collisions:_e,containerNodeRect:J,dragOverlay:X,draggableNodes:L, | |
| 755 | +droppableContainers:S,droppableRects:F,over:pe,measureDroppableContainers:W,scrollableAncestors:se,scrollableAncestorRects:re,measuringConfiguration:I,measuringScheduled:z,windowRect:ne}),[T,U,q,O,_e,J,X,L,S,F,pe,W,se,re,I,z,ne]),we=(0,a.useMemo)(()=>({activatorEvent:O,activators:ve,active:T,activeNodeRect:q,ariaDescribedById:{draggable:H},dispatch:g,draggableNodes:L,over:pe,measureDroppableContainers:W}),[O,ve,T,q,g,H,L,pe,W]);return n().createElement(ql.Provider,{value:k},n().createElement(pd.Provider,{value:we},n().createElement(fd.Provider,{value:xe},n().createElement(vd.Provider,{value:be},d)),n().createElement(yd,{disabled:!1===(null==l?void 0:l.restoreFocus)})),n().createElement(Kl,{...l,hiddenTextDescribedById:H}))}),Md=(0,a.createContext)(null),Ld="button";function jd(){return(0,a.useContext)(fd)}const Sd={timeout:25};function Yd(e){let{animation:t,children:s}=e;const[r,o]=(0,a.useState)(null),[i,l]=(0,a.useState)(null),c=El(s);return s||r||!c||o(c),Yl(()=>{if(!i)return | |
| 756 | +;const e=null==r?void 0:r.key,a=null==r?void 0:r.props.id;null!=e&&null!=a?Promise.resolve(t(a,i)).then(()=>{o(null)}):o(null)},[t,r,i]),n().createElement(n().Fragment,null,s,r?(0,a.cloneElement)(r,{ref:l}):null)}const Dd={x:0,y:0,scaleX:1,scaleY:1};function Td(e){let{children:t}=e;return n().createElement(pd.Provider,{value:hd},n().createElement(vd.Provider,{value:Dd},t))}const Cd={position:"fixed",touchAction:"none"},Nd=e=>Il(e)?"transform 250ms ease":void 0,Ed=(0,a.forwardRef)((e,t)=>{let{as:a,activatorEvent:s,adjustScale:r,children:o,className:i,rect:l,style:c,transform:d,transition:u=Nd}=e;if(!l)return null;const m=r?d:{...d,scaleX:1,scaleY:1},_={...Cd,width:l.width,height:l.height,top:l.top,left:l.left,transform:Wl.Transform.toString(m),transformOrigin:r&&s?tc(s,l):void 0,transition:"function"==typeof u?u(s):u,...c};return n().createElement(a,{className:i,style:_,ref:t},o)}),Od=e=>t=>{let{active:a,dragOverlay:n}=t;const s={},{styles:r,className:o}=e | |
| 757 | +;if(null!=r&&r.active)for(const[e,t]of Object.entries(r.active))void 0!==t&&(s[e]=a.node.style.getPropertyValue(e),a.node.style.setProperty(e,t));if(null!=r&&r.dragOverlay)for(const[e,t]of Object.entries(r.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return null!=o&&o.active&&a.node.classList.add(o.active),null!=o&&o.dragOverlay&&n.node.classList.add(o.dragOverlay),function(){for(const[e,t]of Object.entries(s))a.node.style.setProperty(e,t);null!=o&&o.active&&a.node.classList.remove(o.active)}},Ad={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:a}}=e;return[{transform:Wl.Transform.toString(t)},{transform:Wl.Transform.toString(a)}]},sideEffects:Od({styles:{active:{opacity:"0"}}})};let Pd=0;function Hd(e){return(0,a.useMemo)(()=>{if(null!=e)return Pd++,Pd},[e])}const Rd=n().memo(e=>{let{adjustScale:t=!1,children:s,dropAnimation:r,style:o,transition:i,modifiers:l,wrapperElement:c="div",className:d,zIndex:u=999}=e | |
| 758 | +;const{activatorEvent:m,active:_,activeNodeRect:h,containerNodeRect:p,draggableNodes:f,droppableContainers:b,dragOverlay:g,over:y,measuringConfiguration:k,scrollableAncestors:v,scrollableAncestorRects:x,windowRect:w}=jd(),M=(0,a.useContext)(vd),L=Hd(null==_?void 0:_.id),j=kd(l,{activatorEvent:m,active:_,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:g.rect,over:y,overlayNodeRect:g.rect,scrollableAncestors:v,scrollableAncestorRects:x,transform:M,windowRect:w}),S=ed(h),Y=function(e){let{config:t,draggableNodes:a,droppableContainers:n,measuringConfiguration:s}=e;return Dl((e,r)=>{if(null===t)return;const o=a.get(e);if(!o)return;const i=o.node.current;if(!i)return;const l=ld(r);if(!l)return;const{transform:c}=wl(r).getComputedStyle(r),d=uc(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:a,sideEffects:n,keyframes:s}={...Ad,...e};return e=>{let{active:r,dragOverlay:o,transform:i,...l}=e;if(!t)return | |
| 759 | +;const c=o.rect.left-r.rect.left,d=o.rect.top-r.rect.top,u={scaleX:1!==i.scaleX?r.rect.width*i.scaleX/o.rect.width:1,scaleY:1!==i.scaleY?r.rect.height*i.scaleY/o.rect.height:1},m={x:i.x-c,y:i.y-d,...u},_=s({...l,active:r,dragOverlay:o,transform:{initial:i,final:m}}),[h]=_,p=_[_.length-1];if(JSON.stringify(h)===JSON.stringify(p))return;const f=null==n?void 0:n({active:r,dragOverlay:o,...l}),b=o.node.animate(_,{duration:t,easing:a,fill:"forwards"});return new Promise(e=>{b.onfinish=()=>{null==f||f(),e()}})}}(t);return Yc(i,s.draggable.measure),u({active:{id:e,data:o.data,node:i,rect:s.draggable.measure(i)},draggableNodes:a,dragOverlay:{node:r,rect:s.dragOverlay.measure(l)},droppableContainers:n,measuringConfiguration:s,transform:d})})}({config:r,draggableNodes:f,droppableContainers:b,measuringConfiguration:k}),D=S?g.setRef:void 0;return n().createElement(Td,null,n().createElement(Yd,{animation:Y},_&&L?n().createElement(Ed,{key:L,id:_.id,ref:D,as:c,activatorEvent:m,adjustScale:t, | |
| 760 | +className:d,transition:i,rect:S,style:{zIndex:u,...o},transform:j},s):null))});function Id(e,t,a){const n=e.slice();return n.splice(a<0?n.length+a:a,0,n.splice(t,1)[0]),n}function Fd(e,t){return e.reduce((e,a,n)=>{const s=t.get(a);return s&&(e[n]=s),e},Array(e.length))}function Wd(e){return null!==e&&e>=0}const zd=e=>{let{rects:t,activeIndex:a,overIndex:n,index:s}=e;const r=Id(t,n,a),o=t[s],i=r[s];return i&&o?{x:i.left-o.left,y:i.top-o.top,scaleX:i.width/o.width,scaleY:i.height/o.height}:null},Ud={scaleX:1,scaleY:1},Bd=e=>{var t;let{activeIndex:a,activeNodeRect:n,index:s,rects:r,overIndex:o}=e;const i=null!=(t=r[a])?t:n;if(!i)return null;if(s===a){const e=r[o];return e?{x:0,y:a<o?e.top+e.height-(i.top+i.height):e.top-i.top,...Ud}:null}const l=function(e,t,a){const n=e[t],s=e[t-1],r=e[t+1];return n?a<t?s?n.top-(s.top+s.height):r?r.top-(n.top+n.height):0:r?r.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}(r,s,a);return s>a&&s<=o?{x:0,y:-i.height-l,...Ud}:s<a&&s>=o?{x:0,y:i.height+l, | |
| 761 | +...Ud}:{x:0,y:0,...Ud}},Vd="Sortable",$d=n().createContext({activeIndex:-1,containerId:Vd,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:zd,disabled:{draggable:!1,droppable:!1}});function qd(e){let{children:t,id:s,items:r,strategy:o=zd,disabled:i=!1}=e;const{active:l,dragOverlay:c,droppableRects:d,over:u,measureDroppableContainers:m}=jd(),_=Al(Vd,s),h=Boolean(null!==c.rect),p=(0,a.useMemo)(()=>r.map(e=>"object"==typeof e&&"id"in e?e.id:e),[r]),f=null!=l,b=l?p.indexOf(l.id):-1,g=u?p.indexOf(u.id):-1,y=(0,a.useRef)(p),k=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}(p,y.current),v=-1!==g&&-1===b||k,x=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(i);Yl(()=>{k&&f&&m(p)},[k,p,f,m]),(0,a.useEffect)(()=>{y.current=p},[p]);const w=(0,a.useMemo)(()=>({activeIndex:b,containerId:_,disabled:x,disableTransforms:v,items:p,overIndex:g,useDragOverlay:h, | |
| 762 | +sortedRects:Fd(p,d),strategy:o}),[b,_,x.draggable,x.droppable,v,p,g,d,h,o]);return n().createElement($d.Provider,{value:w},t)}const Jd=e=>{let{id:t,items:a,activeIndex:n,overIndex:s}=e;return Id(a,n,s).indexOf(t)},Gd=e=>{let{containerId:t,isSorting:a,wasDragging:n,index:s,items:r,newIndex:o,previousItems:i,previousContainerId:l,transition:c}=e;return!(!c||!n||i!==r&&s===o||!a&&(o===s||t!==l))},Kd={duration:200,easing:"ease"},Xd="transform",Zd=Wl.Transition.toString({property:Xd,duration:0,easing:"linear"}),Qd={roleDescription:"sortable"};function eu(e){let{animateLayoutChanges:t=Gd,attributes:n,disabled:s,data:r,getNewIndex:o=Jd,id:i,strategy:l,resizeObserverConfig:c,transition:d=Kd}=e;const{items:u,containerId:m,activeIndex:_,disabled:h,disableTransforms:p,sortedRects:f,overIndex:b,useDragOverlay:g,strategy:y}=(0,a.useContext)($d),k=function(e,t){var a,n;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(a=null==e?void 0:e.draggable)?a:t.draggable, | |
| 763 | +droppable:null!=(n=null==e?void 0:e.droppable)?n:t.droppable}}(s,h),v=u.indexOf(i),x=(0,a.useMemo)(()=>({sortable:{containerId:m,index:v,items:u},...r}),[m,r,v,u]),w=(0,a.useMemo)(()=>u.slice(u.indexOf(i)),[u,i]),{rect:M,node:L,isOver:j,setNodeRef:S}=function(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:r}=e;const o=Al("Droppable"),{active:i,dispatch:l,over:c,measureDroppableContainers:d}=(0,a.useContext)(pd),u=(0,a.useRef)({disabled:n}),m=(0,a.useRef)(!1),_=(0,a.useRef)(null),h=(0,a.useRef)(null),{disabled:p,updateMeasurementsFor:f,timeout:b}={...Sd,...r},g=Tl(null!=f?f:s),y=td({callback:(0,a.useCallback)(()=>{m.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(Array.isArray(g.current)?g.current:[g.current]),h.current=null},b)):m.current=!0},[b]),disabled:p||!i}),k=(0,a.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),m.current=!1),e&&y.observe(e))},[y]),[v,x]=Nl(k),w=Tl(t);return(0,a.useEffect)(()=>{y&&v.current&&(y.disconnect(),m.current=!1, | |
| 764 | +y.observe(v.current))},[v,y]),(0,a.useEffect)(()=>(l({type:Xl.RegisterDroppable,element:{id:s,key:o,disabled:n,node:v,rect:_,data:w}}),()=>l({type:Xl.UnregisterDroppable,key:o,id:s})),[s]),(0,a.useEffect)(()=>{n!==u.current.disabled&&(l({type:Xl.SetDroppableDisabled,id:s,key:o,disabled:n}),u.current.disabled=n)},[s,o,n,l]),{active:i,rect:_,isOver:(null==c?void 0:c.id)===s,node:v,over:c,setNodeRef:x}}({id:i,data:x,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...c}}),{active:Y,activatorEvent:D,activeNodeRect:T,attributes:C,setNodeRef:N,listeners:E,isDragging:O,over:A,setActivatorNodeRef:P,transform:H}=function(e){let{id:t,data:n,disabled:s=!1,attributes:r}=e;const o=Al("Draggable"),{activators:i,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:m,over:_}=(0,a.useContext)(pd),{role:h=Ld,roleDescription:p="draggable",tabIndex:f=0}=null!=r?r:{},b=(null==c?void 0:c.id)===t,g=(0,a.useContext)(b?vd:Md),[y,k]=Nl(),[v,x]=Nl(),w=function(e,t){ | |
| 765 | +return(0,a.useMemo)(()=>e.reduce((e,a)=>{let{eventName:n,handler:s}=a;return e[n]=e=>{s(e,t)},e},{}),[e,t])}(i,t),M=Tl(n);return Yl(()=>(m.set(t,{id:t,key:o,node:y,activatorNode:v,data:M}),()=>{const e=m.get(t);e&&e.key===o&&m.delete(t)}),[m,t]),{active:c,activatorEvent:l,activeNodeRect:d,attributes:(0,a.useMemo)(()=>({role:h,tabIndex:f,"aria-disabled":s,"aria-pressed":!(!b||h!==Ld)||void 0,"aria-roledescription":p,"aria-describedby":u.draggable}),[s,h,f,b,p,u.draggable]),isDragging:b,listeners:s?void 0:w,node:y,over:_,setNodeRef:k,setActivatorNodeRef:x,transform:g}}({id:i,data:x,attributes:{...Qd,...n},disabled:k.draggable}),R=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}(S,N),I=Boolean(Y),F=I&&!p&&Wd(_)&&Wd(b),W=!g&&O,z=W&&F?H:null,U=F?null!=z?z:(null!=l?l:y)({rects:f,activeNodeRect:T,activeIndex:_,overIndex:b,index:v}):null,B=Wd(_)&&Wd(b)?o({id:i,items:u,activeIndex:_,overIndex:b | |
| 766 | +}):v,V=null==Y?void 0:Y.id,$=(0,a.useRef)({activeId:V,items:u,newIndex:B,containerId:m}),q=u!==$.current.items,J=t({active:Y,containerId:m,isDragging:O,isSorting:I,id:i,index:v,items:u,newIndex:$.current.newIndex,previousItems:$.current.items,previousContainerId:$.current.containerId,transition:d,wasDragging:null!=$.current.activeId}),G=function(e){let{disabled:t,index:n,node:s,rect:r}=e;const[o,i]=(0,a.useState)(null),l=(0,a.useRef)(n);return Yl(()=>{if(!t&&n!==l.current&&s.current){const e=r.current;if(e){const t=_c(s.current,{ignoreTransform:!0}),a={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(a.x||a.y)&&i(a)}}n!==l.current&&(l.current=n)},[t,n,s,r]),(0,a.useEffect)(()=>{o&&i(null)},[o]),o}({disabled:!J,index:v,node:L,rect:M});return(0,a.useEffect)(()=>{I&&$.current.newIndex!==B&&($.current.newIndex=B),m!==$.current.containerId&&($.current.containerId=m),u!==$.current.items&&($.current.items=u)},[I,B,m,u]),(0,a.useEffect)(()=>{ | |
| 767 | +if(V===$.current.activeId)return;if(null!=V&&null==$.current.activeId)return void($.current.activeId=V);const e=setTimeout(()=>{$.current.activeId=V},50);return()=>clearTimeout(e)},[V]),{active:Y,activeIndex:_,attributes:C,data:x,rect:M,index:v,newIndex:B,items:u,isOver:j,isSorting:I,isDragging:O,listeners:E,node:L,overIndex:b,over:A,setNodeRef:R,setActivatorNodeRef:P,setDroppableNodeRef:S,setDraggableNodeRef:N,transform:null!=G?G:U,transition:G||q&&$.current.newIndex===v?Zd:W&&!Il(D)||!d?void 0:I||J?Wl.Transition.toString({...d,property:Xd}):void 0}}Oc.Down,Oc.Right,Oc.Up,Oc.Left;const tu={item:Aa().shape({page_id:Aa().number.isRequired,label:Aa().string,icon:Aa().string,slug:Aa().string,className:Aa().string,children:Aa().array}).isRequired,depth:Aa().number.isRequired,isDragging:Aa().bool.isRequired,setItems:Aa().func.isRequired,onAddChild:Aa().func.isRequired,onEditItem:Aa().func.isRequired,children:Aa().node,listeners:Aa().object,attributes:Aa().object} | |
| 768 | +;function au({item:e,depth:t,isDragging:n,setItems:s,onAddChild:o,onEditItem:l,children:c,listeners:d,attributes:u}){const[m,_]=(0,a.useState)(!1),h=(0,a.useRef)(null),p=()=>{(0,i.In)({action:"link"===e?.type?"ablocks/delete_fronted_dashboard_link":"ablocks/delete_fronted_dashboard_page",slug:e?.slug,page_id:e?.page_id}).then(()=>{s(t=>{const a=t=>(t||[]).filter(t=>t.page_id!==e.page_id).map(e=>e.children?{...e,children:a(e.children)}:e);return a(t)})})};(0,a.useEffect)(()=>{if(!m)return;const e=e=>{h.current&&!h.current.contains(e.target)&&_(!1)},t=e=>{"Escape"===e.key&&_(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[m]);const f=0===t;return(0,S.jsxs)("div",{className:"ablocks-sub-pages-selected"+(n?" dragging":""),...u,style:{cursor:n?"grabbing":"default",background:n?"#f0f0f0":void 0,transition:"background 150ms ease",position:"relative", | |
| 768 | 769 | minHeight:"40px",paddingLeft:16*t},children:[(0,S.jsx)("div",{className:"ablocks-sub-pages-selected-parent",children:(0,S.jsxs)("div",{className:"ablocks-sub-pages-selected-parent-wrap",children:[(0,S.jsxs)("div",{className:"ablocks-sub-pages-parent-content",children:[(0,S.jsx)("span",{className:"drag-handle",title:(0,r.__)("Drag to reorder","ablocks"),style:{cursor:"grab"},...d,children:"⠿"}),(0,S.jsx)("p",{className:"ablocks-sub-page-title",children:e.label||(0,r.__)("(no label)","ablocks")})]}),f?(0,S.jsxs)("div",{className:"ablocks-sub-pages-tools",children:[(0,S.jsx)("button",{className:"ablocks-chip ablocks-chip--primary",type:"button",onClick:()=>o(e.page_id),children:(0,r.__)("Add Sub-route","ablocks")}),"link"!==e.type&&(0,S.jsx)("button",{className:"ablocks-chip ablocks-chip--primary",onClick:()=>window.open(e.edit_link,"_blank"),children:(0,r.__)("Add content","ablocks")}),(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--edit",role:"button",tabIndex:0,title:(0, |
| 769 | 770 | r.__)("Edit","ablocks"),onClick:()=>l(e),onKeyDown:t=>"Enter"===t.key&&l(e)}),(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--delete",role:"button",tabIndex:0,title:(0,r.__)("Delete","ablocks"),onClick:p,onKeyDown:e=>"Enter"===e.key&&p()})]}):(0,S.jsxs)("div",{className:"ablocks-kebab-wrap",ref:h,children:[(0,S.jsx)("button",{className:"ablocks-kebab-btn",type:"button","aria-haspopup":"menu","aria-expanded":m,title:(0,r.__)("More","ablocks"),onClick:()=>_(e=>!e),children:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--menu"})}),m&&(0,S.jsxs)("div",{className:"ablocks-menu",role:"menu",children:["link"!==e.type&&(0,S.jsxs)("button",{role:"menuitem",type:"button",onClick:()=>{_(!1),window.open(e.edit_link,"_blank")},children:[(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--plus",role:"presentation"}),(0,r.__)("Add content","ablocks")]}),(0,S.jsxs)("button",{role:"menuitem",type:"button",onClick:()=>{_(!1),l(e)},children:[(0,S.jsx)("span",{ |
| 770 | -className:"ablocks-icon ablocks-icon--edit"}),(0,r.__)("Edit","ablocks")]}),(0,S.jsxs)("button",{role:"menuitem",type:"button",className:"danger",onClick:()=>{_(!1),p()},children:[(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--delete"}),(0,r.__)("Delete","ablocks")]})]})]})]})}),c]})}tu.propTypes=eu;const au={item:Aa().object.isRequired,depth:Aa().number.isRequired,activeId:Aa().oneOfType([Aa().string,Aa().number]),setItems:Aa().func.isRequired,onAddChild:Aa().func.isRequired,onEditItem:Aa().func.isRequired};function nu({item:e,depth:t,activeId:a,setItems:n,onAddChild:s,onEditItem:r}){const{attributes:o,listeners:i,setNodeRef:l,isDragging:c,transform:d,transition:u}=Qd({id:e.page_id});return(0,S.jsx)("div",{ref:l,style:{opacity:c?.5:1,transform:Fl.Transform.toString(d),transition:u||"all 0.2s ease",minHeight:"40px"},children:(0,S.jsx)(tu,{item:e,isDragging:a===e.page_id,setItems:n,onAddChild:s,onEditItem:r,depth:t,listeners:i,attributes:o,children:!!e.children?.length&&(0, | |
| 771 | -S.jsx)($d,{items:e.children.map(e=>e.page_id),strategy:Ud,children:(0,S.jsx)("div",{className:"nested-list",children:e.children.map(e=>(0,S.jsx)(nu,{item:e,depth:t+1,activeId:a,setItems:n,onAddChild:s,onEditItem:r},e.page_id))})})})})}nu.propTypes=au;const su={items:Aa().array.isRequired,setItems:Aa().func.isRequired,onAddChild:Aa().func.isRequired,onEditItem:Aa().func.isRequired};function ru({items:e,setItems:t,onAddChild:n,onEditItem:s}){const[r,o]=(0,a.useState)(null),l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.useMemo)(()=>[...t].filter(e=>null!=e),[...t])}(function(e,t){return(0,a.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}(Uc,{activationConstraint:{distance:5}})),c=(e,t,a=null)=>{for(let n=0;n<(e||[]).length;n++){const s=e[n];if(s.page_id===t)return{parent:a,array:e,index:n};if(s.children?.length){const e=c(s.children,t,s);if(e)return e}}return null};return(0,S.jsx)("div",{ | |
| 772 | -className:"ablocks-frontend-dashboard-content__sub-content",children:(0,S.jsxs)(xd,{sensors:l,collisionDetection:sc,onDragStart:e=>o(e.active.id),onDragEnd:async e=>{const a=e?.active?.id,n=e?.over?.id;if(!n||a===n)return;let s=null;if(t(e=>{const t=c(e,a),r=c(e,n);if(!t||!r)return e;if(t.array===r.array){const a=structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e)),n=(e,t)=>c(e,t)?.array||e,o=[...t.array],[i]=o.splice(t.index,1);o.splice(r.index,0,i);const l=n(a,i.page_id);return l.length=0,o.forEach(e=>l.push(e)),s={reordered_items:a},a}return e}),s)try{await(0,i.In)({action:"ablocks/move_fronted_dashboard_page",...s})}catch(e){console.error("Reorder persist failed:",e)}o(null)},children:[!!e?.length&&(0,S.jsx)($d,{items:e.map(e=>e.page_id),strategy:Ud,children:e.map(e=>(0,S.jsx)(nu,{item:e,depth:0,activeId:r,setItems:t,onAddChild:n,onEditItem:s},e.page_id))}),(0,S.jsx)(Hd,{children:r&&(()=>{const a=e=>{for(const t of e||[]){if(t.page_id===r)return t | |
| 773 | -;if(t.children?.length){const e=a(t.children);if(e)return e}}return null},o=a(e);return o?(0,S.jsx)(tu,{item:o,isDragging:!0,setItems:t,onAddChild:n,onEditItem:s,depth:0}):null})()})]})})}function ou({open:e,mode:t="add",initialValues:n,onClose:s,onSubmit:o,submitting:l}){if(!e)return null;const c="link"===n?.type?"link":"page";return Sr().createPortal((0,S.jsx)("div",{"aria-modal":"true",role:"dialog",className:"ablocks-frontend-dashboard-modal-backdrop",onClick:e=>e.target===e.currentTarget&&s(),children:(0,S.jsxs)("div",{className:"ablocks-frontend-dashboard-modal",children:[(0,S.jsxs)("div",{className:"ablocks-frontend-dashboard-modal__header",children:[(0,S.jsx)("h3",{children:"add"===t?n?.parent_id&&0!==n?.parent_id?(0,r.__)("Add Sub-route","ablocks"):(0,r.__)("Add Route","ablocks"):n?.parent_id&&0!==n?.parent_id?(0,r.__)("Edit Sub-route","ablocks"):(0,r.__)("Edit Route","ablocks")}),(0,S.jsx)("button",{onClick:s,"aria-label":(0,r.__)("Close","ablocks"), | |
| 771 | +className:"ablocks-icon ablocks-icon--edit"}),(0,r.__)("Edit","ablocks")]}),(0,S.jsxs)("button",{role:"menuitem",type:"button",className:"danger",onClick:()=>{_(!1),p()},children:[(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--delete"}),(0,r.__)("Delete","ablocks")]})]})]})]})}),c]})}au.propTypes=tu;const nu={item:Aa().object.isRequired,depth:Aa().number.isRequired,activeId:Aa().oneOfType([Aa().string,Aa().number]),setItems:Aa().func.isRequired,onAddChild:Aa().func.isRequired,onEditItem:Aa().func.isRequired};function su({item:e,depth:t,activeId:a,setItems:n,onAddChild:s,onEditItem:r}){const{attributes:o,listeners:i,setNodeRef:l,isDragging:c,transform:d,transition:u}=eu({id:e.page_id});return(0,S.jsx)("div",{ref:l,style:{opacity:c?.5:1,transform:Wl.Transform.toString(d),transition:u||"all 0.2s ease",minHeight:"40px"},children:(0,S.jsx)(au,{item:e,isDragging:a===e.page_id,setItems:n,onAddChild:s,onEditItem:r,depth:t,listeners:i,attributes:o,children:!!e.children?.length&&(0, | |
| 772 | +S.jsx)(qd,{items:e.children.map(e=>e.page_id),strategy:Bd,children:(0,S.jsx)("div",{className:"nested-list",children:e.children.map(e=>(0,S.jsx)(su,{item:e,depth:t+1,activeId:a,setItems:n,onAddChild:s,onEditItem:r},e.page_id))})})})})}su.propTypes=nu;const ru={items:Aa().array.isRequired,setItems:Aa().func.isRequired,onAddChild:Aa().func.isRequired,onEditItem:Aa().func.isRequired};function ou({items:e,setItems:t,onAddChild:n,onEditItem:s}){const[r,o]=(0,a.useState)(null),l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.useMemo)(()=>[...t].filter(e=>null!=e),[...t])}(function(e,t){return(0,a.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}(Bc,{activationConstraint:{distance:5}})),c=(e,t,a=null)=>{for(let n=0;n<(e||[]).length;n++){const s=e[n];if(s.page_id===t)return{parent:a,array:e,index:n};if(s.children?.length){const e=c(s.children,t,s);if(e)return e}}return null};return(0,S.jsx)("div",{ | |
| 773 | +className:"ablocks-frontend-dashboard-content__sub-content",children:(0,S.jsxs)(wd,{sensors:l,collisionDetection:rc,onDragStart:e=>o(e.active.id),onDragEnd:async e=>{const a=e?.active?.id,n=e?.over?.id;if(!n||a===n)return;let s=null;if(t(e=>{const t=c(e,a),r=c(e,n);if(!t||!r)return e;if(t.array===r.array){const a=structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e)),n=(e,t)=>c(e,t)?.array||e,o=[...t.array],[i]=o.splice(t.index,1);o.splice(r.index,0,i);const l=n(a,i.page_id);return l.length=0,o.forEach(e=>l.push(e)),s={reordered_items:a},a}return e}),s)try{await(0,i.In)({action:"ablocks/move_fronted_dashboard_page",...s})}catch(e){console.error("Reorder persist failed:",e)}o(null)},children:[!!e?.length&&(0,S.jsx)(qd,{items:e.map(e=>e.page_id),strategy:Bd,children:e.map(e=>(0,S.jsx)(su,{item:e,depth:0,activeId:r,setItems:t,onAddChild:n,onEditItem:s},e.page_id))}),(0,S.jsx)(Rd,{children:r&&(()=>{const a=e=>{for(const t of e||[]){if(t.page_id===r)return t | |
| 774 | +;if(t.children?.length){const e=a(t.children);if(e)return e}}return null},o=a(e);return o?(0,S.jsx)(au,{item:o,isDragging:!0,setItems:t,onAddChild:n,onEditItem:s,depth:0}):null})()})]})})}function iu({open:e,mode:t="add",initialValues:n,onClose:s,onSubmit:o,submitting:l}){if(!e)return null;const c="link"===n?.type?"link":"page";return Sr().createPortal((0,S.jsx)("div",{"aria-modal":"true",role:"dialog",className:"ablocks-frontend-dashboard-modal-backdrop",onClick:e=>e.target===e.currentTarget&&s(),children:(0,S.jsxs)("div",{className:"ablocks-frontend-dashboard-modal",children:[(0,S.jsxs)("div",{className:"ablocks-frontend-dashboard-modal__header",children:[(0,S.jsx)("h3",{children:"add"===t?n?.parent_id&&0!==n?.parent_id?(0,r.__)("Add Sub-route","ablocks"):(0,r.__)("Add Route","ablocks"):n?.parent_id&&0!==n?.parent_id?(0,r.__)("Edit Sub-route","ablocks"):(0,r.__)("Edit Route","ablocks")}),(0,S.jsx)("button",{onClick:s,"aria-label":(0,r.__)("Close","ablocks"), | |
| 774 | 775 | className:"ablocks-frontend-dashboard-modal__close",children:"×"})]}),(0,S.jsx)(pa,{enableReinitialize:!0,validateOnMount:!0,initialValues:{type:c||"page",label:"",slug:"",icon:"",class_name:"",priority:0,link:"",...n||{}},validate:e=>{const t={};if(e.type&&e.type.trim()||(t.type=(0,r.__)("Type is required","ablocks")),e.label&&e.label.trim()||(t.label=(0,r.__)("Label is required","ablocks")),"page"===e.type){const a=(e.slug||"").trim();a?/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(a)||(t.slug=(0,r.__)("Use lowercase letters, numbers, and dashes only","ablocks")):t.slug=(0,r.__)("Slug is required","ablocks")}else if("link"===e.type){const a=(e.link||"").trim();if(a)try{const e=new URL(a);/^https?:$/.test(e.protocol)||(t.link=(0,r.__)("Link must start with http:// or https://","ablocks"))}catch{t.link=(0,r.__)("Enter a valid URL (e.g., https://example.com)","ablocks")}else t.link=(0,r.__)("Link is required","ablocks")}return t},onSubmit:o, |
| 775 | 776 | children:({handleSubmit:e,isSubmitting:n,values:o,setFieldValue:c,errors:d,touched:u,isValid:m})=>((0,a.useEffect)(()=>{"page"===o.type&&"add"===t&&o.label&&!u.slug&&c("slug",(0,i.z9)(o.label),!1)},[o.label,o.type,c,t]),(0,S.jsxs)(va,{onSubmit:e,className:"ablocks-frontend-dashboard-modal__form",children:[(0,S.jsxs)("div",{className:"ablocks-frontend-dashboard-modal__field",children:[(0,S.jsxs)("div",{children:[(0,r.__)("Type","ablocks")," ",(0,S.jsx)("span",{style:{color:"red"},children:"*"})]}),(0,S.jsxs)("div",{className:"ablocks-frontend-dashboard-modal__radio-group",children:[(0,S.jsxs)("label",{className:"radio-pill "+("page"===o.type?"is-active":""),style:{pointerEvents:"edit"===t?"none":"auto",opacity:"edit"===t&&"page"!==o.type?.5:1},children:[(0,S.jsx)(ka,{type:"radio",name:"type",value:"page",disabled:"edit"===t}),(0,S.jsx)("span",{children:(0,r.__)("Page","ablocks")})]}),(0,S.jsxs)("label",{className:"radio-pill "+("link"===o.type?"is-active":""),style:{ |
| 776 | 777 | pointerEvents:"edit"===t?"none":"auto",opacity:"edit"===t&&"link"!==o.type?.5:1},children:[(0,S.jsx)(ka,{type:"radio",name:"type",value:"link",disabled:"edit"===t}),(0,S.jsx)("span",{children:(0,r.__)("Link","ablocks")})]})]}),d.type&&(0,S.jsx)("small",{style:{color:"red"},children:d.type})]}),(0,S.jsxs)("label",{className:"ablocks-frontend-dashboard-modal__field",children:[(0,S.jsxs)("div",{children:[(0,r.__)("Label","ablocks")," ",(0,S.jsx)("span",{style:{color:"red"},children:"*"})]}),(0,S.jsx)(ka,{name:"label",type:"text","aria-invalid":Boolean(d.label&&u.label),"aria-describedby":"label-error"}),d.label&&u.label&&(0,S.jsx)("small",{id:"label-error",style:{color:"red"},children:d.label})]}),"link"===o.type?(0,S.jsxs)("label",{className:"ablocks-frontend-dashboard-modal__field",children:[(0,S.jsxs)("div",{children:[(0,r.__)("Link URL","ablocks")," ",(0,S.jsx)("span",{style:{color:"red"},children:"*"})]}),(0,S.jsx)(ka,{name:"link",type:"url",placeholder:(0, |
| 777 | 778 | r.__)("https://example.com","ablocks"),"aria-invalid":Boolean(d.link&&u.link),"aria-describedby":"link-error"}),d.link&&u.link&&(0,S.jsx)("small",{id:"link-error",style:{color:"red"},children:d.link})]}):(0,S.jsxs)("label",{className:"ablocks-frontend-dashboard-modal__field",children:[(0,S.jsxs)("div",{children:[(0,r.__)("Slug","ablocks")," ",(0,S.jsx)("span",{style:{color:"red"},children:"*"})]}),(0,S.jsx)(ka,{name:"slug",type:"text","aria-invalid":Boolean(d.slug&&u.slug),"aria-describedby":"slug-error"}),d.slug&&u.slug&&(0,S.jsx)("small",{id:"slug-error",style:{color:"red"},children:d.slug})]}),(0,S.jsxs)("label",{className:"ablocks-frontend-dashboard-modal__field",children:[(0,S.jsx)("div",{children:(0,r.__)("Icon Class","ablocks")}),(0,S.jsx)(ka,{name:"icon",type:"text"}),(0,S.jsxs)("small",{children:[(0,r.__)("Only Font Awesome class names are supported. Example:","ablocks")," ",(0,S.jsx)("code",{children:"fa fa-home"}),"."," ",(0, |
| 778 | -r.__)("Ensure Font Awesome is installed.","ablocks")]})]}),(0,S.jsxs)("label",{className:"ablocks-frontend-dashboard-modal__field",children:[(0,S.jsx)("div",{children:(0,r.__)("Class Name","ablocks")}),(0,S.jsx)(ka,{name:"class_name",type:"text"})]}),(0,S.jsxs)("div",{className:"ablocks-frontend-dashboard-modal__actions",children:[(0,S.jsx)("button",{type:"button",onClick:s,disabled:l||n,children:l||n?(0,r.__)("Canceling","ablocks"):(0,r.__)("Cancel","ablocks")}),(0,S.jsx)("button",{type:"submit",disabled:l||n||!m,"aria-disabled":l||n||!m,title:m?void 0:(0,r.__)("Please fix validation errors","ablocks"),children:l||n?(0,r.__)("Saving","ablocks"):(0,r.__)("Save","ablocks")})]})]}))})]})}),document.body)}ru.propTypes=su;const iu=()=>{const{values:e}=ta(),[t,n]=(0,a.useState)([]),[s,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)({open:!1,mode:"add",parentId:null,item:null}),d=async()=>{const e=await(0,i.In)({action:"ablocks/get_fronted_dashboard_pages"});n(e?.data?.data||[])};(0, | |
| 779 | -a.useEffect)(()=>{d()},[]);const u=()=>c(e=>({...e,open:!1}));return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Frontend Dashboard","ablocks")}),(0,S.jsx)(gl,{name:"frontend_dashboard_page",placeholder:(0,r.__)("Search and select a Page","ablocks"),title:(0,r.__)("Select Page","ablocks"),postType:"page",subtitle:(0,S.jsx)(S.Fragment,{children:(0,r.__)("Select a page for base frontend Dashboard","ablocks")})}),e?.frontend_dashboard_page?(0,S.jsxs)("div",{className:"ablocks-frontend-dashboard-content",children:[(0,S.jsx)(ru,{items:t,setItems:n,onAddChild:e=>c({open:!0,mode:"add",parentId:e,item:null}),onEditItem:e=>{c({open:!0,mode:"edit",parentId:null,item:e})}}),(0,S.jsxs)("button",{className:"ablocks-add-sub-page",onClick:()=>c({open:!0,mode:"add",parentId:null,item:null}),children:[(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--plus",role:"presentation"}),(0, | |
| 780 | -r.__)("Add route","ablocks")]})]}):null,(0,S.jsx)(ou,{open:l.open,mode:l.mode,submitting:s,initialValues:"edit"===l.mode?{type:"link"===l.item?.type?"link":"page",label:l.item?.label||"",slug:l.item?.slug||"",link:l.item?.link||"",icon:l.item?.icon||"",class_name:l.item?.class_name||"",priority:l.item?.priority??0,parent_id:l.item?.parent_id||null}:{type:"page",label:"",slug:"",icon:"",class_name:"",priority:0,parent_id:l.parentId||null,link:""},onClose:u,onSubmit:async(e,{setSubmitting:t,resetForm:a})=>{try{o(!0),"add"===l.mode?await(0,i.In)({action:"link"===e?.type?"ablocks/create_fronted_dashboard_link":"ablocks/create_fronted_dashboard_page",parent_id:l.parentId,...e}):await(0,i.In)({action:"link"===e?.type?"ablocks/edit_fronted_dashboard_link":"ablocks/edit_fronted_dashboard_page",page_id:l.item.page_id,...e}),await d(),a(),u()}finally{o(!1),t(!1)}}})]})},lu={title:Aa().string,subtitle:Aa().string,tooltip:Aa().string,desc:Aa().string,name:Aa().string,placeholder:Aa().string, | |
| 781 | -value:Aa().string,prefix:Aa().string,readOnly:Aa().bool};function cu({name:e,title:t,subtitle:a,tooltip:n,desc:s,placeholder:r,prefix:o,readOnly:i=!1,unit:l}){const{setFieldValue:c}=ta(),d=Ln().uniqueId(e+"_");return(0,S.jsxs)("div",{className:`ablocks-column-items form-group ${o&&"form-group--"+o}`,children:[(0,S.jsxs)("div",{className:"ablocks-label-tooltip",children:[(0,S.jsxs)("div",{className:"ablocks-title-subtitle",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:d,children:t}),a&&(0,S.jsx)("span",{className:"ablocks-sub-title",children:a})]}),n&&(0,S.jsxs)("div",{className:"ablocks-tooltip-container",children:[(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--info-circle"}),(0,S.jsx)("span",{className:"ablocks-tooltip-text",children:n})]})]}),n&&(0,S.jsx)("span",{className:"ablocks-tooltip",children:n}),(0,S.jsxs)("div",{className:"ablocks-input-desc-container",children:[(0,S.jsxs)("div",{className:`ablocks-input-desc ${l&&"ablocks-input-unit"}`, | |
| 782 | -children:[(0,S.jsx)(ka,{id:d,type:"text",name:e,placeholder:r,onChange:t=>c(e,t.target.value),readOnly:i}),l&&(0,S.jsx)("span",{className:"ablocks-unit-field",children:l})]}),s&&(0,S.jsx)("span",{className:"desc",children:s})]})]})}cu.propTypes=lu;const du=()=>{const[e,t]=(0,a.useState)({mailchimp:!1,mailerlite:!1,drip:!1,convertkit:!1,getresponse:!1}),n=w(),{values:s}=ta(),o=async e=>{const a=s[`${e}_api_key`];try{const s=await(0,i.In)({action:"ablocks/form_builder_action_setting_data",type:e,api:a});s.data.success&&"invalid_api"!==s.data.data?(n(wt({message:(0,r.sprintf)( | |
| 779 | +r.__)("Ensure Font Awesome is installed.","ablocks")]})]}),(0,S.jsxs)("label",{className:"ablocks-frontend-dashboard-modal__field",children:[(0,S.jsx)("div",{children:(0,r.__)("Class Name","ablocks")}),(0,S.jsx)(ka,{name:"class_name",type:"text"})]}),(0,S.jsxs)("div",{className:"ablocks-frontend-dashboard-modal__actions",children:[(0,S.jsx)("button",{type:"button",onClick:s,disabled:l||n,children:l||n?(0,r.__)("Canceling","ablocks"):(0,r.__)("Cancel","ablocks")}),(0,S.jsx)("button",{type:"submit",disabled:l||n||!m,"aria-disabled":l||n||!m,title:m?void 0:(0,r.__)("Please fix validation errors","ablocks"),children:l||n?(0,r.__)("Saving","ablocks"):(0,r.__)("Save","ablocks")})]})]}))})]})}),document.body)}ou.propTypes=ru;const lu=()=>{const{values:e}=ta(),[t,n]=(0,a.useState)([]),[s,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)({open:!1,mode:"add",parentId:null,item:null}),d=async()=>{const e=await(0,i.In)({action:"ablocks/get_fronted_dashboard_pages"});n(e?.data?.data||[])};(0, | |
| 780 | +a.useEffect)(()=>{d()},[]);const u=()=>c(e=>({...e,open:!1}));return(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Frontend Dashboard","ablocks")}),(0,S.jsx)(yl,{name:"frontend_dashboard_page",placeholder:(0,r.__)("Search and select a Page","ablocks"),title:(0,r.__)("Select Page","ablocks"),postType:"page",subtitle:(0,S.jsx)(S.Fragment,{children:(0,r.__)("Select a page for base frontend Dashboard","ablocks")})}),e?.frontend_dashboard_page?(0,S.jsxs)("div",{className:"ablocks-frontend-dashboard-content",children:[(0,S.jsx)(ou,{items:t,setItems:n,onAddChild:e=>c({open:!0,mode:"add",parentId:e,item:null}),onEditItem:e=>{c({open:!0,mode:"edit",parentId:null,item:e})}}),(0,S.jsxs)("button",{className:"ablocks-add-sub-page",onClick:()=>c({open:!0,mode:"add",parentId:null,item:null}),children:[(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--plus",role:"presentation"}),(0, | |
| 781 | +r.__)("Add route","ablocks")]})]}):null,(0,S.jsx)(iu,{open:l.open,mode:l.mode,submitting:s,initialValues:"edit"===l.mode?{type:"link"===l.item?.type?"link":"page",label:l.item?.label||"",slug:l.item?.slug||"",link:l.item?.link||"",icon:l.item?.icon||"",class_name:l.item?.class_name||"",priority:l.item?.priority??0,parent_id:l.item?.parent_id||null}:{type:"page",label:"",slug:"",icon:"",class_name:"",priority:0,parent_id:l.parentId||null,link:""},onClose:u,onSubmit:async(e,{setSubmitting:t,resetForm:a})=>{try{o(!0),"add"===l.mode?await(0,i.In)({action:"link"===e?.type?"ablocks/create_fronted_dashboard_link":"ablocks/create_fronted_dashboard_page",parent_id:l.parentId,...e}):await(0,i.In)({action:"link"===e?.type?"ablocks/edit_fronted_dashboard_link":"ablocks/edit_fronted_dashboard_page",page_id:l.item.page_id,...e}),await d(),a(),u()}finally{o(!1),t(!1)}}})]})},cu={title:Aa().string,subtitle:Aa().string,tooltip:Aa().string,desc:Aa().string,name:Aa().string,placeholder:Aa().string, | |
| 782 | +value:Aa().string,prefix:Aa().string,readOnly:Aa().bool};function du({name:e,title:t,subtitle:a,tooltip:n,desc:s,placeholder:r,prefix:o,readOnly:i=!1,unit:l}){const{setFieldValue:c}=ta(),d=Ln().uniqueId(e+"_");return(0,S.jsxs)("div",{className:`ablocks-column-items form-group ${o&&"form-group--"+o}`,children:[(0,S.jsxs)("div",{className:"ablocks-label-tooltip",children:[(0,S.jsxs)("div",{className:"ablocks-title-subtitle",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:d,children:t}),a&&(0,S.jsx)("span",{className:"ablocks-sub-title",children:a})]}),n&&(0,S.jsxs)("div",{className:"ablocks-tooltip-container",children:[(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--info-circle"}),(0,S.jsx)("span",{className:"ablocks-tooltip-text",children:n})]})]}),n&&(0,S.jsx)("span",{className:"ablocks-tooltip",children:n}),(0,S.jsxs)("div",{className:"ablocks-input-desc-container",children:[(0,S.jsxs)("div",{className:`ablocks-input-desc ${l&&"ablocks-input-unit"}`, | |
| 783 | +children:[(0,S.jsx)(ka,{id:d,type:"text",name:e,placeholder:r,onChange:t=>c(e,t.target.value),readOnly:i}),l&&(0,S.jsx)("span",{className:"ablocks-unit-field",children:l})]}),s&&(0,S.jsx)("span",{className:"desc",children:s})]})]})}du.propTypes=cu;const uu=()=>{const[e,t]=(0,a.useState)({mailchimp:!1,mailerlite:!1,drip:!1,convertkit:!1,getresponse:!1}),n=w(),{values:s}=ta(),o=async e=>{const a=s[`${e}_api_key`];try{const s=await(0,i.In)({action:"ablocks/form_builder_action_setting_data",type:e,api:a});s.data.success&&"invalid_api"!==s.data.data?(n(wt({message:(0,r.sprintf)( | |
| 783 | 784 | // translators: %s. typeOfEMail |
| 784 | 785 | // translators: %s. typeOfEMail |
| 785 | 786 | (0,r.__)("%s Api key validated successfully","ablocks"),e),isShow:!0,type:"success"})),t(t=>({...t,[`${e}`]:!0}))):(n(wt({message:(0,r.sprintf)( |
| 786 | 787 | // translators: %s. typeOfEMail |
| 787 | 788 | // translators: %s. typeOfEMail |
| 788 | -(0,r.__)("Failed to validate %s Api key","ablocks"),e),isShow:!0,type:"success"})),t(t=>({...t,[`${e}`]:!1})))}catch(e){}};return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Integrations","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-integrations",children:[(0,S.jsx)("h3",{children:(0,r.__)("MailChimp","ablocks")}),(0,S.jsx)("label",{children:(0,r.__)("Api Key","ablocks")})," ",(0,S.jsx)(cu,{placeholder:(0,r.__)("Api Key","ablocks"),name:"mailchimp_api_key",desc:e?.mailchimp&&(0,r.__)("Mailchimp Api key verified","ablocks")}),(0,S.jsxs)("span",{children:[(0,r.__)("To integrate with our forms you need an ","ablocks"),(0,S.jsx)("a",{href:"https://ablocks.pro/docs/how-to-use-mailchimp-integration-with-ablocks/",target:"_blank",rel:"noreferrer",children:(0,r.__)("API Key","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Validate Api key","ablocks"),suffix:"integrations",onClick:()=>o("mailchimp")})]}),(0, | |
| 789 | -S.jsxs)("div",{className:"ablocks-integrations",children:[(0,S.jsx)("h3",{children:(0,r.__)("Drip","ablocks")}),(0,S.jsx)("label",{children:(0,r.__)("Api Key","ablocks")})," ",(0,S.jsx)(cu,{placeholder:(0,r.__)("Api Key","ablocks"),name:"drip_api_key",desc:e?.drip&&(0,r.__)("Drip Api key verified","ablocks")}),(0,S.jsxs)("span",{children:[(0,r.__)("To integrate with our forms you need an ","ablocks"),(0,S.jsx)("a",{href:"https://ablocks.pro/docs/how-to-use-drip-with-ablocks/",target:"_blank",rel:"noreferrer",children:(0,r.__)("API Key","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Validate Api key","ablocks"),suffix:"integrations",onClick:()=>o("drip")})]}),(0,S.jsxs)("div",{className:"ablocks-integrations",children:[(0,S.jsx)("h3",{children:(0,r.__)("GetResponse","ablocks")}),(0,S.jsx)("label",{children:(0,r.__)("Api Key","ablocks")})," ",(0,S.jsx)(cu,{placeholder:(0,r.__)("Api Key","ablocks"),name:"getresponse_api_key",desc:e?.getresponse&&(0, | |
| 790 | -r.__)("GetResponse Api key verified","ablocks")}),(0,S.jsxs)("span",{children:[(0,r.__)("To integrate with our forms you need an ","ablocks"),(0,S.jsx)("a",{href:"https://ablocks.pro/docs/how-to-use-getresponse-integration-with-ablocks/",target:"_blank",rel:"noreferrer",children:(0,r.__)("API Key","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Validate Api key","ablocks"),suffix:"integrations",onClick:()=>o("getresponse")})]}),(0,S.jsxs)("div",{className:"ablocks-integrations",children:[(0,S.jsx)("h3",{children:(0,r.__)("ConvertKit","ablocks")}),(0,S.jsx)("label",{children:(0,r.__)("Api Key","ablocks")})," ",(0,S.jsx)(cu,{placeholder:(0,r.__)("Api Key","ablocks"),name:"convertkit_api_key",desc:e?.convertkit&&(0,r.__)("ConvertKit Api key verified","ablocks")}),(0,S.jsxs)("span",{children:[(0,r.__)("To integrate with our forms you need an ","ablocks"),(0,S.jsx)("a",{href:"https://ablocks.pro/docs/how-to-use-convertkit-integration-with-ablocks/",target:"_blank", | |
| 791 | -rel:"noreferrer",children:(0,r.__)("API Key","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Validate Api key","ablocks"),suffix:"integrations",onClick:()=>o("convertkit")})]}),(0,S.jsxs)("div",{className:"ablocks-integrations",children:[(0,S.jsx)("h3",{children:(0,r.__)("MailerLite","ablocks")}),(0,S.jsx)("label",{children:(0,r.__)("Api Key","ablocks")})," ",(0,S.jsx)(cu,{placeholder:(0,r.__)("Api Key","ablocks"),name:"mailerlite_api_key",desc:e?.mailerlite&&(0,r.__)("MailerLite Api key verified","ablocks")}),(0,S.jsxs)("span",{children:[(0,r.__)("To integrate with our forms you need an ","ablocks"),(0,S.jsx)("a",{href:"https://ablocks.pro/docs/how-to-use-mailerlite-integration-with-ablocks/",target:"_blank",rel:"noreferrer",children:(0,r.__)("API Key","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Validate Api key","ablocks"),suffix:"integrations",onClick:()=>o("mailerlite")})]})]})},uu=()=>(0,S.jsxs)("div",{ | |
| 792 | -className:"ablocks-general-content ablocks-page-setup",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Page Setup","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"login_page",children:(0,r.__)("Login Page","ablocks")}),(0,S.jsx)(gl,{name:"login_page",placeholder:(0,r.__)("Search and select a Page","ablocks"),postType:"page",desc:(0,S.jsx)(S.Fragment,{})})]}),(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"registration_page",children:(0,r.__)("Register Page","ablocks")}),(0,S.jsx)(gl,{name:"registration_page",placeholder:(0,r.__)("Search and select a Page","ablocks"),postType:"page",desc:(0,S.jsx)(S.Fragment,{})})]}),(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"forget_password_page",children:(0,r.__)("Forget Password Page","ablocks")}),(0,S.jsx)(gl,{ | |
| 793 | -name:"forget_password_page",placeholder:(0,r.__)("Search and select a Page","ablocks"),postType:"page",desc:(0,S.jsx)(S.Fragment,{})})]})]});var mu=o(95093),_u=o.n(mu);const hu=(e,t)=>{try{const a=new URL(e);return a.searchParams.set("utm_source","storeengine-sdk"),a.searchParams.set("utm_medium","license-form"),a.searchParams.set("utm_campaign","license-activation-upsell"),a.searchParams.set("utm_content","purchase-link"),a.searchParams.set("utm_term","ablocks-pro"),a.searchParams.set("locale",t?.locale),a.searchParams.set("wordpress",t?.wordpress),a.searchParams.set("sdk_version",t?.version),a.searchParams.set("instance",t?.device_id),a.toString()}catch{return e}},pu={rest_url:null,nonce:null,device_id:null,version:null,locale:null,wordpress:null,license:{license:"",status:"inactive",device_id:"",slug:0,product_id:0,remaining:0,activations:0,limit:1,unlimited:0,expires:0,updated_at:""},package:{version:"",type:"",update:{},need_update:!1},optin:{allowed:!1,show:!0,last_send:0}, | |
| 794 | -...window.SE_SDK_ABLOCKS_PRO||{}},fu=(e,t)=>i.nC.post(pu.rest_url+e,t),bu=({sdk:e})=>(0,S.jsxs)("div",{className:"ablocks-hire-us",children:[(0,S.jsxs)("div",{className:"ablocks-hire-us__content",children:[(0,S.jsx)("h3",{className:"ablocks-hire-us__title",children:(0,r.__)("Need Expert Help? Hire Our Professionals","ablocks")}),(0,S.jsx)("p",{className:"ablocks-hire-us__desc",children:(0,r.__)("Get access to a skilled team of designers, developers, marketers, and content experts—ready to bring your ideas to life.","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-hire-us__actions",children:[(0,S.jsx)(Ja,{label:(0,r.__)("Hire Us","ablocks"),type:"link",link:hu("https://kodezen.agency/request-a-free-call/",e),target:"_blank",preset:"purple",size:"sm"}),(0,S.jsx)(Ja,{label:(0,r.__)("Learn More","ablocks"),type:"link",link:hu("https://kodezen.agency/",e),target:"_blank",preset:"white-border",size:"sm"})]})]}),(0,S.jsx)("img",{src:i.hq+"/assets/images/employees.png",alt:"employees", | |
| 795 | -className:"ablocks-hire-us__avatar"})]}),gu=()=>{const e=w(),[n,s]=(0,a.useState)(""),[o,l]=(0,a.useState)(pu.license),[c,d]=(0,a.useState)(pu.optin),[u,m]=(0,a.useState)(!1),[_,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),[b,g]=(0,a.useState)(!1),y=(0,a.useCallback)(async()=>{g(!0);try{const{data:e}=await(t={force:!0},i.nC.get(pu.rest_url+"license/status",{params:t}));l(e)}catch{const t=error?.response?.data?.message||(0,r.__)("Failed to fetch license status.","ablocks");e(wt({message:t,isShow:!0,type:"error"}))}finally{g(!1)}var t},[]),k="active"===o?.status;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"ablocks-content-section ablocks-content-section--license",children:k?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("h3",{className:"ablocks-content-section--license__heading",children:(0,r.__)("aBlocks Pro — License Active","ablocks")}),(0,S.jsx)("span",{className:"ablocks-content-section--license__sub-title",children:(0, | |
| 789 | +(0,r.__)("Failed to validate %s Api key","ablocks"),e),isShow:!0,type:"success"})),t(t=>({...t,[`${e}`]:!1})))}catch(e){}};return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Integrations","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-integrations",children:[(0,S.jsx)("h3",{children:(0,r.__)("MailChimp","ablocks")}),(0,S.jsx)("label",{children:(0,r.__)("Api Key","ablocks")})," ",(0,S.jsx)(du,{placeholder:(0,r.__)("Api Key","ablocks"),name:"mailchimp_api_key",desc:e?.mailchimp&&(0,r.__)("Mailchimp Api key verified","ablocks")}),(0,S.jsxs)("span",{children:[(0,r.__)("To integrate with our forms you need an ","ablocks"),(0,S.jsx)("a",{href:"https://ablocks.pro/docs/how-to-use-mailchimp-integration-with-ablocks/",target:"_blank",rel:"noreferrer",children:(0,r.__)("API Key","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Validate Api key","ablocks"),suffix:"integrations",onClick:()=>o("mailchimp")})]}),(0, | |
| 790 | +S.jsxs)("div",{className:"ablocks-integrations",children:[(0,S.jsx)("h3",{children:(0,r.__)("Drip","ablocks")}),(0,S.jsx)("label",{children:(0,r.__)("Api Key","ablocks")})," ",(0,S.jsx)(du,{placeholder:(0,r.__)("Api Key","ablocks"),name:"drip_api_key",desc:e?.drip&&(0,r.__)("Drip Api key verified","ablocks")}),(0,S.jsxs)("span",{children:[(0,r.__)("To integrate with our forms you need an ","ablocks"),(0,S.jsx)("a",{href:"https://ablocks.pro/docs/how-to-use-drip-with-ablocks/",target:"_blank",rel:"noreferrer",children:(0,r.__)("API Key","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Validate Api key","ablocks"),suffix:"integrations",onClick:()=>o("drip")})]}),(0,S.jsxs)("div",{className:"ablocks-integrations",children:[(0,S.jsx)("h3",{children:(0,r.__)("GetResponse","ablocks")}),(0,S.jsx)("label",{children:(0,r.__)("Api Key","ablocks")})," ",(0,S.jsx)(du,{placeholder:(0,r.__)("Api Key","ablocks"),name:"getresponse_api_key",desc:e?.getresponse&&(0, | |
| 791 | +r.__)("GetResponse Api key verified","ablocks")}),(0,S.jsxs)("span",{children:[(0,r.__)("To integrate with our forms you need an ","ablocks"),(0,S.jsx)("a",{href:"https://ablocks.pro/docs/how-to-use-getresponse-integration-with-ablocks/",target:"_blank",rel:"noreferrer",children:(0,r.__)("API Key","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Validate Api key","ablocks"),suffix:"integrations",onClick:()=>o("getresponse")})]}),(0,S.jsxs)("div",{className:"ablocks-integrations",children:[(0,S.jsx)("h3",{children:(0,r.__)("ConvertKit","ablocks")}),(0,S.jsx)("label",{children:(0,r.__)("Api Key","ablocks")})," ",(0,S.jsx)(du,{placeholder:(0,r.__)("Api Key","ablocks"),name:"convertkit_api_key",desc:e?.convertkit&&(0,r.__)("ConvertKit Api key verified","ablocks")}),(0,S.jsxs)("span",{children:[(0,r.__)("To integrate with our forms you need an ","ablocks"),(0,S.jsx)("a",{href:"https://ablocks.pro/docs/how-to-use-convertkit-integration-with-ablocks/",target:"_blank", | |
| 792 | +rel:"noreferrer",children:(0,r.__)("API Key","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Validate Api key","ablocks"),suffix:"integrations",onClick:()=>o("convertkit")})]}),(0,S.jsxs)("div",{className:"ablocks-integrations",children:[(0,S.jsx)("h3",{children:(0,r.__)("MailerLite","ablocks")}),(0,S.jsx)("label",{children:(0,r.__)("Api Key","ablocks")})," ",(0,S.jsx)(du,{placeholder:(0,r.__)("Api Key","ablocks"),name:"mailerlite_api_key",desc:e?.mailerlite&&(0,r.__)("MailerLite Api key verified","ablocks")}),(0,S.jsxs)("span",{children:[(0,r.__)("To integrate with our forms you need an ","ablocks"),(0,S.jsx)("a",{href:"https://ablocks.pro/docs/how-to-use-mailerlite-integration-with-ablocks/",target:"_blank",rel:"noreferrer",children:(0,r.__)("API Key","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Validate Api key","ablocks"),suffix:"integrations",onClick:()=>o("mailerlite")})]})]})},mu=()=>(0,S.jsxs)("div",{ | |
| 793 | +className:"ablocks-general-content ablocks-page-setup",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Page Setup","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"login_page",children:(0,r.__)("Login Page","ablocks")}),(0,S.jsx)(yl,{name:"login_page",placeholder:(0,r.__)("Search and select a Page","ablocks"),postType:"page",desc:(0,S.jsx)(S.Fragment,{})})]}),(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"registration_page",children:(0,r.__)("Register Page","ablocks")}),(0,S.jsx)(yl,{name:"registration_page",placeholder:(0,r.__)("Search and select a Page","ablocks"),postType:"page",desc:(0,S.jsx)(S.Fragment,{})})]}),(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"forget_password_page",children:(0,r.__)("Forget Password Page","ablocks")}),(0,S.jsx)(yl,{ | |
| 794 | +name:"forget_password_page",placeholder:(0,r.__)("Search and select a Page","ablocks"),postType:"page",desc:(0,S.jsx)(S.Fragment,{})})]})]});var _u=o(95093),hu=o.n(_u);const pu=(e,t)=>{try{const a=new URL(e);return a.searchParams.set("utm_source","storeengine-sdk"),a.searchParams.set("utm_medium","license-form"),a.searchParams.set("utm_campaign","license-activation-upsell"),a.searchParams.set("utm_content","purchase-link"),a.searchParams.set("utm_term","ablocks-pro"),a.searchParams.set("locale",t?.locale),a.searchParams.set("wordpress",t?.wordpress),a.searchParams.set("sdk_version",t?.version),a.searchParams.set("instance",t?.device_id),a.toString()}catch{return e}},fu={rest_url:null,nonce:null,device_id:null,version:null,locale:null,wordpress:null,license:{license:"",status:"inactive",device_id:"",slug:0,product_id:0,remaining:0,activations:0,limit:1,unlimited:0,expires:0,updated_at:""},package:{version:"",type:"",update:{},need_update:!1},optin:{allowed:!1,show:!0,last_send:0}, | |
| 795 | +...window.SE_SDK_ABLOCKS_PRO||{}},bu=(e,t)=>i.nC.post(fu.rest_url+e,t),gu=({sdk:e})=>(0,S.jsxs)("div",{className:"ablocks-hire-us",children:[(0,S.jsxs)("div",{className:"ablocks-hire-us__content",children:[(0,S.jsx)("h3",{className:"ablocks-hire-us__title",children:(0,r.__)("Need Expert Help? Hire Our Professionals","ablocks")}),(0,S.jsx)("p",{className:"ablocks-hire-us__desc",children:(0,r.__)("Get access to a skilled team of designers, developers, marketers, and content experts—ready to bring your ideas to life.","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-hire-us__actions",children:[(0,S.jsx)(Ja,{label:(0,r.__)("Hire Us","ablocks"),type:"link",link:pu("https://kodezen.agency/request-a-free-call/",e),target:"_blank",preset:"purple",size:"sm"}),(0,S.jsx)(Ja,{label:(0,r.__)("Learn More","ablocks"),type:"link",link:pu("https://kodezen.agency/",e),target:"_blank",preset:"white-border",size:"sm"})]})]}),(0,S.jsx)("img",{src:i.hq+"/assets/images/employees.png",alt:"employees", | |
| 796 | +className:"ablocks-hire-us__avatar"})]}),yu=()=>{const e=w(),[n,s]=(0,a.useState)(""),[o,l]=(0,a.useState)(fu.license),[c,d]=(0,a.useState)(fu.optin),[u,m]=(0,a.useState)(!1),[_,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),[b,g]=(0,a.useState)(!1),y=(0,a.useCallback)(async()=>{g(!0);try{const{data:e}=await(t={force:!0},i.nC.get(fu.rest_url+"license/status",{params:t}));l(e)}catch{const t=error?.response?.data?.message||(0,r.__)("Failed to fetch license status.","ablocks");e(wt({message:t,isShow:!0,type:"error"}))}finally{g(!1)}var t},[]),k="active"===o?.status;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"ablocks-content-section ablocks-content-section--license",children:k?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("h3",{className:"ablocks-content-section--license__heading",children:(0,r.__)("aBlocks Pro — License Active","ablocks")}),(0,S.jsx)("span",{className:"ablocks-content-section--license__sub-title",children:(0, | |
| 796 | 797 | r.__)("You have access to automatic updates, priority support, and all pro tools.","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-mid-section-logo ablocks-flex ablocks-flex-align-center ablocks-flex-gap-24",children:[(0,S.jsx)("img",{src:i.hq+"assets/images/logo.svg",alt:"ablocks logo"}),(0,S.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:(0,S.jsx)("path",{ |
| 797 | 798 | d:"M5.21227 4.00487C5.64135 4.0356 6.05888 4.15849 6.43639 4.36474C6.81391 4.57099 7.14259 4.8562 7.40026 5.20068C7.56556 5.42175 7.52066 5.73497 7.29967 5.90038C7.07855 6.06579 6.76488 6.02043 6.59948 5.79931C6.42771 5.56972 6.20852 5.37965 5.9569 5.24218C5.70526 5.10472 5.42698 5.02292 5.14098 5.00243C4.85497 4.98195 4.56785 5.02333 4.29918 5.12353C4.06402 5.21125 3.84772 5.34244 3.66149 5.50976L3.58336 5.58349L2.08971 7.07714L2.02331 7.14941C1.70093 7.51765 1.52392 7.9927 1.52819 8.48437C1.53281 9.00868 1.74336 9.51009 2.11413 9.88085C2.48489 10.2516 2.9863 10.4622 3.51061 10.4668C4.035 10.4713 4.54063 10.2696 4.91784 9.90526L5.76647 9.05663C5.96173 8.86137 6.27824 8.86137 6.4735 9.05663C6.66867 9.2519 6.66873 9.56843 6.4735 9.76366L5.61852 10.6186L5.50426 10.7241C4.95194 11.2076 4.23975 11.4731 3.50231 11.4668C2.71573 11.46 1.96332 11.1441 1.40709 10.5879C0.85087 10.0317 0.535023 9.27926 0.528188 8.49267C0.521818 7.75522 0.787322 7.04305 1.27086 6.49071L1.37633 6.37646L2.87633 4.87646L2.99303 4.76562C3.27237 4.51467 3.59686 4.31809 3.94957 4.18651C4.35258 4.03619 4.78324 3.97416 5.21227 4.00487ZM8.49791 0.533194C9.28447 0.540055 10.0369 0.855899 10.5931 1.4121C11.1493 1.96831 11.4647 2.72079 11.4715 3.50732C11.4783 4.29377 11.1761 5.05143 10.6298 5.61718L9.1234 7.12353C8.81929 7.42771 8.45316 7.66314 8.05016 7.81347C7.64718 7.96375 7.21646 8.02534 6.78747 7.99462C6.35842 7.96387 5.94082 7.84148 5.56334 7.63525C5.18588 7.429 4.85712 7.14375 4.59948 6.79931C4.43421 6.57819 4.47948 6.26497 4.70055 6.0996C4.92167 5.93424 5.23487 5.97956 5.40026 6.20068C5.57202 6.43028 5.79121 6.62032 6.04284 6.7578C6.29451 6.89531 6.57319 6.97706 6.85924 6.99755C7.14522 7.018 7.43241 6.97666 7.70104 6.87646C7.9697 6.77622 8.21365 6.61929 8.41637 6.4165L9.91637 4.9165C10.2769 4.53996 10.4761 4.03714 10.4715 3.51562C10.4669 2.99136 10.2568 2.48989 9.8861 2.11913C9.51528 1.74832 9.01352 1.53775 8.48913 1.53319C7.96473 1.52864 7.45959 1.7304 7.08239 2.09472L6.22741 2.94433C6.03158 3.13902 5.71507 3.1382 5.52038 2.94237C5.32576 2.74655 5.32655 2.43002 5.52233 2.23534L6.38268 1.38036C6.95337 0.829005 7.71132 0.526359 8.49791 0.533194Z" |
| 798 | 799 | })}),(0,S.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,S.jsx)("path",{d:"M12.375 6C12.5821 6 12.75 5.83211 12.75 5.625C12.75 5.41789 12.5821 5.25 12.375 5.25C12.1679 5.25 12 5.41789 12 5.625C12 5.83211 12.1679 6 12.375 6Z",fill:"currentColor"}),(0,S.jsx)("path",{ |
| 799 | 800 | d:"M6.75 12.7499C6.75003 12.3521 6.90818 11.9706 7.18945 11.6893C7.47075 11.408 7.85221 11.2499 8.25 11.2499H8.37891L8.45288 11.2462C8.62458 11.2291 8.78612 11.1532 8.90918 11.0301L9.52002 10.4193L9.60059 10.3497C9.77013 10.2227 9.98595 10.1728 10.1938 10.2135L10.2964 10.242L10.4626 10.2955C11.2982 10.5475 12.194 10.5285 13.0203 10.2384C13.9015 9.92897 14.6516 9.32959 15.1479 8.53843C15.6443 7.74726 15.8578 6.81074 15.7529 5.88267C15.648 4.95484 15.231 4.09011 14.5708 3.42979C13.9104 2.76942 13.0452 2.35261 12.1172 2.24766C11.1891 2.14276 10.2526 2.35555 9.46143 2.85191C8.67029 3.34824 8.07089 4.09841 7.76147 4.97959C7.45207 5.86085 7.4513 6.82146 7.75854 7.70347C7.85305 7.9751 7.78394 8.27719 7.58057 8.48057L2.46973 13.5907C2.34666 13.7137 2.27075 13.8753 2.25366 14.047L2.25 14.121V15.7499H4.5V14.9999C4.50003 14.6021 4.65818 14.2206 4.93945 13.9393C5.22075 13.658 5.6022 13.4999 6 13.4999H6.75V12.7499ZM8.25 13.4999C8.25 13.8977 8.09181 14.2791 7.81055 14.5604C7.52924 14.8417 7.14782 14.9999 6.75 14.9999H6V15.7499C6 16.1477 5.84181 16.5291 5.56055 16.8104C5.27924 17.0917 4.89782 17.2499 4.5 17.2499H2.25C1.85218 17.2499 1.47076 17.0917 1.18945 16.8104C0.908186 16.5291 0.75 16.1477 0.75 15.7499V14.121C0.750127 13.5243 0.987236 12.952 1.40918 12.5301L6.20288 7.7357C5.92982 6.66452 5.9779 5.53273 6.34644 4.48301C6.76835 3.2813 7.58567 2.25801 8.66455 1.58116C9.74338 0.904418 11.0202 0.61415 12.2856 0.757182C13.5511 0.900267 14.7308 1.46801 15.6313 2.36851C16.5319 3.26903 17.1003 4.44876 17.2434 5.71421C17.3864 6.97967 17.0954 8.25649 16.4187 9.33531C15.7418 10.4142 14.7186 11.2315 13.5168 11.6534C12.4668 12.0221 11.3349 12.0696 10.2634 11.7962L9.96973 12.0907C9.60062 12.4599 9.11654 12.6876 8.60156 12.7389L8.37891 12.7499H8.25V13.4999ZM13.5 5.62486C13.5 6.24618 12.9963 6.74986 12.375 6.74986C11.7925 6.74986 11.3134 6.30721 11.2559 5.73985L11.25 5.62486L11.2559 5.50987C11.3135 4.94262 11.7925 4.49986 12.375 4.49986L12.49 4.50572C13.0573 4.56331 13.4999 5.04241 13.5 5.62486Z", |
| 800 | -fill:"currentColor"})]})]}),(0,S.jsxs)("div",{className:"ablocks-license-field ablocks-flex ablocks-flex-align-center ablocks-flex-gap-16",children:[(0,S.jsx)("input",{type:"text",className:"ablocks-input",value:o?.license??"",readOnly:!0}),(0,S.jsx)(Ja,{label:(0,r.__)("Deactivate License","ablocks"),preset:"red",onClick:async()=>{h(!0);try{const{data:{license:t}}=await fu("license/deactivate",{});l(t),e(wt({message:(0,r.__)("License deactivated successfully.","ablocks"),isShow:!0,type:"success"}))}catch(t){const a=t?.response?.data?.message||(0,r.__)("Failed to deactivate license.","ablocks");e(wt({message:a,isShow:!0,type:"error"}))}finally{h(!1)}},isLoading:_,loadingLabel:(0,r.__)("Deactivating…","ablocks"),size:"sm"}),(0,S.jsx)(Ja,{label:(0,r.__)("Manage License","ablocks"),type:"link",link:"https://store.kodezen.com/dashboard/license-keys/",target:"_blank",rel:"noopener noreferrer",size:"sm"})]}),(0,S.jsxs)("label",{ | |
| 801 | -className:"ablocks-optin-checkbox ablocks-flex ablocks-flex-align-center ablocks-flex-gap-8",children:[(0,S.jsx)("input",{type:"checkbox",checked:c?.allowed??!1,onChange:t=>(async t=>{f(!0);try{const{data:e}=await fu("insights/optin",{opt_in:t});d(e)}catch(t){const a=t?.response?.data?.message||(0,r.__)("Failed to update opt-in setting.","ablocks");e(wt({message:a,isShow:!0,type:"error"}))}finally{f(!1)}})(t.target.checked),disabled:p}),(0,S.jsx)("span",{children:(0,r.__)("Allow usage tracking to help improve aBlocks Pro.","ablocks")})]}),(0,S.jsx)("span",{className:"ablocks-content-section--license__separator"}),(0,S.jsxs)("div",{className:"ablocks-license-meta ablocks-flex ablocks-flex-justify-center ablocks-flex-gap-24",children:[(0,S.jsxs)("div",{className:"ablocks-license-meta__item",children:[(0,S.jsx)("span",{className:"ablocks-license-meta__label",children:(0,r.__)("Status:","ablocks")}),(0,S.jsx)("span",{ | |
| 802 | -className:`ablocks-license-meta__value ablocks-license-meta__value--${o?.status}`,children:k?(0,r.__)("Active","ablocks"):o?.status})]}),(0,S.jsxs)("div",{className:"ablocks-license-meta__item",children:[(0,S.jsx)("span",{className:"ablocks-license-meta__label",children:(0,r.__)("Last Checked:","ablocks")}),(0,S.jsxs)("span",{className:"ablocks-license-meta__value",children:[_u().utc(o?.updated_at).local().format("YYYY-MM-DD HH:mm:ss"),(0,S.jsx)("button",{type:"button",className:"ablocks-license-refresh",onClick:y,"aria-label":(0,r.__)("Refresh status","ablocks"),children:b?(0,S.jsx)(Pa.Spinner,{style:{margin:0}}):(0,S.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",children:(0,S.jsx)("path",{ | |
| 803 | -d:"M16.031 6.825c5.532 0.002 10.016 4.487 10.016 10.020 0 5.534-4.486 10.020-10.020 10.020s-10.020-4.486-10.020-10.020c0-1.516 0.337-2.954 0.939-4.242l-0.026 0.062c0.048-0.113 0.075-0.244 0.075-0.381 0-0.553-0.449-1.002-1.002-1.002-0.387 0-0.723 0.22-0.89 0.542l-0.003 0.006c-0.692 1.472-1.096 3.197-1.096 5.016 0 6.64 5.383 12.023 12.023 12.023s12.023-5.383 12.023-12.023c0-6.64-5.382-12.022-12.021-12.023h-0v2.004zM16.031 9.763v-7.879c-0-0.277-0.224-0.501-0.501-0.501-0.122 0-0.234 0.044-0.321 0.117l0.001-0.001-4.729 3.94c-0.11 0.093-0.18 0.231-0.18 0.385s0.070 0.292 0.179 0.384l0.001 0.001 4.729 3.94c0.086 0.072 0.198 0.116 0.321 0.116 0.277 0 0.501-0.224 0.501-0.501v0z"})})})]})]}),(0,S.jsxs)("div",{className:"ablocks-license-meta__item",children:[(0,S.jsx)("span",{className:"ablocks-license-meta__label",children:(0,r.__)("Expires:","ablocks")}),(0,S.jsx)("span",{className:"ablocks-license-meta__value",children:o?.expires?_u().utc(o.expires).local().format("YYYY-MM-DD HH:mm"):(0, | |
| 801 | +fill:"currentColor"})]})]}),(0,S.jsxs)("div",{className:"ablocks-license-field ablocks-flex ablocks-flex-align-center ablocks-flex-gap-16",children:[(0,S.jsx)("input",{type:"text",className:"ablocks-input",value:o?.license??"",readOnly:!0}),(0,S.jsx)(Ja,{label:(0,r.__)("Deactivate License","ablocks"),preset:"red",onClick:async()=>{h(!0);try{const{data:{license:t}}=await bu("license/deactivate",{});l(t),e(wt({message:(0,r.__)("License deactivated successfully.","ablocks"),isShow:!0,type:"success"}))}catch(t){const a=t?.response?.data?.message||(0,r.__)("Failed to deactivate license.","ablocks");e(wt({message:a,isShow:!0,type:"error"}))}finally{h(!1)}},isLoading:_,loadingLabel:(0,r.__)("Deactivating…","ablocks"),size:"sm"}),(0,S.jsx)(Ja,{label:(0,r.__)("Manage License","ablocks"),type:"link",link:"https://store.kodezen.com/dashboard/license-keys/",target:"_blank",rel:"noopener noreferrer",size:"sm"})]}),(0,S.jsxs)("label",{ | |
| 802 | +className:"ablocks-optin-checkbox ablocks-flex ablocks-flex-align-center ablocks-flex-gap-8",children:[(0,S.jsx)("input",{type:"checkbox",checked:c?.allowed??!1,onChange:t=>(async t=>{f(!0);try{const{data:e}=await bu("insights/optin",{opt_in:t});d(e)}catch(t){const a=t?.response?.data?.message||(0,r.__)("Failed to update opt-in setting.","ablocks");e(wt({message:a,isShow:!0,type:"error"}))}finally{f(!1)}})(t.target.checked),disabled:p}),(0,S.jsx)("span",{children:(0,r.__)("Allow usage tracking to help improve aBlocks Pro.","ablocks")})]}),(0,S.jsx)("span",{className:"ablocks-content-section--license__separator"}),(0,S.jsxs)("div",{className:"ablocks-license-meta ablocks-flex ablocks-flex-justify-center ablocks-flex-gap-24",children:[(0,S.jsxs)("div",{className:"ablocks-license-meta__item",children:[(0,S.jsx)("span",{className:"ablocks-license-meta__label",children:(0,r.__)("Status:","ablocks")}),(0,S.jsx)("span",{ | |
| 803 | +className:`ablocks-license-meta__value ablocks-license-meta__value--${o?.status}`,children:k?(0,r.__)("Active","ablocks"):o?.status})]}),(0,S.jsxs)("div",{className:"ablocks-license-meta__item",children:[(0,S.jsx)("span",{className:"ablocks-license-meta__label",children:(0,r.__)("Last Checked:","ablocks")}),(0,S.jsxs)("span",{className:"ablocks-license-meta__value",children:[hu().utc(o?.updated_at).local().format("YYYY-MM-DD HH:mm:ss"),(0,S.jsx)("button",{type:"button",className:"ablocks-license-refresh",onClick:y,"aria-label":(0,r.__)("Refresh status","ablocks"),children:b?(0,S.jsx)(Pa.Spinner,{style:{margin:0}}):(0,S.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",children:(0,S.jsx)("path",{ | |
| 804 | +d:"M16.031 6.825c5.532 0.002 10.016 4.487 10.016 10.020 0 5.534-4.486 10.020-10.020 10.020s-10.020-4.486-10.020-10.020c0-1.516 0.337-2.954 0.939-4.242l-0.026 0.062c0.048-0.113 0.075-0.244 0.075-0.381 0-0.553-0.449-1.002-1.002-1.002-0.387 0-0.723 0.22-0.89 0.542l-0.003 0.006c-0.692 1.472-1.096 3.197-1.096 5.016 0 6.64 5.383 12.023 12.023 12.023s12.023-5.383 12.023-12.023c0-6.64-5.382-12.022-12.021-12.023h-0v2.004zM16.031 9.763v-7.879c-0-0.277-0.224-0.501-0.501-0.501-0.122 0-0.234 0.044-0.321 0.117l0.001-0.001-4.729 3.94c-0.11 0.093-0.18 0.231-0.18 0.385s0.070 0.292 0.179 0.384l0.001 0.001 4.729 3.94c0.086 0.072 0.198 0.116 0.321 0.116 0.277 0 0.501-0.224 0.501-0.501v0z"})})})]})]}),(0,S.jsxs)("div",{className:"ablocks-license-meta__item",children:[(0,S.jsx)("span",{className:"ablocks-license-meta__label",children:(0,r.__)("Expires:","ablocks")}),(0,S.jsx)("span",{className:"ablocks-license-meta__value",children:o?.expires?hu().utc(o.expires).local().format("YYYY-MM-DD HH:mm"):(0, | |
| 804 | 805 | r.__)("N/A","ablocks")})]}),(0,S.jsxs)("div",{className:"ablocks-license-meta__item",children:[(0,S.jsx)("span",{className:"ablocks-license-meta__label",children:(0,r.__)("Activation Remaining:","ablocks")}),(0,S.jsx)("span",{className:"ablocks-license-meta__value",children:o?.unlimited?(0,r.__)("Unlimited","ablocks"):(0,r.sprintf)((0,r.__)("%1$d out of %2$s","ablocks"),o?.remaining,o?.limit)})]}),(0,S.jsxs)("div",{className:"ablocks-license-meta__item",children:[(0,S.jsx)("span",{className:"ablocks-license-meta__label",children:(0,r.__)("Automatic Update:","ablocks")}),(0,S.jsx)("span",{className:"ablocks-license-meta__value",children:(0,r.__)("Enabled","ablocks")})]})]})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("h3",{className:"ablocks-content-section--license__heading",children:(0,r.__)("Activate aBlocks Pro for updates & support.","ablocks")}),(0,S.jsx)("span",{className:"ablocks-content-section--license__sub-title",children:(0, |
| 805 | 806 | r.__)("Activate aBlocks Pro to unlock automatic updates, priority support, and all tools to build stunning WordPress pages.","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-mid-section-logo ablocks-flex ablocks-flex-align-center ablocks-flex-gap-24",children:[(0,S.jsx)("img",{src:i.hq+"assets/images/logo.svg",alt:"ablocks logo"}),(0,S.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:(0,S.jsx)("path",{ |
| 806 | 807 | d:"M5.21227 4.00487C5.64135 4.0356 6.05888 4.15849 6.43639 4.36474C6.81391 4.57099 7.14259 4.8562 7.40026 5.20068C7.56556 5.42175 7.52066 5.73497 7.29967 5.90038C7.07855 6.06579 6.76488 6.02043 6.59948 5.79931C6.42771 5.56972 6.20852 5.37965 5.9569 5.24218C5.70526 5.10472 5.42698 5.02292 5.14098 5.00243C4.85497 4.98195 4.56785 5.02333 4.29918 5.12353C4.06402 5.21125 3.84772 5.34244 3.66149 5.50976L3.58336 5.58349L2.08971 7.07714L2.02331 7.14941C1.70093 7.51765 1.52392 7.9927 1.52819 8.48437C1.53281 9.00868 1.74336 9.51009 2.11413 9.88085C2.48489 10.2516 2.9863 10.4622 3.51061 10.4668C4.035 10.4713 4.54063 10.2696 4.91784 9.90526L5.76647 9.05663C5.96173 8.86137 6.27824 8.86137 6.4735 9.05663C6.66867 9.2519 6.66873 9.56843 6.4735 9.76366L5.61852 10.6186L5.50426 10.7241C4.95194 11.2076 4.23975 11.4731 3.50231 11.4668C2.71573 11.46 1.96332 11.1441 1.40709 10.5879C0.85087 10.0317 0.535023 9.27926 0.528188 8.49267C0.521818 7.75522 0.787322 7.04305 1.27086 6.49071L1.37633 6.37646L2.87633 4.87646L2.99303 4.76562C3.27237 4.51467 3.59686 4.31809 3.94957 4.18651C4.35258 4.03619 4.78324 3.97416 5.21227 4.00487ZM8.49791 0.533194C9.28447 0.540055 10.0369 0.855899 10.5931 1.4121C11.1493 1.96831 11.4647 2.72079 11.4715 3.50732C11.4783 4.29377 11.1761 5.05143 10.6298 5.61718L9.1234 7.12353C8.81929 7.42771 8.45316 7.66314 8.05016 7.81347C7.64718 7.96375 7.21646 8.02534 6.78747 7.99462C6.35842 7.96387 5.94082 7.84148 5.56334 7.63525C5.18588 7.429 4.85712 7.14375 4.59948 6.79931C4.43421 6.57819 4.47948 6.26497 4.70055 6.0996C4.92167 5.93424 5.23487 5.97956 5.40026 6.20068C5.57202 6.43028 5.79121 6.62032 6.04284 6.7578C6.29451 6.89531 6.57319 6.97706 6.85924 6.99755C7.14522 7.018 7.43241 6.97666 7.70104 6.87646C7.9697 6.77622 8.21365 6.61929 8.41637 6.4165L9.91637 4.9165C10.2769 4.53996 10.4761 4.03714 10.4715 3.51562C10.4669 2.99136 10.2568 2.48989 9.8861 2.11913C9.51528 1.74832 9.01352 1.53775 8.48913 1.53319C7.96473 1.52864 7.45959 1.7304 7.08239 2.09472L6.22741 2.94433C6.03158 3.13902 5.71507 3.1382 5.52038 2.94237C5.32576 2.74655 5.32655 2.43002 5.52233 2.23534L6.38268 1.38036C6.95337 0.829005 7.71132 0.526359 8.49791 0.533194Z" |
| 807 | 808 | })}),(0,S.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,S.jsx)("path",{d:"M12.375 6C12.5821 6 12.75 5.83211 12.75 5.625C12.75 5.41789 12.5821 5.25 12.375 5.25C12.1679 5.25 12 5.41789 12 5.625C12 5.83211 12.1679 6 12.375 6Z",fill:"currentColor"}),(0,S.jsx)("path",{ |
| 808 | 809 | d:"M6.75 12.7499C6.75003 12.3521 6.90818 11.9706 7.18945 11.6893C7.47075 11.408 7.85221 11.2499 8.25 11.2499H8.37891L8.45288 11.2462C8.62458 11.2291 8.78612 11.1532 8.90918 11.0301L9.52002 10.4193L9.60059 10.3497C9.77013 10.2227 9.98595 10.1728 10.1938 10.2135L10.2964 10.242L10.4626 10.2955C11.2982 10.5475 12.194 10.5285 13.0203 10.2384C13.9015 9.92897 14.6516 9.32959 15.1479 8.53843C15.6443 7.74726 15.8578 6.81074 15.7529 5.88267C15.648 4.95484 15.231 4.09011 14.5708 3.42979C13.9104 2.76942 13.0452 2.35261 12.1172 2.24766C11.1891 2.14276 10.2526 2.35555 9.46143 2.85191C8.67029 3.34824 8.07089 4.09841 7.76147 4.97959C7.45207 5.86085 7.4513 6.82146 7.75854 7.70347C7.85305 7.9751 7.78394 8.27719 7.58057 8.48057L2.46973 13.5907C2.34666 13.7137 2.27075 13.8753 2.25366 14.047L2.25 14.121V15.7499H4.5V14.9999C4.50003 14.6021 4.65818 14.2206 4.93945 13.9393C5.22075 13.658 5.6022 13.4999 6 13.4999H6.75V12.7499ZM8.25 13.4999C8.25 13.8977 8.09181 14.2791 7.81055 14.5604C7.52924 14.8417 7.14782 14.9999 6.75 14.9999H6V15.7499C6 16.1477 5.84181 16.5291 5.56055 16.8104C5.27924 17.0917 4.89782 17.2499 4.5 17.2499H2.25C1.85218 17.2499 1.47076 17.0917 1.18945 16.8104C0.908186 16.5291 0.75 16.1477 0.75 15.7499V14.121C0.750127 13.5243 0.987236 12.952 1.40918 12.5301L6.20288 7.7357C5.92982 6.66452 5.9779 5.53273 6.34644 4.48301C6.76835 3.2813 7.58567 2.25801 8.66455 1.58116C9.74338 0.904418 11.0202 0.61415 12.2856 0.757182C13.5511 0.900267 14.7308 1.46801 15.6313 2.36851C16.5319 3.26903 17.1003 4.44876 17.2434 5.71421C17.3864 6.97967 17.0954 8.25649 16.4187 9.33531C15.7418 10.4142 14.7186 11.2315 13.5168 11.6534C12.4668 12.0221 11.3349 12.0696 10.2634 11.7962L9.96973 12.0907C9.60062 12.4599 9.11654 12.6876 8.60156 12.7389L8.37891 12.7499H8.25V13.4999ZM13.5 5.62486C13.5 6.24618 12.9963 6.74986 12.375 6.74986C11.7925 6.74986 11.3134 6.30721 11.2559 5.73985L11.25 5.62486L11.2559 5.50987C11.3135 4.94262 11.7925 4.49986 12.375 4.49986L12.49 4.50572C13.0573 4.56331 13.4999 5.04241 13.5 5.62486Z", |
| 809 | -fill:"currentColor"})]})]}),(0,S.jsxs)("div",{className:"ablocks-license-field ablocks-flex ablocks-flex-align-center ablocks-flex-gap-16",children:[(0,S.jsx)("input",{type:"text",className:"ablocks-input",placeholder:(0,r.__)("Enter your license key","ablocks"),value:n,onChange:e=>s(e.target.value)}),(0,S.jsx)(Ja,{label:(0,r.__)("Activate License","ablocks"),onClick:async()=>{if(n.trim()){m(!0);try{const{data:{license:t}}=await fu("license/activate",{license:n.trim()});l(t),s(""),e(wt({message:(0,r.__)("License activated successfully.","ablocks"),isShow:!0,type:"success"}))}catch(t){const a=t?.response?.data?.message||(0,r.__)("Failed to activate license.","ablocks");e(wt({message:a,isShow:!0,type:"error"}))}finally{m(!1)}}else e(wt({message:(0,r.__)("Please enter a license key.","ablocks"),isShow:!0,type:"error"}))},isLoading:u,loadingLabel:(0,r.__)("Activating…","ablocks"),size:"sm"})]}),(0,S.jsx)("p",{className:"ablocks-content-section--license__purchase",children:(0, | |
| 810 | -t.createInterpolateElement)((0,r.__)("Don't have license key? <PurchaseButton/>","ablocks"),{PurchaseButton:(0,S.jsx)("a",{href:hu("https://ablocks.pro/",pu),target:"_blank",rel:"noopener noreferrer",children:(0,r.__)("Purchase one here","ablocks")})})})]})}),(0,S.jsx)(bu,{sdk:pu})]})};function yu(){const e=j(e=>e.settings),t=w(),o=function(){const{search:e}=(0,s.zy)();return n().useMemo(()=>new URLSearchParams(e),[e])}(),l=(0,s.Zp)(),c=o.get("page"),d=o.get("path"),u=o.get("sub");(0,a.useEffect)(()=>{e?.data||t(kn())},[]),(0,a.useEffect)(()=>{l(`${i.Y3}admin.php?page=${c}&path=${d??"editor"}${u?`&sub=${u}`:""}`,{replace:!0})},[e.data]);const m=i.zX?[{name:"license",svg:(0,S.jsx)("span",{className:"ablocks-icon",children:(0,S.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,S.jsx)("path",{ | |
| 810 | +fill:"currentColor"})]})]}),(0,S.jsxs)("div",{className:"ablocks-license-field ablocks-flex ablocks-flex-align-center ablocks-flex-gap-16",children:[(0,S.jsx)("input",{type:"text",className:"ablocks-input",placeholder:(0,r.__)("Enter your license key","ablocks"),value:n,onChange:e=>s(e.target.value)}),(0,S.jsx)(Ja,{label:(0,r.__)("Activate License","ablocks"),onClick:async()=>{if(n.trim()){m(!0);try{const{data:{license:t}}=await bu("license/activate",{license:n.trim()});l(t),s(""),e(wt({message:(0,r.__)("License activated successfully.","ablocks"),isShow:!0,type:"success"}))}catch(t){const a=t?.response?.data?.message||(0,r.__)("Failed to activate license.","ablocks");e(wt({message:a,isShow:!0,type:"error"}))}finally{m(!1)}}else e(wt({message:(0,r.__)("Please enter a license key.","ablocks"),isShow:!0,type:"error"}))},isLoading:u,loadingLabel:(0,r.__)("Activating…","ablocks"),size:"sm"})]}),(0,S.jsx)("p",{className:"ablocks-content-section--license__purchase",children:(0, | |
| 811 | +t.createInterpolateElement)((0,r.__)("Don't have license key? <PurchaseButton/>","ablocks"),{PurchaseButton:(0,S.jsx)("a",{href:pu("https://ablocks.pro/",fu),target:"_blank",rel:"noopener noreferrer",children:(0,r.__)("Purchase one here","ablocks")})})})]})}),(0,S.jsx)(gu,{sdk:fu})]})};function ku(){const e=j(e=>e.settings),t=w(),o=function(){const{search:e}=(0,s.zy)();return n().useMemo(()=>new URLSearchParams(e),[e])}(),l=(0,s.Zp)(),c=o.get("page"),d=o.get("path"),u=o.get("sub");(0,a.useEffect)(()=>{e?.data||t(kn())},[]),(0,a.useEffect)(()=>{l(`${i.Y3}admin.php?page=${c}&path=${d??"editor"}${u?`&sub=${u}`:""}`,{replace:!0})},[e.data]);const m=i.zX?[{name:"license",svg:(0,S.jsx)("span",{className:"ablocks-icon",children:(0,S.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,S.jsx)("path",{ | |
| 811 | 812 | d:"M12.375 6C12.5821 6 12.75 5.83211 12.75 5.625C12.75 5.41789 12.5821 5.25 12.375 5.25C12.1679 5.25 12 5.41789 12 5.625C12 5.83211 12.1679 6 12.375 6Z",fill:"currentColor"}),(0,S.jsx)("path",{ |
| 812 | 813 | d:"M6.75 12.7499C6.75003 12.3521 6.90818 11.9706 7.18945 11.6893C7.47075 11.408 7.85221 11.2499 8.25 11.2499H8.37891L8.45288 11.2462C8.62458 11.2291 8.78612 11.1532 8.90918 11.0301L9.52002 10.4193L9.60059 10.3497C9.77013 10.2227 9.98595 10.1728 10.1938 10.2135L10.2964 10.242L10.4626 10.2955C11.2982 10.5475 12.194 10.5285 13.0203 10.2384C13.9015 9.92897 14.6516 9.32959 15.1479 8.53843C15.6443 7.74726 15.8578 6.81074 15.7529 5.88267C15.648 4.95484 15.231 4.09011 14.5708 3.42979C13.9104 2.76942 13.0452 2.35261 12.1172 2.24766C11.1891 2.14276 10.2526 2.35555 9.46143 2.85191C8.67029 3.34824 8.07089 4.09841 7.76147 4.97959C7.45207 5.86085 7.4513 6.82146 7.75854 7.70347C7.85305 7.9751 7.78394 8.27719 7.58057 8.48057L2.46973 13.5907C2.34666 13.7137 2.27075 13.8753 2.25366 14.047L2.25 14.121V15.7499H4.5V14.9999C4.50003 14.6021 4.65818 14.2206 4.93945 13.9393C5.22075 13.658 5.6022 13.4999 6 13.4999H6.75V12.7499ZM8.25 13.4999C8.25 13.8977 8.09181 14.2791 7.81055 14.5604C7.52924 14.8417 7.14782 14.9999 6.75 14.9999H6V15.7499C6 16.1477 5.84181 16.5291 5.56055 16.8104C5.27924 17.0917 4.89782 17.2499 4.5 17.2499H2.25C1.85218 17.2499 1.47076 17.0917 1.18945 16.8104C0.908186 16.5291 0.75 16.1477 0.75 15.7499V14.121C0.750127 13.5243 0.987236 12.952 1.40918 12.5301L6.20288 7.7357C5.92982 6.66452 5.9779 5.53273 6.34644 4.48301C6.76835 3.2813 7.58567 2.25801 8.66455 1.58116C9.74338 0.904418 11.0202 0.61415 12.2856 0.757182C13.5511 0.900267 14.7308 1.46801 15.6313 2.36851C16.5319 3.26903 17.1003 4.44876 17.2434 5.71421C17.3864 6.97967 17.0954 8.25649 16.4187 9.33531C15.7418 10.4142 14.7186 11.2315 13.5168 11.6534C12.4668 12.0221 11.3349 12.0696 10.2634 11.7962L9.96973 12.0907C9.60062 12.4599 9.11654 12.6876 8.60156 12.7389L8.37891 12.7499H8.25V13.4999ZM13.5 5.62486C13.5 6.24618 12.9963 6.74986 12.375 6.74986C11.7925 6.74986 11.3134 6.30721 11.2559 5.73985L11.25 5.62486L11.2559 5.50987C11.3135 4.94262 11.7925 4.49986 12.375 4.49986L12.49 4.50572C13.0573 4.56331 13.4999 5.04241 13.5 5.62486Z", |
| 813 | 814 | fill:"currentColor"})]})}),title:(0,r.__)("License","ablocks"),className:"ablocks-settings ablocks-settings--License",route:"&path=license"}]:[],_=[{name:"editor",icon:"ablocks-icon ablocks-icon--editor-options",title:(0,r.__)("Editor Options","ablocks"),className:"ablocks-settings ablocks-settings--general",route:"&path=editor"},{name:"asset",icon:"ablocks-icon ablocks-icon--assets-generation",title:(0,r.__)("Asset Generation","ablocks"),className:"ablocks-settings ablocks-settings--asset",route:"&path=asset"},{name:"integrations",icon:"ablocks-icon ablocks-icon--integrations",title:(0,r.__)("Integrations","ablocks"),className:"ablocks-settings ablocks-settings--integrations",route:"&path=integrations"},{name:"page",icon:"ablocks-icon ablocks-icon--page-setup",title:(0,r.__)("Page Setup","ablocks"),className:"ablocks-settings ablocks-settings--page-setup",route:"&path=page"},{name:"performance",icon:"ablocks-icon ablocks-icon--performance",title:(0,r.__)("Performance","ablocks"), |
| 814 | -className:"ablocks-settings ablocks-settings--performance",route:"&path=performance",subTabs:dl.map(e=>({name:e.name,title:e.title}))},{name:"link-passthrough",icon:"ablocks-icon ablocks-icon--integrations",title:(0,r.__)("Link Passthrough","ablocks"),className:"ablocks-settings ablocks-settings--link-passthrough",route:"&path=link-passthrough"},{name:"visibility",icon:"ablocks-icon ablocks-icon--visibility",title:(0,r.__)("Site Visibility","ablocks"),className:"ablocks-settings ablocks-settings--visibility",route:"&path=visibility"},{name:"classes",icon:"ablocks-icon ablocks-icon--editor-options",title:(0,r.__)("Reusable Classes","ablocks"),className:"ablocks-settings ablocks-settings--classes",route:"&path=classes"},{name:"dashboard",icon:"ablocks-icon ablocks-icon--frontend-dashboard",title:(0,r.__)("Frontend Dashboard","ablocks"),className:"ablocks-settings ablocks-settings--frontend-dashboard",route:"&path=dashboard"},...m],h=_?.find(e=>e?.name===d),p=h?.className||"",f=e=>{ | |
| 815 | -switch(e){case"editor":default:return(0,S.jsx)(nl,{});case"asset":return(0,S.jsx)(sl,{});case"integrations":return(0,S.jsx)(du,{});case"page":return(0,S.jsx)(uu,{});case"performance":return(0,S.jsx)(ul,{});case"link-passthrough":return(0,S.jsx)(hl,{});case"visibility":return(0,S.jsx)(pl,{});case"classes":return(0,S.jsx)(fl,{});case"dashboard":return(0,S.jsx)(iu,{});case"license":return(0,S.jsx)(gu,{})}};return(0,S.jsx)(n().Fragment,{children:(0,S.jsx)(pa,{enableReinitialize:!0,initialValues:{default_container_width:1280,container_padding:10,container_element_gap:20,enabled_assets_file_generation:!0,enabled_block_copy_paste_style:!0,lock_global_typography:!1,lock_global_typography_strict:!1,lock_global_colors:!1,enabled_load_google_font_locally:!1,enabled_only_selected_fonts:!1,selected_fonts:[],paste_google_docs:!0,paste_convert_webp:!0,paste_webp_quality:92,font_metric_fallback:!0,perf_lazy_images:!0,perf_lcp_eager_count:1,perf_inline_css:!0,perf_delay_js:!1,perf_delay_js_timeout:5e3, | |
| 815 | +className:"ablocks-settings ablocks-settings--performance",route:"&path=performance",subTabs:ul.map(e=>({name:e.name,title:e.title}))},{name:"link-passthrough",icon:"ablocks-icon ablocks-icon--integrations",title:(0,r.__)("Link Passthrough","ablocks"),className:"ablocks-settings ablocks-settings--link-passthrough",route:"&path=link-passthrough"},{name:"visibility",icon:"ablocks-icon ablocks-icon--visibility",title:(0,r.__)("Site Visibility","ablocks"),className:"ablocks-settings ablocks-settings--visibility",route:"&path=visibility"},{name:"classes",icon:"ablocks-icon ablocks-icon--editor-options",title:(0,r.__)("Reusable Classes","ablocks"),className:"ablocks-settings ablocks-settings--classes",route:"&path=classes"},{name:"dashboard",icon:"ablocks-icon ablocks-icon--frontend-dashboard",title:(0,r.__)("Frontend Dashboard","ablocks"),className:"ablocks-settings ablocks-settings--frontend-dashboard",route:"&path=dashboard"},...m],h=_?.find(e=>e?.name===d),p=h?.className||"",f=e=>{ | |
| 816 | +switch(e){case"editor":default:return(0,S.jsx)(sl,{});case"asset":return(0,S.jsx)(rl,{});case"integrations":return(0,S.jsx)(uu,{});case"page":return(0,S.jsx)(mu,{});case"performance":return(0,S.jsx)(ml,{});case"link-passthrough":return(0,S.jsx)(pl,{});case"visibility":return(0,S.jsx)(fl,{});case"classes":return(0,S.jsx)(bl,{});case"dashboard":return(0,S.jsx)(lu,{});case"license":return(0,S.jsx)(yu,{})}};return(0,S.jsx)(n().Fragment,{children:(0,S.jsx)(pa,{enableReinitialize:!0,initialValues:{default_container_width:1280,container_padding:10,container_element_gap:20,enabled_assets_file_generation:!0,enabled_block_copy_paste_style:!0,lock_global_typography:!1,lock_global_typography_strict:!1,lock_global_colors:!1,enabled_load_google_font_locally:!1,enabled_only_selected_fonts:!1,selected_fonts:[],paste_google_docs:!0,paste_convert_webp:!0,paste_webp_quality:92,font_metric_fallback:!0,perf_lazy_images:!0,perf_lcp_eager_count:1,perf_inline_css:!0,perf_delay_js:!1,perf_delay_js_timeout:5e3, | |
| 816 | 817 | perf_disable_emojis:!1,perf_disable_embeds:!1,perf_disable_dashicons:!1,perf_disable_jquery_migrate:!1,perf_control_heartbeat:!1,perf_heartbeat_frequency:60,perf_page_cache:!1,perf_page_cache_scope:"all",perf_page_cache_ttl:0,perf_page_cache_gzip:!0,perf_page_cache_prewarm:!0,perf_page_cache_mobile_variant:!1,perf_page_cache_query_args:[],perf_page_cache_exclusions:[],perf_consolidate_css:!1,perf_consolidate_css_min:2048,perf_fragment_cache:!1,perf_fragment_cache_ttl:43200,perf_template_cache:!1,perf_template_cache_ttl:43200,param_passthrough_enabled:!1,param_passthrough_keys:"ref,utm_source,utm_medium,utm_campaign,utm_term,utm_content",param_passthrough_match:"class",param_passthrough_class:"aff-link",param_passthrough_keyword:"",param_passthrough_persist:!0,param_passthrough_cookie_days:30,enabled_coming_soon_page:!1,coming_soon_page:"",enabled_maintenance_page:!1,maintenance_page:"",login_page:"",registration_page:"",forget_password_page:"",...e?.data},onSubmit:(e,a)=>{t(vn({ |
| 817 | 818 | values:e})).then(()=>a.setSubmitting(!1)),a.setSubmitting(!1)},children:({handleSubmit:t,dirty:a,isSubmitting:n})=>(0,S.jsx)("div",{className:"ablocks-settings",children:(0,S.jsxs)(va,{children:[(0,S.jsx)(Mt,{render:()=>(0,S.jsx)("div",{className:"ablocks-settings-topbar",children:(0,S.jsx)(Ia,{type:"submit",onClick:t,preset:a?"purple":"gray",label:(0,r.__)("Save","ablocks"),isDisabled:!a,isLoading:n})})}),(0,S.jsxs)("div",{className:"ablocks-page-content",children:[(0,S.jsx)("h3",{className:"ablocks-heading",children:(0,r.__)("Settings","ablocks")}),(0,S.jsxs)("div",{className:`ablocks-settings ablocks-page-content ablocks-page-content--settings ${p}`,children:[(0,S.jsx)("div",{className:"ablocks-tab-panel",children:_.map((e,t)=>{const a=e?.subTabs&&d===e?.name,n=u||e?.subTabs?.[0]?.name;return(0,S.jsxs)("div",{className:"ablocks-tab-panel-control ablocks-tab-panel__item "+(e?.name===d?"ablocks-tab-panel__item--is-open":""),children:[(0,S.jsxs)(s.N_,{ |
| 818 | -to:`${i.Y3}admin.php?page=ablocks-settings${e?.route}`,className:"ablocks-tab-item "+(d===e?.name?"ablocks-tab-item--is-active":""),children:[e?.icon?(0,S.jsx)("span",{className:`ablocks-icon ablocks-icon--${e?.icon}`}):e?.svg,e?.title]}),e?.subTabs&&(0,S.jsx)("span",{className:"ablocks-icon "+(a?"ablocks-icon--arrow-down":"ablocks-icon--arrow-down ablocks-arrow-right")}),a&&(0,S.jsx)("div",{className:"ablocks-tab-panel__sub-items",children:e?.subTabs.map((t,a)=>(0,S.jsx)(s.N_,{to:`${i.Y3}admin.php?page=ablocks-settings${e.route}&sub=${t.name}`,className:"ablocks-sub-tab-item "+(n===t.name?"ablocks-sub-tab-item--is-active":""),children:t.title},a))})]},t)})}),(0,S.jsx)("div",{className:"ablocks-settings-content",children:e?.data&&f(d)})]})]})]})})})})}const ku=()=>{const e=(0,a.useRef)(null),t=document.querySelector("#ablockswrap"),n=j(e=>e.notification),s=w();(0,a.useEffect)(()=>(n.showNotification&&t?(e.current.style.position="fixed",e.current.style.left="50%", | |
| 819 | +to:`${i.Y3}admin.php?page=ablocks-settings${e?.route}`,className:"ablocks-tab-item "+(d===e?.name?"ablocks-tab-item--is-active":""),children:[e?.icon?(0,S.jsx)("span",{className:`ablocks-icon ablocks-icon--${e?.icon}`}):e?.svg,e?.title]}),e?.subTabs&&(0,S.jsx)("span",{className:"ablocks-icon "+(a?"ablocks-icon--arrow-down":"ablocks-icon--arrow-down ablocks-arrow-right")}),a&&(0,S.jsx)("div",{className:"ablocks-tab-panel__sub-items",children:e?.subTabs.map((t,a)=>(0,S.jsx)(s.N_,{to:`${i.Y3}admin.php?page=ablocks-settings${e.route}&sub=${t.name}`,className:"ablocks-sub-tab-item "+(n===t.name?"ablocks-sub-tab-item--is-active":""),children:t.title},a))})]},t)})}),(0,S.jsx)("div",{className:"ablocks-settings-content",children:e?.data&&f(d)})]})]})]})})})})}const vu=()=>{const e=(0,a.useRef)(null),t=document.querySelector("#ablockswrap"),n=j(e=>e.notification),s=w();(0,a.useEffect)(()=>(n.showNotification&&t?(e.current.style.position="fixed",e.current.style.left="50%", | |
| 819 | 820 | e.current.style.transform="translateX(-50%)",e.current.style.bottom="50px",document.body.appendChild(e.current)):e.current&&e.current.parentNode===document.body&&document.body.removeChild(e.current),()=>{e.current&&e.current.parentNode===document.body&&document.body.removeChild(e?.current)}),[n.showNotification]),(0,a.useEffect)(()=>{n.showNotification&&setTimeout(()=>{r()},5e3)},[n.showNotification]);const r=()=>{s(wt({message:"",isShow:!1,type:""}))};return(0,S.jsx)(S.Fragment,{children:n?.showNotification&&(0,jr.createPortal)((0,S.jsxs)("div",{className:`ablocks-notification ${n.type&&`ablocks-notification--${n.type}`}`,ref:e,children:[(0,S.jsxs)("p",{className:"ablocks-notification__message",children:[(0,S.jsx)("span",{className:"ablocks-notification__message--icon",children:(e=>{switch(e){case"error":return(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--information ablocks-icon--information-error"});case"info":return(0,S.jsx)("span",{ |
| 820 | -className:"ablocks-icon ablocks-icon--information"});case"warning":return(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--notification"});default:return(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--active"})}})(n.type)}),(0,S.jsx)("span",{className:"ablocks-notification__message--text",children:n.message})]}),(0,S.jsx)(Ja,{icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--close"}),preset:"transparent",suffix:"close-notification",onClick:r})]}),document.body)})},vu={children:Aa().object,value:Aa().string,options:Aa().object,onChangeHandler:Aa().func},xu=e=>{const{value:t="unread",options:n={},onChangeHandler:s=()=>{}}=e,[o,i]=(0,a.useState)(!1),l={publish:(0,r.__)("Published","ablocks"),pending:(0,r.__)("Pending","ablocks"),draft:(0,r.__)("Draft","ablocks"),trash:(0,r.__)("Trash","ablocks"),completed:(0,r.__)("Approved","ablocks"),approved:(0,r.__)("Approve","ablocks"),processing:(0,r.__)("Processing","ablocks"),cancel:(0,r.__)("Cancel","ablocks"),private:(0, | |
| 821 | +className:"ablocks-icon ablocks-icon--information"});case"warning":return(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--notification"});default:return(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--active"})}})(n.type)}),(0,S.jsx)("span",{className:"ablocks-notification__message--text",children:n.message})]}),(0,S.jsx)(Ja,{icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--close"}),preset:"transparent",suffix:"close-notification",onClick:r})]}),document.body)})},xu={children:Aa().object,value:Aa().string,options:Aa().object,onChangeHandler:Aa().func},wu=e=>{const{value:t="unread",options:n={},onChangeHandler:s=()=>{}}=e,[o,i]=(0,a.useState)(!1),l={publish:(0,r.__)("Published","ablocks"),pending:(0,r.__)("Pending","ablocks"),draft:(0,r.__)("Draft","ablocks"),trash:(0,r.__)("Trash","ablocks"),completed:(0,r.__)("Approved","ablocks"),approved:(0,r.__)("Approve","ablocks"),processing:(0,r.__)("Processing","ablocks"),cancel:(0,r.__)("Cancel","ablocks"),private:(0, | |
| 821 | 822 | r.__)("Private","ablocks"),future:(0,r.__)("Scheduled","ablocks"),read:(0,r.__)("Read","ablocks"),unread:(0,r.__)("Unread","ablocks")},c=(0,a.useRef)(null),d=(0,a.useRef)(null),u=e=>{c?.current&&!c?.current?.contains(e.target)&&i(!1)};return(0,a.useEffect)(()=>(document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)),[]),(0,a.useEffect)(()=>{if(o&&d.current){const e=d.current.getBoundingClientRect(),t=e.left+window.pageXOffset,a=e.top+window.pageYOffset,n=d.current.offsetHeight;c.current.style.position="absolute",c.current.style.left=t-50+"px",c.current.style.top=`${a+n+5}px`,document.body.appendChild(c.current)}else d.current&&d.current.parentNode===document.body&&document.body.removeChild(c.current)},[o,d]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("button",{className:`ablocks-dropdown-option ablocks-dropdown-option--${t}`,type:"button",ref:d,onClick:()=>{i(!o)},children:[(0,S.jsx)("span",{className:"label",children:l[t]}),(0,S.jsx)("span",{ |
| 822 | -className:"ablocks-icon ablocks-icon--arrow-down"})]}),(0,jr.createPortal)((0,S.jsx)("div",{className:"ablocks-dropdown-option__lists",ref:c,children:o&&(0,S.jsx)("ul",{className:"ablocks-more-status-options",children:n.items.map((e,a)=>(0,S.jsx)("li",{className:`ablocks-more-status-options__item ablocks-more-status-options__item--${e.value} ${e.value===t&&"active"} ${e?.isDisabled&&"ablocks-more-status-options__item-disabled"}`,role:"presentation",onClick:()=>{s(e.value),i(!1)},children:e.label},a))})}),document.body)]})};xu.propTypes=vu;const wu=xu,Mu={actionButtons:Aa().array,itemsLength:Aa().number,isActionSelected:Aa().object,confirmHandler:Aa().function,resetHandler:Aa().function},Lu=({actionButtons:e=[],itemsLength:t=0,confirmHandler:n=()=>{},isActionSelected:s={},resetHandler:o=()=>{}})=>{const i=(0,a.useRef)(null),l=document.querySelector("#wpbody");return(0,a.useEffect)(()=>(t&&l?(i.current.style.position="fixed",i.current.style.left="40%",i.current.style.bottom="50px", | |
| 823 | +className:"ablocks-icon ablocks-icon--arrow-down"})]}),(0,jr.createPortal)((0,S.jsx)("div",{className:"ablocks-dropdown-option__lists",ref:c,children:o&&(0,S.jsx)("ul",{className:"ablocks-more-status-options",children:n.items.map((e,a)=>(0,S.jsx)("li",{className:`ablocks-more-status-options__item ablocks-more-status-options__item--${e.value} ${e.value===t&&"active"} ${e?.isDisabled&&"ablocks-more-status-options__item-disabled"}`,role:"presentation",onClick:()=>{s(e.value),i(!1)},children:e.label},a))})}),document.body)]})};wu.propTypes=xu;const Mu=wu,Lu={actionButtons:Aa().array,itemsLength:Aa().number,isActionSelected:Aa().object,confirmHandler:Aa().function,resetHandler:Aa().function},ju=({actionButtons:e=[],itemsLength:t=0,confirmHandler:n=()=>{},isActionSelected:s={},resetHandler:o=()=>{}})=>{const i=(0,a.useRef)(null),l=document.querySelector("#wpbody");return(0,a.useEffect)(()=>(t&&l?(i.current.style.position="fixed",i.current.style.left="40%",i.current.style.bottom="50px", | |
| 823 | 824 | document.body.appendChild(i.current)):i.current&&i.current.parentNode===document.body&&document.body.removeChild(i.current),()=>{i.current&&i.current.parentNode===document.body&&document.body.removeChild(i.current)}),[]),(0,S.jsx)(S.Fragment,{children:t&&(0,jr.createPortal)((0,S.jsxs)("div",{className:"ablocks-snackbar-action",ref:i,children:[(0,S.jsx)(sn,{icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--close"}),preset:"transparent",suffix:"close",onClick:o}),s?.value?(0,S.jsxs)("div",{className:"ablocks-snackbar-action__after",children:[(0,S.jsx)("div",{className:"ablocks-snackbar-action__left",children:s?.message}),(0,S.jsxs)("div",{className:"ablocks-snackbar-action__left",children:[(0,S.jsx)(sn,{label:(0,r.__)("Cancel","ablocks"),onClick:o}),(0,S.jsx)(sn,{label:(0,r.__)("Confirm","ablocks"),onClick:()=>n(!0)})]})]}):(0,S.jsxs)("div",{className:"ablocks-snackbar-action__before",children:[(0,S.jsx)("div",{className:"ablocks-snackbar-action__left",children:(0, |
| 824 | -S.jsxs)("div",{className:"ablocks-snackbar-action__items-length",children:[(0,S.jsx)("span",{className:"",children:t}),(0,S.jsx)("p",{children:(0,r.__)("Items selected","ablocks")})]})}),(0,S.jsx)("div",{className:"ablocks-snackbar-action__right",children:e.map((e,t)=>(0,a.createElement)(sn,{...e,key:t}))})]})]}),document.body)})};Lu.propTypes=Mu;const ju=Lu;function Su(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})),n.forEach(function(t){En(e,t,a[t])})}return e}var Yu=o(20311),Du=o.n(Yu),Tu=function(){function e(){zn(this,e),En(this,"refs",{})}return Bn(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var a=this.getIndex(e,t);-1!==a&&this.refs[e].splice(a,1)}},{key:"isActive", | |
| 825 | -value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find(function(t){return t.node.sortableInfo.index==e.active.index})}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(Cu)}}]),e}();function Cu(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function Nu(e,t){return Object.keys(e).reduce(function(a,n){return-1===t.indexOf(n)&&(a[n]=e[n]),a},{})}var Eu={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},Ou=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1] | |
| 826 | -;return"ms"===t?"ms":t&&t.length?t[0].toUpperCase()+t.substr(1):""}();function Au(e,t){Object.keys(t).forEach(function(a){e.style[a]=t[a]})}function Pu(e,t){e.style["".concat(Ou,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function Hu(e,t){e.style["".concat(Ou,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function Ru(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function Iu(e,t,a){return Math.max(e,Math.min(a,t))}function Fu(e){return"px"===e.substr(-2)?parseFloat(e):0}function Wu(e,t){var a=t.displayName||t.name;return a?"".concat(e,"(").concat(a,")"):e}function zu(e,t){var a=e.getBoundingClientRect();return{top:a.top+t.top,left:a.left+t.left}}function Uu(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function Bu(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{ | |
| 827 | -left:0,top:0};if(e){var n={left:a.left+e.offsetLeft,top:a.top+e.offsetTop};return e.parentNode===t?n:Bu(e.parentNode,t,n)}}function Vu(e){var t=e.lockOffset,a=e.width,n=e.height,s=t,r=t,o="px";if("string"==typeof t){var i=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);Du()(null!==i,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),s=parseFloat(t),r=parseFloat(t),o=i[1]}return Du()(isFinite(s)&&isFinite(r),"lockOffset value should be a finite. Given %s",t),"%"===o&&(s=s*a/100,r=r*n/100),{x:s,y:r}}function $u(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),a=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find(function(e){return a.test(t[e])})}(e)?e:$u(e.parentNode):null}var qu="BUTTON",Ju="INPUT",Gu="OPTION",Ku="TEXTAREA",Xu="SELECT";function Zu(e){return null!=e.sortableHandle}var Qu=function(){function e(t,a){zn(this,e),this.container=t,this.onScrollCallback=a}return Bn(e,[{key:"clear",value:function(){ | |
| 828 | -null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,a=e.translate,n=e.minTranslate,s=e.maxTranslate,r=e.width,o=e.height,i={x:0,y:0},l={x:1,y:1},c=this.container,d=c.scrollTop,u=c.scrollLeft,m=c.scrollHeight,_=c.scrollWidth,h=0===d,p=m-d-c.clientHeight===0,f=0===u,b=_-u-c.clientWidth===0;a.y>=s.y-o/2&&!p?(i.y=1,l.y=10*Math.abs((s.y-o/2-a.y)/o)):a.x>=s.x-r/2&&!b?(i.x=1,l.x=10*Math.abs((s.x-r/2-a.x)/r)):a.y<=n.y+o/2&&!h?(i.y=-1,l.y=10*Math.abs((a.y-o/2-n.y)/o)):a.x<=n.x+r/2&&!f&&(i.x=-1,l.x=10*Math.abs((a.x-r/2-n.x)/r)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===i.x&&0===i.y||(this.interval=setInterval(function(){t.isAutoScrolling=!0;var e={left:l.x*i.x,top:l.y*i.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)},5))}}]),e}(),em={axis:Aa().oneOf(["x","y","xy"]),contentWindow:Aa().any,disableAutoscroll:Aa().bool,distance:Aa().number,getContainer:Aa().func, | |
| 829 | -getHelperDimensions:Aa().func,helperClass:Aa().string,helperContainer:Aa().oneOfType([Aa().func,"undefined"==typeof HTMLElement?Aa().any:Aa().instanceOf(HTMLElement)]),hideSortableGhost:Aa().bool,keyboardSortingTransitionDuration:Aa().number,lockAxis:Aa().string,lockOffset:Aa().oneOfType([Aa().number,Aa().string,Aa().arrayOf(Aa().oneOfType([Aa().number,Aa().string]))]),lockToContainerEdges:Aa().bool,onSortEnd:Aa().func,onSortMove:Aa().func,onSortOver:Aa().func,onSortStart:Aa().func,pressDelay:Aa().number,pressThreshold:Aa().number,keyCodes:Aa().shape({lift:Aa().arrayOf(Aa().number),drop:Aa().arrayOf(Aa().number),cancel:Aa().arrayOf(Aa().number),up:Aa().arrayOf(Aa().number),down:Aa().arrayOf(Aa().number)}),shouldCancelStart:Aa().func,transitionDuration:Aa().number,updateBeforeSortStart:Aa().func,useDragHandle:Aa().bool,useWindowAsScrollContainer:Aa().bool},tm={lift:[32],drop:[32],cancel:[27],up:[38,37],down:[40,39]},am={axis:"y",disableAutoscroll:!1,distance:0, | |
| 830 | -getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:tm,shouldCancelStart:function(e){return-1!==[Ju,Ku,Xu,Gu,qu].indexOf(e.target.tagName)||!!Ru(e.target,function(e){return"true"===e.contentEditable})},transitionDuration:300,useWindowAsScrollContainer:!1},nm=Object.keys(em),sm=(0,a.createContext)({manager:{}}),rm={index:Aa().number.isRequired,collection:Aa().oneOfType([Aa().number,Aa().string]),disabled:Aa().bool},om=Object.keys(rm),im=o(20312),lm=o.n(im);const cm={title:Aa().string,subtitle:Aa().string,largeModalMarginTop:Aa().string,isOpen:Aa().bool,isEnabledHeader:Aa().bool,isEnabledResizer:Aa().bool,onAfterOpen:Aa().func,onRequestClose:Aa().func,style:Aa().object,externalComponent:Aa().object,suffix:Aa().string,size:Aa().string,isSmallAvailable:Aa().bool,isLargeAvailable:Aa().bool} | |
| 831 | -;function dm({children:e,suffix:t="",title:s="",subtitle:r="",onAfterOpen:o,onRequestClose:i,isOpen:l=!1,isEnabledHeader:c=!0,size:d="medium",largeModalMarginTop:u="30px",style:m={overlay:{background:"rgba(35, 40, 45, 0.62)",overflowY:"scroll",display:"flex",justifyContent:"center",zIndex:9999,msOverflowStyle:"none",scrollbarWidth:"thin"},content:{inset:"unset",padding:0,overflow:"none",border:0,marginTop:"50px"}}}){const[_,h]=(0,a.useState)({expandableSize:d,activeIconIndex:3}),p="large"===_?.expandableSize?{...m,content:{...m.content,marginTop:u}}:m,f=function(e,t){return nn()("ablocks-react-modal",e&&`ablocks-react-modal--${e}`,t&&`ablocks-react-modal--${t}`)}(t,_?.expandableSize),b=(g=_?.expandableSize,nn()("ablocks-react-modal__content",g&&`ablocks-react-modal--content-${g}`));var g;return(0,S.jsx)(n().Fragment,{children:(0,S.jsx)(lm(),{isOpen:l,onAfterOpen:o,onRequestClose:i,contentLabel:s,style:p,shouldCloseOnOverlayClick:!1,ariaHideApp:!0,children:(0,S.jsxs)("div",{className:f, | |
| 825 | +S.jsxs)("div",{className:"ablocks-snackbar-action__items-length",children:[(0,S.jsx)("span",{className:"",children:t}),(0,S.jsx)("p",{children:(0,r.__)("Items selected","ablocks")})]})}),(0,S.jsx)("div",{className:"ablocks-snackbar-action__right",children:e.map((e,t)=>(0,a.createElement)(sn,{...e,key:t}))})]})]}),document.body)})};ju.propTypes=Lu;const Su=ju;function Yu(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})),n.forEach(function(t){En(e,t,a[t])})}return e}var Du=o(20311),Tu=o.n(Du),Cu=function(){function e(){zn(this,e),En(this,"refs",{})}return Bn(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var a=this.getIndex(e,t);-1!==a&&this.refs[e].splice(a,1)}},{key:"isActive", | |
| 826 | +value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find(function(t){return t.node.sortableInfo.index==e.active.index})}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(Nu)}}]),e}();function Nu(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function Eu(e,t){return Object.keys(e).reduce(function(a,n){return-1===t.indexOf(n)&&(a[n]=e[n]),a},{})}var Ou={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},Au=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1] | |
| 827 | +;return"ms"===t?"ms":t&&t.length?t[0].toUpperCase()+t.substr(1):""}();function Pu(e,t){Object.keys(t).forEach(function(a){e.style[a]=t[a]})}function Hu(e,t){e.style["".concat(Au,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function Ru(e,t){e.style["".concat(Au,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function Iu(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function Fu(e,t,a){return Math.max(e,Math.min(a,t))}function Wu(e){return"px"===e.substr(-2)?parseFloat(e):0}function zu(e,t){var a=t.displayName||t.name;return a?"".concat(e,"(").concat(a,")"):e}function Uu(e,t){var a=e.getBoundingClientRect();return{top:a.top+t.top,left:a.left+t.left}}function Bu(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function Vu(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{ | |
| 828 | +left:0,top:0};if(e){var n={left:a.left+e.offsetLeft,top:a.top+e.offsetTop};return e.parentNode===t?n:Vu(e.parentNode,t,n)}}function $u(e){var t=e.lockOffset,a=e.width,n=e.height,s=t,r=t,o="px";if("string"==typeof t){var i=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);Tu()(null!==i,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),s=parseFloat(t),r=parseFloat(t),o=i[1]}return Tu()(isFinite(s)&&isFinite(r),"lockOffset value should be a finite. Given %s",t),"%"===o&&(s=s*a/100,r=r*n/100),{x:s,y:r}}function qu(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),a=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find(function(e){return a.test(t[e])})}(e)?e:qu(e.parentNode):null}var Ju="BUTTON",Gu="INPUT",Ku="OPTION",Xu="TEXTAREA",Zu="SELECT";function Qu(e){return null!=e.sortableHandle}var em=function(){function e(t,a){zn(this,e),this.container=t,this.onScrollCallback=a}return Bn(e,[{key:"clear",value:function(){ | |
| 829 | +null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,a=e.translate,n=e.minTranslate,s=e.maxTranslate,r=e.width,o=e.height,i={x:0,y:0},l={x:1,y:1},c=this.container,d=c.scrollTop,u=c.scrollLeft,m=c.scrollHeight,_=c.scrollWidth,h=0===d,p=m-d-c.clientHeight===0,f=0===u,b=_-u-c.clientWidth===0;a.y>=s.y-o/2&&!p?(i.y=1,l.y=10*Math.abs((s.y-o/2-a.y)/o)):a.x>=s.x-r/2&&!b?(i.x=1,l.x=10*Math.abs((s.x-r/2-a.x)/r)):a.y<=n.y+o/2&&!h?(i.y=-1,l.y=10*Math.abs((a.y-o/2-n.y)/o)):a.x<=n.x+r/2&&!f&&(i.x=-1,l.x=10*Math.abs((a.x-r/2-n.x)/r)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===i.x&&0===i.y||(this.interval=setInterval(function(){t.isAutoScrolling=!0;var e={left:l.x*i.x,top:l.y*i.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)},5))}}]),e}(),tm={axis:Aa().oneOf(["x","y","xy"]),contentWindow:Aa().any,disableAutoscroll:Aa().bool,distance:Aa().number,getContainer:Aa().func, | |
| 830 | +getHelperDimensions:Aa().func,helperClass:Aa().string,helperContainer:Aa().oneOfType([Aa().func,"undefined"==typeof HTMLElement?Aa().any:Aa().instanceOf(HTMLElement)]),hideSortableGhost:Aa().bool,keyboardSortingTransitionDuration:Aa().number,lockAxis:Aa().string,lockOffset:Aa().oneOfType([Aa().number,Aa().string,Aa().arrayOf(Aa().oneOfType([Aa().number,Aa().string]))]),lockToContainerEdges:Aa().bool,onSortEnd:Aa().func,onSortMove:Aa().func,onSortOver:Aa().func,onSortStart:Aa().func,pressDelay:Aa().number,pressThreshold:Aa().number,keyCodes:Aa().shape({lift:Aa().arrayOf(Aa().number),drop:Aa().arrayOf(Aa().number),cancel:Aa().arrayOf(Aa().number),up:Aa().arrayOf(Aa().number),down:Aa().arrayOf(Aa().number)}),shouldCancelStart:Aa().func,transitionDuration:Aa().number,updateBeforeSortStart:Aa().func,useDragHandle:Aa().bool,useWindowAsScrollContainer:Aa().bool},am={lift:[32],drop:[32],cancel:[27],up:[38,37],down:[40,39]},nm={axis:"y",disableAutoscroll:!1,distance:0, | |
| 831 | +getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:am,shouldCancelStart:function(e){return-1!==[Gu,Xu,Zu,Ku,Ju].indexOf(e.target.tagName)||!!Iu(e.target,function(e){return"true"===e.contentEditable})},transitionDuration:300,useWindowAsScrollContainer:!1},sm=Object.keys(tm),rm=(0,a.createContext)({manager:{}}),om={index:Aa().number.isRequired,collection:Aa().oneOfType([Aa().number,Aa().string]),disabled:Aa().bool},im=Object.keys(om),lm=o(20312),cm=o.n(lm);const dm={title:Aa().string,subtitle:Aa().string,largeModalMarginTop:Aa().string,isOpen:Aa().bool,isEnabledHeader:Aa().bool,isEnabledResizer:Aa().bool,onAfterOpen:Aa().func,onRequestClose:Aa().func,style:Aa().object,externalComponent:Aa().object,suffix:Aa().string,size:Aa().string,isSmallAvailable:Aa().bool,isLargeAvailable:Aa().bool} | |
| 832 | +;function um({children:e,suffix:t="",title:s="",subtitle:r="",onAfterOpen:o,onRequestClose:i,isOpen:l=!1,isEnabledHeader:c=!0,size:d="medium",largeModalMarginTop:u="30px",style:m={overlay:{background:"rgba(35, 40, 45, 0.62)",overflowY:"scroll",display:"flex",justifyContent:"center",zIndex:9999,msOverflowStyle:"none",scrollbarWidth:"thin"},content:{inset:"unset",padding:0,overflow:"none",border:0,marginTop:"50px"}}}){const[_,h]=(0,a.useState)({expandableSize:d,activeIconIndex:3}),p="large"===_?.expandableSize?{...m,content:{...m.content,marginTop:u}}:m,f=function(e,t){return nn()("ablocks-react-modal",e&&`ablocks-react-modal--${e}`,t&&`ablocks-react-modal--${t}`)}(t,_?.expandableSize),b=(g=_?.expandableSize,nn()("ablocks-react-modal__content",g&&`ablocks-react-modal--content-${g}`));var g;return(0,S.jsx)(n().Fragment,{children:(0,S.jsx)(cm(),{isOpen:l,onAfterOpen:o,onRequestClose:i,contentLabel:s,style:p,shouldCloseOnOverlayClick:!1,ariaHideApp:!0,children:(0,S.jsxs)("div",{className:f, | |
| 832 | 833 | children:[c&&(0,S.jsxs)("div",{className:"ablocks-react-modal__head",children:[s&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("h3",{className:"ablocks-react-modal__head-title",children:s}),r&&(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--angle-right"}),r]})]}),(0,S.jsx)("div",{className:"ablocks-react-modal-buttons",children:(0,S.jsx)(sn,{type:"button",onClick:()=>i(),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--close"}),className:"ablocks-btn-close-modal"})})]}),(0,S.jsxs)("div",{className:b,children:[!c&&(0,S.jsx)(sn,{type:"button",onClick:()=>i(),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--close"}),className:"ablocks-btn-close-modal"}),e]})]})})})} |
| 833 | -document.getElementById("ablockswrap")?lm().setAppElement("#ablockswrap"):document.getElementById("ablocksLessonsWrap")?lm().setAppElement("#ablocksLessonsWrap"):document.getElementById("ablocksFrontendDashWrap")?lm().setAppElement("#ablocksFrontendDashWrap"):document.getElementById("ablocksFrontendModalWrap")&&lm().setAppElement("#ablocksFrontendModalWrap"),dm.propTypes=cm;const um=function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;zn(this,n);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return En(Gn(Gn(t=Kn(this,(e=qn(n)).call.apply(e,[this].concat(r))))),"wrappedInstance",(0,a.createRef)()),t}return $n(n,t),Bn(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index), | |
| 834 | -e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,a=e.disabled,n=e.index,s=(0,jr.findDOMNode)(this);s.sortableInfo={collection:t,disabled:a,index:n,manager:this.context.manager},this.node=s,this.ref={node:s},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return Du()(s.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=s.withRef?this.wrappedInstance:null;return(0,a.createElement)(e,Wn({ref:t | |
| 835 | -},Nu(this.props,om)))}}]),n}(a.Component),En(t,"displayName",Wu("sortableElement",e)),En(t,"contextType",sm),En(t,"propTypes",rm),En(t,"defaultProps",{collection:0}),n}(({copyColumn:e,itemIndex:t,checkedChange:a})=>(0,S.jsxs)("div",{className:"kzui-table__filter-checked-item",children:[(0,S.jsxs)("span",{className:"kzui-table-filter-item-left",children:[(0,S.jsx)("span",{className:"academy-icon academy-icon--drag"}),(0,S.jsx)("span",{className:"kzui-table-filter-item-title",children:e.name})]}),(0,S.jsx)("input",{id:e.name,type:"checkbox",checked:e.visible,onChange:t=>a({id:e.id,visible:t.target.checked})})]},`column-${t}`)),mm=function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;zn(this,n),En(Gn(Gn(t=Kn(this,qn(n).call(this,e)))),"state",{}),En(Gn(Gn(t)),"handleStart",function(e){var a=t.props,n=a.distance,s=a.shouldCancelStart;if(2!==e.button&&!s(e)){t.touched=!0,t.position=Uu(e) | |
| 836 | -;var r=Ru(e.target,function(e){return null!=e.sortableInfo});if(r&&r.sortableInfo&&t.nodeIsChild(r)&&!t.state.sorting){var o=t.props.useDragHandle,i=r.sortableInfo,l=i.index,c=i.collection;if(i.disabled)return;if(o&&!Ru(e.target,Zu))return;t.manager.active={collection:c,index:l},function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}(e)||"A"!==e.target.tagName||e.preventDefault(),n||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout(function(){return t.handlePress(e)},t.props.pressDelay))}}}),En(Gn(Gn(t)),"nodeIsChild",function(e){return e.sortableInfo.manager===t.manager}),En(Gn(Gn(t)),"handleMove",function(e){var a=t.props,n=a.distance,s=a.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var r=Uu(e),o={x:t.position.x-r.x,y:t.position.y-r.y},i=Math.abs(o.x)+Math.abs(o.y);t.delta=o,n||s&&!(i>=s)?n&&i>=n&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer), | |
| 837 | -t.cancelTimer=setTimeout(t.cancel,0))}}),En(Gn(Gn(t)),"handleEnd",function(){t.touched=!1,t.cancel()}),En(Gn(Gn(t)),"cancel",function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)}),En(Gn(Gn(t)),"handlePress",function(e){try{var a=t.manager.getActive(),n=function(){if(a){var n=function(){var a,n,s=m.sortableInfo.index,c=(a=m,{bottom:Fu((n=window.getComputedStyle(a)).marginBottom),left:Fu(n.marginLeft),right:Fu(n.marginRight),top:Fu(n.marginTop)}),p=function(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:Fu(t.gridColumnGap),y:Fu(t.gridRowGap)}:{x:0,y:0}}(t.container),f=t.scrollContainer.getBoundingClientRect(),b=o({index:s,node:m,collection:_});if(t.node=m,t.margin=c,t.gridGap=p,t.width=b.width,t.height=b.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=m.getBoundingClientRect(),t.containerBoundingRect=f,t.index=s,t.newIndex=s, | |
| 838 | -t.axis={x:r.indexOf("x")>=0,y:r.indexOf("y")>=0},t.offsetEdge=Bu(m,t.container),t.initialOffset=Uu(h?Su({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild(function(e){var t="input, textarea, select, canvas, [contenteditable]",a=e.querySelectorAll(t),n=e.cloneNode(!0);return Xn(n.querySelectorAll(t)).forEach(function(e,t){"file"!==e.type&&(e.value=a[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),"CANVAS"===e.tagName&&a[t].width>0&&a[t].height>0&&e.getContext("2d").drawImage(a[t],0,0)}),n}(m)),Au(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-c.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-c.top,"px"),width:"".concat(t.width,"px")}), | |
| 839 | -h&&t.helper.focus(),l&&(t.sortableGhost=m,Au(m,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},h){var g=u?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,y=g.top,k=g.left,v=g.width,x=y+g.height,w=k+v;t.axis.x&&(t.minTranslate.x=k-t.boundingClientRect.left,t.maxTranslate.x=w-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=y-t.boundingClientRect.top,t.maxTranslate.y=x-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(u?0:f.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(u?t.contentWindow.innerWidth:f.left+f.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(u?0:f.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(u?t.contentWindow.innerHeight:f.top+f.height)-t.boundingClientRect.top-t.height/2);i&&i.split(" ").forEach(function(e){return t.helper.classList.add(e)}),t.listenerNode=e.touches?e.target:t.contentWindow, | |
| 840 | -h?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(Eu.move.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)}),Eu.end.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)})),t.setState({sorting:!0,sortingIndex:s}),d&&d({node:m,index:s,collection:_,isKeySorting:h,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),h&&t.keyMove(0)},s=t.props,r=s.axis,o=s.getHelperDimensions,i=s.helperClass,l=s.hideSortableGhost,c=s.updateBeforeSortStart,d=s.onSortStart,u=s.useWindowAsScrollContainer,m=a.node,_=a.collection,h=t.manager.isKeySorting,p=function(){if("function"==typeof c){t._awaitingUpdateBeforeSortStart=!0;var a=function(t,a){try{var n=function(){var t=m.sortableInfo.index;return Promise.resolve(c({collection:_,index:t,node:m,isKeySorting:h},e)).then(function(){})}()}catch(e){return a(!0,e)} | |
| 841 | -return n&&n.then?n.then(a.bind(null,!1),a.bind(null,!0)):a(!1,value)}(0,function(e,a){if(t._awaitingUpdateBeforeSortStart=!1,e)throw a;return a});if(a&&a.then)return a.then(function(){})}}();return p&&p.then?p.then(n):n()}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}),En(Gn(Gn(t)),"handleSortMove",function(e){var a=t.props.onSortMove;"function"==typeof e.preventDefault&&e.cancelable&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),a&&a(e)}),En(Gn(Gn(t)),"handleSortEnd",function(e){var a=t.props,n=a.hideSortableGhost,s=a.onSortEnd,r=t.manager,o=r.active.collection,i=r.isKeySorting,l=t.manager.getOrderedRefs();t.listenerNode&&(i?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(Eu.move.forEach(function(e){ | |
| 842 | -return t.listenerNode.removeEventListener(e,t.handleSortMove)}),Eu.end.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)}))),t.helper.parentNode.removeChild(t.helper),n&&t.sortableGhost&&Au(t.sortableGhost,{opacity:"",visibility:""});for(var c=0,d=l.length;c<d;c++){var u=l[c],m=u.node;u.edgeOffset=null,u.boundingClientRect=null,Pu(m,null),Hu(m,null),u.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof s&&s({collection:o,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:i,nodes:l},e),t.touched=!1}),En(Gn(Gn(t)),"autoscroll",function(){var e=t.props.disableAutoscroll,a=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(a){var n=Su({},t.translate),s=0,r=0;return t.axis.x&&(n.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),s=t.translate.x-n.x),t.axis.y&&(n.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)), | |
| 843 | -r=t.translate.y-n.y),t.translate=n,Pu(t.helper,t.translate),t.scrollContainer.scrollLeft+=s,void(t.scrollContainer.scrollTop+=r)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}}),En(Gn(Gn(t)),"onAutoScroll",function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()}),En(Gn(Gn(t)),"handleKeyDown",function(e){var a=e.keyCode,n=t.props,s=n.shouldCancelStart,r=n.keyCodes,o=Su({},tm,void 0===r?{}:r);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||o.lift.includes(a)&&!s(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),o.lift.includes(a)&&!t.manager.active?t.keyLift(e):o.drop.includes(a)&&t.manager.active?t.keyDrop(e):o.cancel.includes(a)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):o.up.includes(a)?t.keyMove(-1):o.down.includes(a)&&t.keyMove(1))}),En(Gn(Gn(t)),"keyLift",function(e){var a=e.target,n=Ru(a,function(e){return null!=e.sortableInfo | |
| 844 | -}).sortableInfo,s=n.index,r=n.collection;t.initialFocusedNode=a,t.manager.isKeySorting=!0,t.manager.active={index:s,collection:r},t.handlePress(e)}),En(Gn(Gn(t)),"keyMove",function(e){var a=t.manager.getOrderedRefs(),n=a[a.length-1].node.sortableInfo.index,s=t.newIndex+e,r=t.newIndex;if(!(s<0||s>n)){t.prevIndex=r,t.newIndex=s;var o=function(e,t,a){return e<a&&e>t?e-1:e>a&&e<t?e+1:e}(t.newIndex,t.prevIndex,t.index),i=a.find(function(e){return e.node.sortableInfo.index===o}),l=i.node,c=t.containerScrollDelta,d=i.boundingClientRect||zu(l,c),u=i.translate||{x:0,y:0},m=d.top+u.y-c.top,_=d.left+u.x-c.left,h=r<s,p=h&&t.axis.x?l.offsetWidth-t.width:0,f=h&&t.axis.y?l.offsetHeight-t.height:0;t.handleSortMove({pageX:_+p,pageY:m+f,ignoreTransition:0===e})}}),En(Gn(Gn(t)),"keyDrop",function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()}),En(Gn(Gn(t)),"handleKeyEnd",function(e){t.manager.active&&t.keyDrop(e)}),En(Gn(Gn(t)),"isValidSortingTarget",function(e){ | |
| 845 | -var a=t.props.useDragHandle,n=e.target,s=Ru(n,function(e){return null!=e.sortableInfo});return s&&s.sortableInfo&&!s.sortableInfo.disabled&&(a?Zu(n):n.sortableInfo)});var s=new Tu;return function(e){Du()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}(e),t.manager=s,t.wrappedInstance=(0,a.createRef)(),t.sortableContextValue={manager:s},t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return $n(n,t),Bn(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,a=this.getContainer();Promise.resolve(a).then(function(a){e.container=a,e.document=e.container.ownerDocument||document;var n=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof n?n():n,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:$u(e.container)||e.container, | |
| 846 | -e.autoScroller=new Qu(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach(function(t){return Eu[t].forEach(function(a){return e.container.addEventListener(a,e.events[t],!1)})}),e.container.addEventListener("keydown",e.handleKeyDown)})}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach(function(t){return Eu[t].forEach(function(a){return e.container.removeEventListener(a,e.events[t])})}),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,a=t.lockAxis,n=t.lockOffset,s=t.lockToContainerEdges,r=t.transitionDuration,o=t.keyboardSortingTransitionDuration,i=void 0===o?r:o,l=this.manager.isKeySorting,c=e.ignoreTransition,d=Uu(e),u={x:d.x-this.initialOffset.x,y:d.y-this.initialOffset.y};if(u.y-=window.pageYOffset-this.initialWindowScroll.top, | |
| 847 | -u.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=u,s){var m=function(e){var t=e.height,a=e.width,n=e.lockOffset,s=Array.isArray(n)?n:[n,n];Du()(2===s.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",n);var r=Rn(s,2),o=r[0],i=r[1];return[Vu({height:t,lockOffset:o,width:a}),Vu({height:t,lockOffset:i,width:a})]}({height:this.height,lockOffset:n,width:this.width}),_=Rn(m,2),h=_[0],p=_[1],f={x:this.width/2-h.x,y:this.height/2-h.y},b={x:this.width/2-p.x,y:this.height/2-p.y};u.x=Iu(this.minTranslate.x+f.x,this.maxTranslate.x-b.x,u.x),u.y=Iu(this.minTranslate.y+f.y,this.maxTranslate.y-b.y,u.y)}"x"===a?u.y=0:"y"===a&&(u.x=0),l&&i&&!c&&Hu(this.helper,i),Pu(this.helper,u)}},{key:"animateNodes",value:function(){ | |
| 848 | -var e=this.props,t=e.transitionDuration,a=e.hideSortableGhost,n=e.onSortOver,s=this.containerScrollDelta,r=this.windowScrollDelta,o=this.manager.getOrderedRefs(),i=this.offsetEdge.left+this.translate.x+s.left,l=this.offsetEdge.top+this.translate.y+s.top,c=this.manager.isKeySorting,d=this.newIndex;this.newIndex=null;for(var u=0,m=o.length;u<m;u++){var _=o[u].node,h=_.sortableInfo.index,p=_.offsetWidth,f=_.offsetHeight,b={height:this.height>f?f/2:this.height/2,width:this.width>p?p/2:this.width/2},g=c&&h>this.index&&h<=d,y=c&&h<this.index&&h>=d,k={x:0,y:0},v=o[u].edgeOffset;v||(v=Bu(_,this.container),o[u].edgeOffset=v,c&&(o[u].boundingClientRect=zu(_,s)));var x=u<o.length-1&&o[u+1],w=u>0&&o[u-1];x&&!x.edgeOffset&&(x.edgeOffset=Bu(x.node,this.container),c&&(x.boundingClientRect=zu(x.node,s))),h!==this.index?(t&&Hu(_,t),this.axis.x?this.axis.y?y||h<this.index&&(i+r.left-b.width<=v.left&&l+r.top<=v.top+b.height||l+r.top+b.height<=v.top)?(k.x=this.width+this.marginOffset.x, | |
| 849 | -v.left+k.x>this.containerBoundingRect.width-b.width&&x&&(k.x=x.edgeOffset.left-v.left,k.y=x.edgeOffset.top-v.top),null===this.newIndex&&(this.newIndex=h)):(g||h>this.index&&(i+r.left+b.width>=v.left&&l+r.top+b.height>=v.top||l+r.top+b.height>=v.top+f))&&(k.x=-(this.width+this.marginOffset.x),v.left+k.x<this.containerBoundingRect.left+b.width&&w&&(k.x=w.edgeOffset.left-v.left,k.y=w.edgeOffset.top-v.top),this.newIndex=h):g||h>this.index&&i+r.left+b.width>=v.left?(k.x=-(this.width+this.marginOffset.x),this.newIndex=h):(y||h<this.index&&i+r.left<=v.left+b.width)&&(k.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=h)):this.axis.y&&(g||h>this.index&&l+r.top+b.height>=v.top?(k.y=-(this.height+this.marginOffset.y),this.newIndex=h):(y||h<this.index&&l+r.top<=v.top+b.height)&&(k.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=h))),Pu(_,k),o[u].translate=k):a&&(this.sortableGhost=_,Au(_,{opacity:0,visibility:"hidden"}))} | |
| 850 | -null==this.newIndex&&(this.newIndex=this.index),c&&(this.newIndex=d);var M=c?this.prevIndex:d;n&&this.newIndex!==M&&n({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:M,isKeySorting:c,nodes:o,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return Du()(s.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.wrappedInstance.current}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,jr.findDOMNode)(this):e(s.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=s.withRef?this.wrappedInstance:null;return(0,a.createElement)(sm.Provider,{value:this.sortableContextValue},(0,a.createElement)(e,Wn({ref:t},Nu(this.props,nm))))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{ | |
| 851 | -key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),n}(a.Component),En(t,"displayName",Wu("sortableList",e)),En(t,"defaultProps",am),En(t,"propTypes",em),n}(e=>(0,S.jsx)("ul",{className:"kzui-table__filter-items",children:e.children})),_m=({setTempCopyColumns:e,tempCopyColumns:t,showColumnFilter:s,checkedChange:o,setCopyColumns:i,copyColumns:l,suffix:c})=>{const[d,u]=(0,a.useState)(!1),[m,_]=(0,a.useState)([]);return(0,a.useEffect)(()=>{_([...t])},[]),(0,S.jsxs)(n().Fragment,{children:[(0,S.jsx)("div",{className:"kzui-table__sub-header-filter-icon",children:(0,S.jsx)(Ja,{label:(0,r.__)("Columns","ablocks"),icon:(0,S.jsx)("span",{ | |
| 852 | -className:"academy-icon academy-icon--columns"}),onClick:()=>{u(!d)},preset:"transparent",border:"gray",size:"sm",borderRadius:"rounded"})}),(0,S.jsx)(dm,{isOpen:d,onRequestClose:()=>{u(!1)},title:(0,r.__)("Columns","ablocks"),suffix:"column-suffix",size:"small",children:(0,S.jsxs)("div",{className:"kzui-table__filter-modal",children:[(0,S.jsxs)("div",{className:"kzui-table__filter-modal__top-bar",children:[(0,S.jsx)("span",{children:(0,r.__)("Columns","ablocks")}),(0,S.jsx)(Ja,{label:(0,r.__)("Reset","ablocks"),onClick:()=>{e([...m])},preset:"transparent",size:"sm",type:"button",suffix:"reset-all"})]}),s&&(0,S.jsx)(mm,{onSortEnd:({oldIndex:a,newIndex:n})=>{const s=(r=t,o=a,i=n,function(e,t,a){const n=t<0?e.length+t:t;if(n>=0&&n<e.length){const n=a<0?e.length+a:a,[s]=e.splice(t,1);e.splice(n,0,s)}}(r=[...r],o,i),r);var r,o,i;e(s)},children:t?.map((e,t)=>(0,S.jsx)(um,{index:t,copyColumn:e,itemIndex:t,checkedChange:o},`column-${t}`))}),(0,S.jsxs)("div",{ | |
| 853 | -className:"kzui-table__filter-modal__footer",children:[(0,S.jsx)(Ja,{label:(0,r.__)("Cancel","ablocks"),onClick:()=>{e([...l]),u(!1)},preset:"transparent",size:"sm",type:"button",suffix:"cancel",border:"gray",borderRadius:"rounded"}),(0,S.jsx)(Ja,{label:(0,r.__)("Apply","ablocks"),onClick:()=>{i(t),localStorage.setItem(c,JSON.stringify(t)),u(!1)},size:"sm",borderRadius:"rounded"})]})]})})]})},hm=({subHeaderComponent:e,setTempCopyColumns:t,tempCopyColumns:a,showColumnFilter:n,checkedChange:s,setCopyColumns:r,copyColumns:o,suffix:i})=>(0,S.jsxs)("div",{className:"kzui-table__sub-header",children:[(0,S.jsx)("div",{className:"kzui-table__sub-header-left",children:e&&e}),(0,S.jsx)("div",{className:"kzui-table__sub-header-right",children:n&&(0,S.jsx)(_m,{setTempCopyColumns:t,tempCopyColumns:a,showColumnFilter:n,checkedChange:s,setCopyColumns:r,copyColumns:o,suffix:i})})]}),pm=({visibleColumn:e,isCheckboxColumnVisible:t,copyDataArr:a,selectAllRow:n,data:s})=>{const r=s.length>0&&a;return(0, | |
| 854 | -S.jsx)("div",{className:"kzui-table__head",children:(0,S.jsxs)("div",{className:"kzui-table__head-row",children:[t&&(0,S.jsx)("div",{className:"kzui-table__row-cell kzui-table__row-cell-checkbox",children:(0,S.jsx)("input",{checked:r&&a?.every(e=>e.select),type:"checkbox",onChange:n})}),e?.map((e,t)=>(0,S.jsx)("div",{className:"kzui-table__row-cell kzui-table__header-row-cell "+(e.isLabelWidth?"kzui-table__row-cell--isLabelWidth":""),children:e.name},t))]})})},fm=({title:e,subText:t})=>{const[n,s]=(0,a.useState)(!1);return(0,S.jsxs)("div",{className:"academy-oops academy-oops__message",children:[(0,S.jsx)("div",{className:"academy-oops__icon",children:(0,S.jsx)("img",{src:i.hq+"assets/images/NoDataAvailable.svg",alt:"",onLoad:()=>{s(!0)}})}),n&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("h3",{className:"academy-oops__heading",children:e}),(0,S.jsx)("h3",{className:"academy-oops__text",children:t})]})]}) | |
| 855 | -},bm=({dataFetchingStatus:e,copyDataArr:t,visibleColumn:a,isCheckboxColumnVisible:n,selectRowChange:s,noDataText:o,loadingHeight:i,bodyRef:l})=>{const c=e||!t;return(0,S.jsx)("div",{className:"kzui-table__body",ref:l,children:c?(0,S.jsx)("div",{className:"kzui-table__loader",style:{minHeight:i},children:(0,S.jsx)(Va,{})}):(0,S.jsx)(S.Fragment,{children:t?.length>0?(0,S.jsx)(S.Fragment,{children:t?.map((e,t)=>(0,S.jsxs)("div",{className:"kzui-table__body-row",children:[n&&(0,S.jsx)("div",{className:"kzui-table__row-cell kzui-table__row-cell-checkbox ",children:(0,S.jsx)("input",{type:"checkbox",checked:e.select,onChange:t=>s({row:e,select:t.target.checked})})}),a.length>0?(0,S.jsx)(S.Fragment,{children:a?.map((t,a)=>(0,S.jsx)("div",{className:"kzui-table__row-cell",children:t?.cell(e)},a))}):(0,S.jsx)(fm,{title:(0,r.__)("No visible columns available!!","ablocks")})]},t))}):(0,S.jsx)(fm,{title:(0,r.__)("No Data Available!!","ablocks"),subText:o})})}) | |
| 856 | -},gm=function({option:e,index:t,handleRemoveMultiSelectValue:a}){return(0,S.jsxs)("div",{className:"academy-multi-select--option",children:[(0,S.jsx)("span",{className:"academy-multi-select--option-label",children:e?.label}),(0,S.jsx)(sn,{className:"academy-remove-option",onClick:()=>a(e),icon:(0,S.jsx)("span",{className:"academy-icon academy-icon--close"})})]},t)},ym=function({searchOptions:e,setSearchOptions:t,inputValueRef:n,onInputChange:s}){const[r,o]=(0,a.useState)("4px");return(0,a.useEffect)(()=>{n.current&&""!==e?o(`${n.current.scrollWidth}px`):""===e&&o("4px")},[e]),(0,a.useEffect)(()=>{""!==e&&s(e)},[e]),(0,S.jsx)("div",{className:"academy-custom-select--input-container",children:(0,S.jsx)("input",{className:"academy-custom-select--search-option",type:"text",value:e,ref:n,onChange:e=>{t(e.target.value),s(e.target.value)},style:{width:r}})})},km=({option:e,index:t,suffix:a,handleSelectValue:n})=>(0,S.jsx)("span",{role:"presentation", | |
| 857 | -className:`academy-custom-select--option ${a&&a}`,onClick:()=>n(e),onKeyDown:()=>{},children:e?.label},t),vm=({groupItems:e,handleSelectValue:t,searchOptions:a,multiSelectValue:n,isMulti:s,groupItemsIndex:r})=>(0,S.jsxs)("div",{className:"academy-grouped-items",children:[e.options.length>0&&(0,S.jsx)("p",{className:"academy-grouped-items--title",children:e.label}),e.options?.filter(e=>0===(s?n.filter(t=>t.value===e.value):!n.includes(e)).length)?.filter(e=>e?.label?.toLowerCase()?.includes(a.toLowerCase())).map((e,a)=>(0,S.jsx)(km,{option:e,index:a,handleSelectValue:t},a))]},r),xm=({isGrouped:e,value:t,options:a,isMulti:n,multiSelectValue:s,searchOptions:o,handleSelectValue:i})=>(0,S.jsx)(S.Fragment,{children:e?(0,S.jsx)(S.Fragment,{children:a.length>0?(0,S.jsx)(S.Fragment,{children:a.map((e,t)=>(0,S.jsx)(vm,{groupItems:e,handleSelectValue:i,searchOptions:o,multiSelectValue:s,isMulti:n,groupItemsIndex:t},t))}):(0,S.jsx)("span",{className:"academy-custom-select--default-text", | |
| 858 | -children:(0,r.__)("No items found","ablocks")})}):(0,S.jsx)(S.Fragment,{children:a.length>0?(0,S.jsx)(S.Fragment,{children:n?a?.filter(e=>0===s.filter(t=>t.value===e.value).length)?.filter(e=>e?.label?.toLowerCase()?.includes(o.toLowerCase())).map((e,t)=>(0,S.jsx)(km,{option:e,index:t,handleSelectValue:i},t)):(0,S.jsx)(S.Fragment,{children:a?.filter(e=>!(e.value===t))?.filter(e=>e?.label?.toLowerCase()?.includes(o.toLowerCase()))?.map((e,n)=>{const s=t===e.value&&a.findIndex(t=>t.value===e.value)===n?" academy-custom-select--option--active":"";return(0,S.jsx)(km,{option:e,index:n,suffix:s,handleSelectValue:i},n)})})}):(0,S.jsx)("span",{className:"academy-custom-select--default-text",children:(0,r.__)("No items found","ablocks")})})}),wm={label:Aa().string,placeholder:Aa().string,value:Aa().oneOfType([Aa().object,Aa().array]),suffix:Aa().string,isSearchable:Aa().bool,isDisabled:Aa().bool,isClearable:Aa().bool,isGrouped:Aa().bool,options:Aa().array,onChangeHandler:Aa().func, | |
| 859 | -isMulti:Aa().bool,isLoading:Aa().bool,onMenuOpen:Aa().func,onInputChange:Aa().func,positionTop:Aa().string},Mm=({label:e="",placeholder:t=(0,r.__)("Select…","ablocks"),value:n="",suffix:s="",isSearchable:o=!1,isDisabled:i=!1,isClearable:l=!1,isGrouped:c=!1,options:d=[],onChangeHandler:u=()=>{},isMulti:m=!1,isLoading:_=!1,onMenuOpen:h=()=>{},onInputChange:p=()=>{},positionTop:f="100%"})=>{const b=(0,a.useRef)(null),g=(0,a.useRef)(null),y=(0,a.useRef)(null),[k,v]=(0,a.useState)(!1),[x,w]=(0,a.useState)(""),[M,L]=(0,a.useState)(m&&n.length?[...n]:[]);(0,a.useEffect)(()=>{k&&""!==x&&h(x)},[k,x]);const j=e=>{let t=[...M];t=t.filter(t=>t.value!==e.value),u(t),L(t)};return(0,a.useEffect)(()=>{const e=e=>{b?.current&&!b?.current?.contains(e.target)&&v(!1)};if(document.addEventListener("mousedown",e),y.current){const e=y.current.offsetHeight,t=b.current.getBoundingClientRect(),a=window.innerHeight-t.bottom,n=t.top;y.current.style.top=a<e&&n>a?`-${e+12}px`:f}return()=>{ | |
| 860 | -document.removeEventListener("mousedown",e)}},[k,x,d]),(0,S.jsxs)("div",{role:"presentation",className:`academy-control academy-custom-select ${s&&"academy-custom-select--"+s} ${i&&"academy-custom-select--disabled"}`,onClick:()=>{g?.current?.focus()},children:[(0,S.jsx)("label",{children:e}),(0,S.jsxs)("div",{className:"academy-custom-select--container",ref:b,children:[(0,S.jsxs)("div",{role:"presentation",className:"academy-custom-select--inner-content",onClick:()=>v(!k),children:[(0,S.jsx)("div",{className:"academy-custom-select--box",children:m?(0,S.jsxs)("div",{className:"academy-custom-select--multi-value",children:[M?.length>0?M.map((e,t)=>(0,S.jsx)(gm,{option:e,index:t,handleRemoveMultiSelectValue:j},t)):(0,S.jsx)("span",{className:"academy-select-default-text",children:t}),o&&(0,S.jsx)(ym,{searchOptions:x,setSearchOptions:w,inputValueRef:g,onInputChange:p})]}):(0,S.jsxs)("div",{className:"academy-custom-select--single-value",children:[o&&x?.length>0?"":(()=>{let e="" | |
| 861 | -;return e=n?.value?d?.find(e=>e.value===n.value)?.label:d?.find(e=>e.value===n)?.label,e?(0,S.jsxs)("div",{className:"academy-select-single-label",children:[(0,S.jsx)("span",{children:e}),l&&(0,S.jsx)(sn,{className:"academy-remove-option",onClick:()=>{u(""),w(""),e=""},icon:(0,S.jsx)("span",{className:"academy-icon academy-icon--close"})})]}):t})(n.value),o&&(0,S.jsx)(ym,{searchOptions:x,setSearchOptions:w,inputValueRef:g,onInputChange:p})]})}),(0,S.jsx)("div",{className:"academy-custom-select--indicator",children:(0,S.jsx)("span",{className:"academy-icon academy-icon--arrow-down"})})]}),(0,S.jsx)("div",{role:"presentation",className:"academy-custom-select--options"+(k?" academy-custom-select--options--toggle":""),onClick:()=>{v(!k)},ref:y,children:_?(0,S.jsx)(Va,{}):(0,S.jsx)(xm,{isGrouped:c,options:d,isMulti:m,multiSelectValue:M,searchOptions:x,handleSelectValue:e=>{if(m){const t=[];M.find(t=>t.value===e.value)||(t.push(e),L([...M,...t]),u([...M,...t]))}else u(e.value);w("")},value:n | |
| 862 | -})})]})]})};Mm.propTypes=wm;const Lm=Mm,jm=[{value:"10",label:(0,r.__)("10","ablocks")},{value:"15",label:(0,r.__)("15","ablocks")},{value:"20",label:(0,r.__)("20","ablocks")},{value:"25",label:(0,r.__)("25","ablocks")},{value:"30",label:(0,r.__)("30","ablocks")}],Sm=({data:e,totalItems:t,paginationPerPageChange:a,rowsPerPage:n,onChangePage:s,currentPageNumber:o})=>(0,S.jsxs)("div",{className:"kzui-table__footer",children:[(0,S.jsx)("span",{className:"kzui-table__footer-left",children:(0,r.sprintf)( | |
| 834 | +document.getElementById("ablockswrap")?cm().setAppElement("#ablockswrap"):document.getElementById("ablocksLessonsWrap")?cm().setAppElement("#ablocksLessonsWrap"):document.getElementById("ablocksFrontendDashWrap")?cm().setAppElement("#ablocksFrontendDashWrap"):document.getElementById("ablocksFrontendModalWrap")&&cm().setAppElement("#ablocksFrontendModalWrap"),um.propTypes=dm;const mm=function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;zn(this,n);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return En(Gn(Gn(t=Kn(this,(e=qn(n)).call.apply(e,[this].concat(r))))),"wrappedInstance",(0,a.createRef)()),t}return $n(n,t),Bn(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index), | |
| 835 | +e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,a=e.disabled,n=e.index,s=(0,jr.findDOMNode)(this);s.sortableInfo={collection:t,disabled:a,index:n,manager:this.context.manager},this.node=s,this.ref={node:s},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return Tu()(s.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=s.withRef?this.wrappedInstance:null;return(0,a.createElement)(e,Wn({ref:t | |
| 836 | +},Eu(this.props,im)))}}]),n}(a.Component),En(t,"displayName",zu("sortableElement",e)),En(t,"contextType",rm),En(t,"propTypes",om),En(t,"defaultProps",{collection:0}),n}(({copyColumn:e,itemIndex:t,checkedChange:a})=>(0,S.jsxs)("div",{className:"kzui-table__filter-checked-item",children:[(0,S.jsxs)("span",{className:"kzui-table-filter-item-left",children:[(0,S.jsx)("span",{className:"academy-icon academy-icon--drag"}),(0,S.jsx)("span",{className:"kzui-table-filter-item-title",children:e.name})]}),(0,S.jsx)("input",{id:e.name,type:"checkbox",checked:e.visible,onChange:t=>a({id:e.id,visible:t.target.checked})})]},`column-${t}`)),_m=function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;zn(this,n),En(Gn(Gn(t=Kn(this,qn(n).call(this,e)))),"state",{}),En(Gn(Gn(t)),"handleStart",function(e){var a=t.props,n=a.distance,s=a.shouldCancelStart;if(2!==e.button&&!s(e)){t.touched=!0,t.position=Bu(e) | |
| 837 | +;var r=Iu(e.target,function(e){return null!=e.sortableInfo});if(r&&r.sortableInfo&&t.nodeIsChild(r)&&!t.state.sorting){var o=t.props.useDragHandle,i=r.sortableInfo,l=i.index,c=i.collection;if(i.disabled)return;if(o&&!Iu(e.target,Qu))return;t.manager.active={collection:c,index:l},function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}(e)||"A"!==e.target.tagName||e.preventDefault(),n||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout(function(){return t.handlePress(e)},t.props.pressDelay))}}}),En(Gn(Gn(t)),"nodeIsChild",function(e){return e.sortableInfo.manager===t.manager}),En(Gn(Gn(t)),"handleMove",function(e){var a=t.props,n=a.distance,s=a.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var r=Bu(e),o={x:t.position.x-r.x,y:t.position.y-r.y},i=Math.abs(o.x)+Math.abs(o.y);t.delta=o,n||s&&!(i>=s)?n&&i>=n&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer), | |
| 838 | +t.cancelTimer=setTimeout(t.cancel,0))}}),En(Gn(Gn(t)),"handleEnd",function(){t.touched=!1,t.cancel()}),En(Gn(Gn(t)),"cancel",function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)}),En(Gn(Gn(t)),"handlePress",function(e){try{var a=t.manager.getActive(),n=function(){if(a){var n=function(){var a,n,s=m.sortableInfo.index,c=(a=m,{bottom:Wu((n=window.getComputedStyle(a)).marginBottom),left:Wu(n.marginLeft),right:Wu(n.marginRight),top:Wu(n.marginTop)}),p=function(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:Wu(t.gridColumnGap),y:Wu(t.gridRowGap)}:{x:0,y:0}}(t.container),f=t.scrollContainer.getBoundingClientRect(),b=o({index:s,node:m,collection:_});if(t.node=m,t.margin=c,t.gridGap=p,t.width=b.width,t.height=b.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=m.getBoundingClientRect(),t.containerBoundingRect=f,t.index=s,t.newIndex=s, | |
| 839 | +t.axis={x:r.indexOf("x")>=0,y:r.indexOf("y")>=0},t.offsetEdge=Vu(m,t.container),t.initialOffset=Bu(h?Yu({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild(function(e){var t="input, textarea, select, canvas, [contenteditable]",a=e.querySelectorAll(t),n=e.cloneNode(!0);return Xn(n.querySelectorAll(t)).forEach(function(e,t){"file"!==e.type&&(e.value=a[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),"CANVAS"===e.tagName&&a[t].width>0&&a[t].height>0&&e.getContext("2d").drawImage(a[t],0,0)}),n}(m)),Pu(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-c.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-c.top,"px"),width:"".concat(t.width,"px")}), | |
| 840 | +h&&t.helper.focus(),l&&(t.sortableGhost=m,Pu(m,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},h){var g=u?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,y=g.top,k=g.left,v=g.width,x=y+g.height,w=k+v;t.axis.x&&(t.minTranslate.x=k-t.boundingClientRect.left,t.maxTranslate.x=w-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=y-t.boundingClientRect.top,t.maxTranslate.y=x-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(u?0:f.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(u?t.contentWindow.innerWidth:f.left+f.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(u?0:f.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(u?t.contentWindow.innerHeight:f.top+f.height)-t.boundingClientRect.top-t.height/2);i&&i.split(" ").forEach(function(e){return t.helper.classList.add(e)}),t.listenerNode=e.touches?e.target:t.contentWindow, | |
| 841 | +h?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(Ou.move.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)}),Ou.end.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)})),t.setState({sorting:!0,sortingIndex:s}),d&&d({node:m,index:s,collection:_,isKeySorting:h,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),h&&t.keyMove(0)},s=t.props,r=s.axis,o=s.getHelperDimensions,i=s.helperClass,l=s.hideSortableGhost,c=s.updateBeforeSortStart,d=s.onSortStart,u=s.useWindowAsScrollContainer,m=a.node,_=a.collection,h=t.manager.isKeySorting,p=function(){if("function"==typeof c){t._awaitingUpdateBeforeSortStart=!0;var a=function(t,a){try{var n=function(){var t=m.sortableInfo.index;return Promise.resolve(c({collection:_,index:t,node:m,isKeySorting:h},e)).then(function(){})}()}catch(e){return a(!0,e)} | |
| 842 | +return n&&n.then?n.then(a.bind(null,!1),a.bind(null,!0)):a(!1,value)}(0,function(e,a){if(t._awaitingUpdateBeforeSortStart=!1,e)throw a;return a});if(a&&a.then)return a.then(function(){})}}();return p&&p.then?p.then(n):n()}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}),En(Gn(Gn(t)),"handleSortMove",function(e){var a=t.props.onSortMove;"function"==typeof e.preventDefault&&e.cancelable&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),a&&a(e)}),En(Gn(Gn(t)),"handleSortEnd",function(e){var a=t.props,n=a.hideSortableGhost,s=a.onSortEnd,r=t.manager,o=r.active.collection,i=r.isKeySorting,l=t.manager.getOrderedRefs();t.listenerNode&&(i?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(Ou.move.forEach(function(e){ | |
| 843 | +return t.listenerNode.removeEventListener(e,t.handleSortMove)}),Ou.end.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)}))),t.helper.parentNode.removeChild(t.helper),n&&t.sortableGhost&&Pu(t.sortableGhost,{opacity:"",visibility:""});for(var c=0,d=l.length;c<d;c++){var u=l[c],m=u.node;u.edgeOffset=null,u.boundingClientRect=null,Hu(m,null),Ru(m,null),u.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof s&&s({collection:o,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:i,nodes:l},e),t.touched=!1}),En(Gn(Gn(t)),"autoscroll",function(){var e=t.props.disableAutoscroll,a=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(a){var n=Yu({},t.translate),s=0,r=0;return t.axis.x&&(n.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),s=t.translate.x-n.x),t.axis.y&&(n.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)), | |
| 844 | +r=t.translate.y-n.y),t.translate=n,Hu(t.helper,t.translate),t.scrollContainer.scrollLeft+=s,void(t.scrollContainer.scrollTop+=r)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}}),En(Gn(Gn(t)),"onAutoScroll",function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()}),En(Gn(Gn(t)),"handleKeyDown",function(e){var a=e.keyCode,n=t.props,s=n.shouldCancelStart,r=n.keyCodes,o=Yu({},am,void 0===r?{}:r);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||o.lift.includes(a)&&!s(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),o.lift.includes(a)&&!t.manager.active?t.keyLift(e):o.drop.includes(a)&&t.manager.active?t.keyDrop(e):o.cancel.includes(a)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):o.up.includes(a)?t.keyMove(-1):o.down.includes(a)&&t.keyMove(1))}),En(Gn(Gn(t)),"keyLift",function(e){var a=e.target,n=Iu(a,function(e){return null!=e.sortableInfo | |
| 845 | +}).sortableInfo,s=n.index,r=n.collection;t.initialFocusedNode=a,t.manager.isKeySorting=!0,t.manager.active={index:s,collection:r},t.handlePress(e)}),En(Gn(Gn(t)),"keyMove",function(e){var a=t.manager.getOrderedRefs(),n=a[a.length-1].node.sortableInfo.index,s=t.newIndex+e,r=t.newIndex;if(!(s<0||s>n)){t.prevIndex=r,t.newIndex=s;var o=function(e,t,a){return e<a&&e>t?e-1:e>a&&e<t?e+1:e}(t.newIndex,t.prevIndex,t.index),i=a.find(function(e){return e.node.sortableInfo.index===o}),l=i.node,c=t.containerScrollDelta,d=i.boundingClientRect||Uu(l,c),u=i.translate||{x:0,y:0},m=d.top+u.y-c.top,_=d.left+u.x-c.left,h=r<s,p=h&&t.axis.x?l.offsetWidth-t.width:0,f=h&&t.axis.y?l.offsetHeight-t.height:0;t.handleSortMove({pageX:_+p,pageY:m+f,ignoreTransition:0===e})}}),En(Gn(Gn(t)),"keyDrop",function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()}),En(Gn(Gn(t)),"handleKeyEnd",function(e){t.manager.active&&t.keyDrop(e)}),En(Gn(Gn(t)),"isValidSortingTarget",function(e){ | |
| 846 | +var a=t.props.useDragHandle,n=e.target,s=Iu(n,function(e){return null!=e.sortableInfo});return s&&s.sortableInfo&&!s.sortableInfo.disabled&&(a?Qu(n):n.sortableInfo)});var s=new Cu;return function(e){Tu()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}(e),t.manager=s,t.wrappedInstance=(0,a.createRef)(),t.sortableContextValue={manager:s},t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return $n(n,t),Bn(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,a=this.getContainer();Promise.resolve(a).then(function(a){e.container=a,e.document=e.container.ownerDocument||document;var n=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof n?n():n,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:qu(e.container)||e.container, | |
| 847 | +e.autoScroller=new em(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach(function(t){return Ou[t].forEach(function(a){return e.container.addEventListener(a,e.events[t],!1)})}),e.container.addEventListener("keydown",e.handleKeyDown)})}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach(function(t){return Ou[t].forEach(function(a){return e.container.removeEventListener(a,e.events[t])})}),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,a=t.lockAxis,n=t.lockOffset,s=t.lockToContainerEdges,r=t.transitionDuration,o=t.keyboardSortingTransitionDuration,i=void 0===o?r:o,l=this.manager.isKeySorting,c=e.ignoreTransition,d=Bu(e),u={x:d.x-this.initialOffset.x,y:d.y-this.initialOffset.y};if(u.y-=window.pageYOffset-this.initialWindowScroll.top, | |
| 848 | +u.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=u,s){var m=function(e){var t=e.height,a=e.width,n=e.lockOffset,s=Array.isArray(n)?n:[n,n];Tu()(2===s.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",n);var r=Rn(s,2),o=r[0],i=r[1];return[$u({height:t,lockOffset:o,width:a}),$u({height:t,lockOffset:i,width:a})]}({height:this.height,lockOffset:n,width:this.width}),_=Rn(m,2),h=_[0],p=_[1],f={x:this.width/2-h.x,y:this.height/2-h.y},b={x:this.width/2-p.x,y:this.height/2-p.y};u.x=Fu(this.minTranslate.x+f.x,this.maxTranslate.x-b.x,u.x),u.y=Fu(this.minTranslate.y+f.y,this.maxTranslate.y-b.y,u.y)}"x"===a?u.y=0:"y"===a&&(u.x=0),l&&i&&!c&&Ru(this.helper,i),Hu(this.helper,u)}},{key:"animateNodes",value:function(){ | |
| 849 | +var e=this.props,t=e.transitionDuration,a=e.hideSortableGhost,n=e.onSortOver,s=this.containerScrollDelta,r=this.windowScrollDelta,o=this.manager.getOrderedRefs(),i=this.offsetEdge.left+this.translate.x+s.left,l=this.offsetEdge.top+this.translate.y+s.top,c=this.manager.isKeySorting,d=this.newIndex;this.newIndex=null;for(var u=0,m=o.length;u<m;u++){var _=o[u].node,h=_.sortableInfo.index,p=_.offsetWidth,f=_.offsetHeight,b={height:this.height>f?f/2:this.height/2,width:this.width>p?p/2:this.width/2},g=c&&h>this.index&&h<=d,y=c&&h<this.index&&h>=d,k={x:0,y:0},v=o[u].edgeOffset;v||(v=Vu(_,this.container),o[u].edgeOffset=v,c&&(o[u].boundingClientRect=Uu(_,s)));var x=u<o.length-1&&o[u+1],w=u>0&&o[u-1];x&&!x.edgeOffset&&(x.edgeOffset=Vu(x.node,this.container),c&&(x.boundingClientRect=Uu(x.node,s))),h!==this.index?(t&&Ru(_,t),this.axis.x?this.axis.y?y||h<this.index&&(i+r.left-b.width<=v.left&&l+r.top<=v.top+b.height||l+r.top+b.height<=v.top)?(k.x=this.width+this.marginOffset.x, | |
| 850 | +v.left+k.x>this.containerBoundingRect.width-b.width&&x&&(k.x=x.edgeOffset.left-v.left,k.y=x.edgeOffset.top-v.top),null===this.newIndex&&(this.newIndex=h)):(g||h>this.index&&(i+r.left+b.width>=v.left&&l+r.top+b.height>=v.top||l+r.top+b.height>=v.top+f))&&(k.x=-(this.width+this.marginOffset.x),v.left+k.x<this.containerBoundingRect.left+b.width&&w&&(k.x=w.edgeOffset.left-v.left,k.y=w.edgeOffset.top-v.top),this.newIndex=h):g||h>this.index&&i+r.left+b.width>=v.left?(k.x=-(this.width+this.marginOffset.x),this.newIndex=h):(y||h<this.index&&i+r.left<=v.left+b.width)&&(k.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=h)):this.axis.y&&(g||h>this.index&&l+r.top+b.height>=v.top?(k.y=-(this.height+this.marginOffset.y),this.newIndex=h):(y||h<this.index&&l+r.top<=v.top+b.height)&&(k.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=h))),Hu(_,k),o[u].translate=k):a&&(this.sortableGhost=_,Pu(_,{opacity:0,visibility:"hidden"}))} | |
| 851 | +null==this.newIndex&&(this.newIndex=this.index),c&&(this.newIndex=d);var M=c?this.prevIndex:d;n&&this.newIndex!==M&&n({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:M,isKeySorting:c,nodes:o,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return Tu()(s.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.wrappedInstance.current}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,jr.findDOMNode)(this):e(s.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=s.withRef?this.wrappedInstance:null;return(0,a.createElement)(rm.Provider,{value:this.sortableContextValue},(0,a.createElement)(e,Wn({ref:t},Eu(this.props,sm))))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{ | |
| 852 | +key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),n}(a.Component),En(t,"displayName",zu("sortableList",e)),En(t,"defaultProps",nm),En(t,"propTypes",tm),n}(e=>(0,S.jsx)("ul",{className:"kzui-table__filter-items",children:e.children})),hm=({setTempCopyColumns:e,tempCopyColumns:t,showColumnFilter:s,checkedChange:o,setCopyColumns:i,copyColumns:l,suffix:c})=>{const[d,u]=(0,a.useState)(!1),[m,_]=(0,a.useState)([]);return(0,a.useEffect)(()=>{_([...t])},[]),(0,S.jsxs)(n().Fragment,{children:[(0,S.jsx)("div",{className:"kzui-table__sub-header-filter-icon",children:(0,S.jsx)(Ja,{label:(0,r.__)("Columns","ablocks"),icon:(0,S.jsx)("span",{ | |
| 853 | +className:"academy-icon academy-icon--columns"}),onClick:()=>{u(!d)},preset:"transparent",border:"gray",size:"sm",borderRadius:"rounded"})}),(0,S.jsx)(um,{isOpen:d,onRequestClose:()=>{u(!1)},title:(0,r.__)("Columns","ablocks"),suffix:"column-suffix",size:"small",children:(0,S.jsxs)("div",{className:"kzui-table__filter-modal",children:[(0,S.jsxs)("div",{className:"kzui-table__filter-modal__top-bar",children:[(0,S.jsx)("span",{children:(0,r.__)("Columns","ablocks")}),(0,S.jsx)(Ja,{label:(0,r.__)("Reset","ablocks"),onClick:()=>{e([...m])},preset:"transparent",size:"sm",type:"button",suffix:"reset-all"})]}),s&&(0,S.jsx)(_m,{onSortEnd:({oldIndex:a,newIndex:n})=>{const s=(r=t,o=a,i=n,function(e,t,a){const n=t<0?e.length+t:t;if(n>=0&&n<e.length){const n=a<0?e.length+a:a,[s]=e.splice(t,1);e.splice(n,0,s)}}(r=[...r],o,i),r);var r,o,i;e(s)},children:t?.map((e,t)=>(0,S.jsx)(mm,{index:t,copyColumn:e,itemIndex:t,checkedChange:o},`column-${t}`))}),(0,S.jsxs)("div",{ | |
| 854 | +className:"kzui-table__filter-modal__footer",children:[(0,S.jsx)(Ja,{label:(0,r.__)("Cancel","ablocks"),onClick:()=>{e([...l]),u(!1)},preset:"transparent",size:"sm",type:"button",suffix:"cancel",border:"gray",borderRadius:"rounded"}),(0,S.jsx)(Ja,{label:(0,r.__)("Apply","ablocks"),onClick:()=>{i(t),localStorage.setItem(c,JSON.stringify(t)),u(!1)},size:"sm",borderRadius:"rounded"})]})]})})]})},pm=({subHeaderComponent:e,setTempCopyColumns:t,tempCopyColumns:a,showColumnFilter:n,checkedChange:s,setCopyColumns:r,copyColumns:o,suffix:i})=>(0,S.jsxs)("div",{className:"kzui-table__sub-header",children:[(0,S.jsx)("div",{className:"kzui-table__sub-header-left",children:e&&e}),(0,S.jsx)("div",{className:"kzui-table__sub-header-right",children:n&&(0,S.jsx)(hm,{setTempCopyColumns:t,tempCopyColumns:a,showColumnFilter:n,checkedChange:s,setCopyColumns:r,copyColumns:o,suffix:i})})]}),fm=({visibleColumn:e,isCheckboxColumnVisible:t,copyDataArr:a,selectAllRow:n,data:s})=>{const r=s.length>0&&a;return(0, | |
| 855 | +S.jsx)("div",{className:"kzui-table__head",children:(0,S.jsxs)("div",{className:"kzui-table__head-row",children:[t&&(0,S.jsx)("div",{className:"kzui-table__row-cell kzui-table__row-cell-checkbox",children:(0,S.jsx)("input",{checked:r&&a?.every(e=>e.select),type:"checkbox",onChange:n})}),e?.map((e,t)=>(0,S.jsx)("div",{className:"kzui-table__row-cell kzui-table__header-row-cell "+(e.isLabelWidth?"kzui-table__row-cell--isLabelWidth":""),children:e.name},t))]})})},bm=({title:e,subText:t})=>{const[n,s]=(0,a.useState)(!1);return(0,S.jsxs)("div",{className:"academy-oops academy-oops__message",children:[(0,S.jsx)("div",{className:"academy-oops__icon",children:(0,S.jsx)("img",{src:i.hq+"assets/images/NoDataAvailable.svg",alt:"",onLoad:()=>{s(!0)}})}),n&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("h3",{className:"academy-oops__heading",children:e}),(0,S.jsx)("h3",{className:"academy-oops__text",children:t})]})]}) | |
| 856 | +},gm=({dataFetchingStatus:e,copyDataArr:t,visibleColumn:a,isCheckboxColumnVisible:n,selectRowChange:s,noDataText:o,loadingHeight:i,bodyRef:l})=>{const c=e||!t;return(0,S.jsx)("div",{className:"kzui-table__body",ref:l,children:c?(0,S.jsx)("div",{className:"kzui-table__loader",style:{minHeight:i},children:(0,S.jsx)(Va,{})}):(0,S.jsx)(S.Fragment,{children:t?.length>0?(0,S.jsx)(S.Fragment,{children:t?.map((e,t)=>(0,S.jsxs)("div",{className:"kzui-table__body-row",children:[n&&(0,S.jsx)("div",{className:"kzui-table__row-cell kzui-table__row-cell-checkbox ",children:(0,S.jsx)("input",{type:"checkbox",checked:e.select,onChange:t=>s({row:e,select:t.target.checked})})}),a.length>0?(0,S.jsx)(S.Fragment,{children:a?.map((t,a)=>(0,S.jsx)("div",{className:"kzui-table__row-cell",children:t?.cell(e)},a))}):(0,S.jsx)(bm,{title:(0,r.__)("No visible columns available!!","ablocks")})]},t))}):(0,S.jsx)(bm,{title:(0,r.__)("No Data Available!!","ablocks"),subText:o})})}) | |
| 857 | +},ym=function({option:e,index:t,handleRemoveMultiSelectValue:a}){return(0,S.jsxs)("div",{className:"academy-multi-select--option",children:[(0,S.jsx)("span",{className:"academy-multi-select--option-label",children:e?.label}),(0,S.jsx)(sn,{className:"academy-remove-option",onClick:()=>a(e),icon:(0,S.jsx)("span",{className:"academy-icon academy-icon--close"})})]},t)},km=function({searchOptions:e,setSearchOptions:t,inputValueRef:n,onInputChange:s}){const[r,o]=(0,a.useState)("4px");return(0,a.useEffect)(()=>{n.current&&""!==e?o(`${n.current.scrollWidth}px`):""===e&&o("4px")},[e]),(0,a.useEffect)(()=>{""!==e&&s(e)},[e]),(0,S.jsx)("div",{className:"academy-custom-select--input-container",children:(0,S.jsx)("input",{className:"academy-custom-select--search-option",type:"text",value:e,ref:n,onChange:e=>{t(e.target.value),s(e.target.value)},style:{width:r}})})},vm=({option:e,index:t,suffix:a,handleSelectValue:n})=>(0,S.jsx)("span",{role:"presentation", | |
| 858 | +className:`academy-custom-select--option ${a&&a}`,onClick:()=>n(e),onKeyDown:()=>{},children:e?.label},t),xm=({groupItems:e,handleSelectValue:t,searchOptions:a,multiSelectValue:n,isMulti:s,groupItemsIndex:r})=>(0,S.jsxs)("div",{className:"academy-grouped-items",children:[e.options.length>0&&(0,S.jsx)("p",{className:"academy-grouped-items--title",children:e.label}),e.options?.filter(e=>0===(s?n.filter(t=>t.value===e.value):!n.includes(e)).length)?.filter(e=>e?.label?.toLowerCase()?.includes(a.toLowerCase())).map((e,a)=>(0,S.jsx)(vm,{option:e,index:a,handleSelectValue:t},a))]},r),wm=({isGrouped:e,value:t,options:a,isMulti:n,multiSelectValue:s,searchOptions:o,handleSelectValue:i})=>(0,S.jsx)(S.Fragment,{children:e?(0,S.jsx)(S.Fragment,{children:a.length>0?(0,S.jsx)(S.Fragment,{children:a.map((e,t)=>(0,S.jsx)(xm,{groupItems:e,handleSelectValue:i,searchOptions:o,multiSelectValue:s,isMulti:n,groupItemsIndex:t},t))}):(0,S.jsx)("span",{className:"academy-custom-select--default-text", | |
| 859 | +children:(0,r.__)("No items found","ablocks")})}):(0,S.jsx)(S.Fragment,{children:a.length>0?(0,S.jsx)(S.Fragment,{children:n?a?.filter(e=>0===s.filter(t=>t.value===e.value).length)?.filter(e=>e?.label?.toLowerCase()?.includes(o.toLowerCase())).map((e,t)=>(0,S.jsx)(vm,{option:e,index:t,handleSelectValue:i},t)):(0,S.jsx)(S.Fragment,{children:a?.filter(e=>!(e.value===t))?.filter(e=>e?.label?.toLowerCase()?.includes(o.toLowerCase()))?.map((e,n)=>{const s=t===e.value&&a.findIndex(t=>t.value===e.value)===n?" academy-custom-select--option--active":"";return(0,S.jsx)(vm,{option:e,index:n,suffix:s,handleSelectValue:i},n)})})}):(0,S.jsx)("span",{className:"academy-custom-select--default-text",children:(0,r.__)("No items found","ablocks")})})}),Mm={label:Aa().string,placeholder:Aa().string,value:Aa().oneOfType([Aa().object,Aa().array]),suffix:Aa().string,isSearchable:Aa().bool,isDisabled:Aa().bool,isClearable:Aa().bool,isGrouped:Aa().bool,options:Aa().array,onChangeHandler:Aa().func, | |
| 860 | +isMulti:Aa().bool,isLoading:Aa().bool,onMenuOpen:Aa().func,onInputChange:Aa().func,positionTop:Aa().string},Lm=({label:e="",placeholder:t=(0,r.__)("Select…","ablocks"),value:n="",suffix:s="",isSearchable:o=!1,isDisabled:i=!1,isClearable:l=!1,isGrouped:c=!1,options:d=[],onChangeHandler:u=()=>{},isMulti:m=!1,isLoading:_=!1,onMenuOpen:h=()=>{},onInputChange:p=()=>{},positionTop:f="100%"})=>{const b=(0,a.useRef)(null),g=(0,a.useRef)(null),y=(0,a.useRef)(null),[k,v]=(0,a.useState)(!1),[x,w]=(0,a.useState)(""),[M,L]=(0,a.useState)(m&&n.length?[...n]:[]);(0,a.useEffect)(()=>{k&&""!==x&&h(x)},[k,x]);const j=e=>{let t=[...M];t=t.filter(t=>t.value!==e.value),u(t),L(t)};return(0,a.useEffect)(()=>{const e=e=>{b?.current&&!b?.current?.contains(e.target)&&v(!1)};if(document.addEventListener("mousedown",e),y.current){const e=y.current.offsetHeight,t=b.current.getBoundingClientRect(),a=window.innerHeight-t.bottom,n=t.top;y.current.style.top=a<e&&n>a?`-${e+12}px`:f}return()=>{ | |
| 861 | +document.removeEventListener("mousedown",e)}},[k,x,d]),(0,S.jsxs)("div",{role:"presentation",className:`academy-control academy-custom-select ${s&&"academy-custom-select--"+s} ${i&&"academy-custom-select--disabled"}`,onClick:()=>{g?.current?.focus()},children:[(0,S.jsx)("label",{children:e}),(0,S.jsxs)("div",{className:"academy-custom-select--container",ref:b,children:[(0,S.jsxs)("div",{role:"presentation",className:"academy-custom-select--inner-content",onClick:()=>v(!k),children:[(0,S.jsx)("div",{className:"academy-custom-select--box",children:m?(0,S.jsxs)("div",{className:"academy-custom-select--multi-value",children:[M?.length>0?M.map((e,t)=>(0,S.jsx)(ym,{option:e,index:t,handleRemoveMultiSelectValue:j},t)):(0,S.jsx)("span",{className:"academy-select-default-text",children:t}),o&&(0,S.jsx)(km,{searchOptions:x,setSearchOptions:w,inputValueRef:g,onInputChange:p})]}):(0,S.jsxs)("div",{className:"academy-custom-select--single-value",children:[o&&x?.length>0?"":(()=>{let e="" | |
| 862 | +;return e=n?.value?d?.find(e=>e.value===n.value)?.label:d?.find(e=>e.value===n)?.label,e?(0,S.jsxs)("div",{className:"academy-select-single-label",children:[(0,S.jsx)("span",{children:e}),l&&(0,S.jsx)(sn,{className:"academy-remove-option",onClick:()=>{u(""),w(""),e=""},icon:(0,S.jsx)("span",{className:"academy-icon academy-icon--close"})})]}):t})(n.value),o&&(0,S.jsx)(km,{searchOptions:x,setSearchOptions:w,inputValueRef:g,onInputChange:p})]})}),(0,S.jsx)("div",{className:"academy-custom-select--indicator",children:(0,S.jsx)("span",{className:"academy-icon academy-icon--arrow-down"})})]}),(0,S.jsx)("div",{role:"presentation",className:"academy-custom-select--options"+(k?" academy-custom-select--options--toggle":""),onClick:()=>{v(!k)},ref:y,children:_?(0,S.jsx)(Va,{}):(0,S.jsx)(wm,{isGrouped:c,options:d,isMulti:m,multiSelectValue:M,searchOptions:x,handleSelectValue:e=>{if(m){const t=[];M.find(t=>t.value===e.value)||(t.push(e),L([...M,...t]),u([...M,...t]))}else u(e.value);w("")},value:n | |
| 863 | +})})]})]})};Lm.propTypes=Mm;const jm=Lm,Sm=[{value:"10",label:(0,r.__)("10","ablocks")},{value:"15",label:(0,r.__)("15","ablocks")},{value:"20",label:(0,r.__)("20","ablocks")},{value:"25",label:(0,r.__)("25","ablocks")},{value:"30",label:(0,r.__)("30","ablocks")}],Ym=({data:e,totalItems:t,paginationPerPageChange:a,rowsPerPage:n,onChangePage:s,currentPageNumber:o})=>(0,S.jsxs)("div",{className:"kzui-table__footer",children:[(0,S.jsx)("span",{className:"kzui-table__footer-left",children:(0,r.sprintf)( | |
| 863 | 864 | // translators: %s: totalItems |
| 864 | 865 | // translators: %s: totalItems |
| 865 | -(0,r.__)("Showing result %s out of %s","ablocks"),e?.length,t)}),(0,S.jsxs)("div",{className:"kzui-table__footer-right",children:[(0,S.jsxs)("div",{className:"kzui-table__footer-pagination per__page",children:[(0,S.jsx)("p",{children:(0,r.__)("Rows per page","ablocks")}),(0,S.jsx)(Lm,{onChangeHandler:a,value:n?jm.find(e=>parseInt(e.value)===parseInt(n)):jm[0],options:jm,positionTop:"-160px"})]}),(0,S.jsx)("div",{className:"kzui-table__footer-pagination-pages icons",children:(0,S.jsx)(ln,{totalItems:t,fetchHandler:s,currentPageNumber:o,rowsPerPage:n})})]})]}),Ym={columns:Aa().array,data:Aa().array,isRowSelectable:Aa().bool,getSelectRowValue:Aa().func,showSubHeader:Aa().bool,subHeaderComponent:Aa().func,showColumnFilter:Aa().bool,showPagination:Aa().bool,onChangePage:Aa().func,onChangeItemsPerPage:Aa().func,suffix:Aa().string,noDataText:Aa().string,currentPageNumber:Aa().number,totalItems:Aa().number,dataFetchingStatus:Aa().bool,resetSelected:Aa().bool,rowsPerPage:Aa().number},Dm=e=>{ | |
| 866 | +(0,r.__)("Showing result %s out of %s","ablocks"),e?.length,t)}),(0,S.jsxs)("div",{className:"kzui-table__footer-right",children:[(0,S.jsxs)("div",{className:"kzui-table__footer-pagination per__page",children:[(0,S.jsx)("p",{children:(0,r.__)("Rows per page","ablocks")}),(0,S.jsx)(jm,{onChangeHandler:a,value:n?Sm.find(e=>parseInt(e.value)===parseInt(n)):Sm[0],options:Sm,positionTop:"-160px"})]}),(0,S.jsx)("div",{className:"kzui-table__footer-pagination-pages icons",children:(0,S.jsx)(ln,{totalItems:t,fetchHandler:s,currentPageNumber:o,rowsPerPage:n})})]})]}),Dm={columns:Aa().array,data:Aa().array,isRowSelectable:Aa().bool,getSelectRowValue:Aa().func,showSubHeader:Aa().bool,subHeaderComponent:Aa().func,showColumnFilter:Aa().bool,showPagination:Aa().bool,onChangePage:Aa().func,onChangeItemsPerPage:Aa().func,suffix:Aa().string,noDataText:Aa().string,currentPageNumber:Aa().number,totalItems:Aa().number,dataFetchingStatus:Aa().bool,resetSelected:Aa().bool,rowsPerPage:Aa().number},Tm=e=>{ | |
| 866 | 867 | const{columns:t=[],data:n=[],isRowSelectable:s=!0,getSelectRowValue:o,showSubHeader:i=!0,subHeaderComponent:l,showColumnFilter:c=!0,showPagination:d=!1,onChangePage:u,onChangeItemsPerPage:m,suffix:_="",noDataText:h=(0,r.__)("Please, create data to see the available list here.","ablocks"),totalItems:p=0,dataFetchingStatus:f=!1,resetSelected:b=!1,currentPageNumber:g=1,rowsPerPage:y=10}=e,k=(0,a.useRef)(null),[v,x]=(0,a.useState)("10"),[w,M]=(0,a.useState)("0px"),[L,j]=(0,a.useState)(!1),[Y,D]=(0,a.useState)(t?.map((e,t)=>({...e,visible:!0,id:`column-${t}`}))),T=Ln().isEqual(n,L),[C,N]=(0,a.useState)(Y?.filter(e=>e.visible)),[E,O]=(0,a.useState)([...Y]),[A,P]=(0,a.useState)(!1),H=C.length>0&&s;(0,a.useEffect)(()=>{T||j(n?.map((e,t)=>({...e,rowId:`row-${t}`,select:!1})))},[T,n]),(0,a.useEffect)(()=>{j(n&&n?.map((e,t)=>({...e,rowId:`row-${t}`,select:!1})))},[n?.length]),(0,a.useEffect)(()=>{ |
| 867 | -0===n.length||!1===n?M("400px"):k.current.offsetHeight<100?M("100px"):M(`${k.current.offsetHeight}px`)},[n?.length,k,y]),(0,a.useEffect)(()=>{const e=Y.filter(e=>!0===e.visible);function t(){window.innerWidth<1280||e.length>6?P(!0):P(!1)}return window.addEventListener("resize",t),t(),()=>{window.removeEventListener("resize",t)}},[window.innerWidth,Y]),(0,a.useEffect)(()=>{N(Y?.filter(e=>e.visible)),M(!1)},[Y]),(0,a.useEffect)(()=>{const e=JSON.parse(localStorage.getItem(_));if(e){const t=Y.reduce((t,a)=>(e.forEach(e=>{e.id===a.id&&t.push({...e,cell:a.cell})}),t),[]),a=e.reduce((e,a)=>(t.forEach(t=>{a.id===t.id&&e.push({...t})}),e),[]);O(a),D(a)}},[]),(0,a.useEffect)(()=>{"function"==typeof o&&o(L&&L?.filter(e=>e.select))},[L]),(0,a.useEffect)(()=>{b&&L&&j(L&&L?.map(e=>({...e,select:!1})))},[b]);const R=d&&L?.length>0;return(0,S.jsx)("div",{className:`kzui-table ${_&&"kzui-table--"+_}`,children:(0,S.jsxs)("div",{className:"kzui-table__container",children:[i&&(0,S.jsx)(hm,{ | |
| 868 | -subHeaderComponent:l,setTempCopyColumns:O,tempCopyColumns:E,showColumnFilter:c,checkedChange:({id:e,visible:t})=>{let a;a="reset"===e?E.map(e=>({...e,visible:!0})):E.map(a=>a.id===e?{...a,visible:t}:a),O(a)},setCopyColumns:D,copyColumns:Y,suffix:_}),(0,S.jsxs)("div",{className:`kzui-table__table ${A&&"kzui-table--has-slider"}`,children:[(0,S.jsx)(pm,{data:n,visibleColumn:C,copyDataArr:L,selectAllRow:e=>j(t=>t.map(t=>({...t,select:e.target.checked}))),isCheckboxColumnVisible:H}),(0,S.jsx)(bm,{dataFetchingStatus:f,copyDataArr:L,visibleColumn:C,isCheckboxColumnVisible:H,selectRowChange:({row:e,select:t})=>{const a=L.map(a=>a.rowId===e.rowId?{...a,select:t}:a);j(a)},noDataText:h,loadingHeight:w,bodyRef:k})]}),R&&(0,S.jsx)(Sm,{data:n,totalItems:p,paginationPerPageChange:e=>{x(e),M(`${k.current.offsetHeight}px`),m(parseInt(e),parseInt(g))},rowsPerPage:y,onChangePage:u,currentPageNumber:g})]})})};Dm.propTypes=Ym | |
| 869 | -;const Tm=Dm,Cm=ut("ablocks/FetchSubmissions",({status:e="all",page:t=1,per_page:a=10,search:n=""},s)=>{const o="trash"===e?"yes":"no";return(0,i.In)({action:"ablocks/get_entries",status:e,current_page:t,per_page:a,search:n,is_in_trash:o}).then(e=>e?.data?.success?e.data.data:(s.dispatch(wt({message:(0,r.__)("Failed to fetch entries!","ablocks"),isShow:!0,type:"error"})),s.rejectWithValue(e.data.data||"Failed to fetch entries!")))}),Nm=ut("ablocks/exportEntriesAsCSV",()=>(0,i.In)({action:"ablocks/get_entries",export_csv:1}).then(e=>e.data.data)),Em=ut("ablocks/fetchEntry",({id:e},t)=>(0,i.In)({action:"ablocks/get_entry",entry_id:e}).then(e=>e?.data?.success?e.data.data:(t.dispatch(wt({message:(0,r.__)("Failed to fetch entry!","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue(e.data.data||"Failed to fetch entry!")))),Om=ut("ablocks/editEntry",({id:e,updatedData:t},a)=>(0,i.In)({action:"ablocks/edit_entry",entry_id:parseInt(e),data:t}).then(e=>e.data.success?(a.dispatch(wt({ | |
| 870 | -message:(0,r.__)("Successfully updated entry!","ablocks"),isShow:!0,type:"success"})),e.data.data):(a.dispatch(wt({message:(0,r.__)("Failed to update entry!","ablocks"),isShow:!0,type:"error"})),a.rejectWithValue(e.data.data||"Failed to update entry!")))),Am=ut("ablocks/deleteEntry",({entryIds:e},t)=>(0,i.In)({action:"ablocks/delete_entries","entry_id_array[0]":e[0]}).then(e=>e.data.success?(t.dispatch(wt({message:(0,r.__)("Successfully deleted entries!","ablocks"),isShow:!0,type:"success"})),e.data.data):(t.dispatch(wt({message:(0,r.__)("Failed to delete entries!","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue(e.data.data||"Failed to delete entries!")))),Pm=ut("ablocks/markEntriesAsRead",({entryIds:e},t)=>(0,i.In)({action:"ablocks/mark_entries_as_read",entry_id_array:e}).then(e=>e.data.success?(t.dispatch(wt({message:(0,r.__)("Successfully marked entries as read!","ablocks"),isShow:!0,type:"success"})),e.data.data):(t.dispatch(wt({message:(0, | |
| 871 | -r.__)("Failed to mark entries as read!","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue(e.data.data||"Failed to mark entries as read!")))),Hm=ut("ablocks/markEntriesAsUnread",({entryIds:e},t)=>(0,i.In)({action:"ablocks/mark_entries_as_unread",entry_id_array:e}).then(e=>e.data.success?(t.dispatch(wt({message:(0,r.__)("Successfully marked entries as unread!","ablocks"),isShow:!0,type:"success"})),e.data.data):(t.dispatch(wt({message:(0,r.__)("Failed to mark entries as unread!","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue(e.data.data||"Failed to mark entries as unread!")))),Rm=ut("ablocks/sendEntriesToTrash",({entryId:e},t)=>(0,i.In)({action:"ablocks/send_entries_to_trash",entry_id:e}).then(e=>e.data.success?(t.dispatch(wt({message:(0,r.__)("Successfully sent entries to trash!","ablocks"),isShow:!0,type:"success"})),e.data.data):(t.dispatch(wt({message:(0,r.__)("Failed to send entries to trash!","ablocks"),isShow:!0,type:"error"})), | |
| 872 | -t.rejectWithValue(e.data.data||"Failed to send entries to trash!")))),Im=ut("ablocks/restoreEntriesFromTrash",({entryId:e},t)=>(0,i.In)({action:"ablocks/restore_entries_from_trash",entry_id:e}).then(e=>e.data.success?(t.dispatch(wt({message:(0,r.__)("Successfully restored entries from trash!","ablocks"),isShow:!0,type:"success"})),e.data.data):(t.dispatch(wt({message:(0,r.__)("Failed to restore entries from trash!","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue(e.data.data||"Failed to restore entries from trash!")))),Fm=ut("ablocks/updateSettings",async({values:e,url:t="ablocks/save_settings"},a)=>{try{const n=await(0,i.In)({action:t,...e});return n.data.success?(a.dispatch(wt({message:(0,r.__)("Settings Saved!","ablocks"),isShow:!0,type:"success"})),e):(a.dispatch(wt({message:(0,r.__)("Failed to save settings.","ablocks"),isShow:!0,type:"error"})),a.rejectWithValue(n.data.data))}catch(e){return a.dispatch(wt({message:e?.response?.data?.message??e.message,isShow:!0,type:"error" | |
| 873 | -})),a.rejectWithValue(e.message)}}),Wm=bt({name:"submissions",initialState:{loading:!1,data:[]},reducers:{updateCurrentPage:(e,t)=>{e.data={...e.data,current_page:t.payload}},updateItemPerPage:(e,t)=>{e.data={...e.data,per_page:t.payload}}},extraReducers:e=>{e.addCase(Cm.pending,e=>{e.loading=!0}).addCase(Cm.fulfilled,(e,t)=>{e.loading=!1,e.data=t.payload}).addCase(Cm.rejected,e=>{e.loading=!1}).addCase(Nm.pending,e=>{e.loading=!0}).addCase(Nm.fulfilled,(e,t)=>{e.loading=!1,e.csv_data=t.payload.csv_data}).addCase(Nm.rejected,e=>{e.loading=!1}).addCase(Pm.pending,e=>{e.loading=!0}).addCase(Pm.fulfilled,(e,t)=>{e.loading=!1,e.data.data=e.data.data.map(e=>t.payload.id_of_updated_entries.includes(e.id)?{...e,status:"read"}:e)}).addCase(Pm.rejected,e=>{e.loading=!1}).addCase(Hm.pending,e=>{e.loading=!0}).addCase(Hm.fulfilled,(e,t)=>{e.loading=!1,e.data.data=e.data.data.map(e=>t?.payload?.id_of_updated_entries.includes(e.id)?{...e,status:"unread"}:e)}).addCase(Hm.rejected,e=>{e.loading=!1 | |
| 874 | -}).addCase(Rm.pending,e=>{e.loading=!0}).addCase(Rm.fulfilled,(e,t)=>{e.loading=!1,e.data.data=e.data.data.filter(e=>t?.payload?.data.id!==parseInt(e.id))}).addCase(Rm.rejected,e=>{e.loading=!1}).addCase(Im.pending,e=>{e.loading=!0}).addCase(Im.fulfilled,(e,t)=>{e.loading=!1,e.data.data=e.data.data.map(e=>t?.payload?.data.id===parseInt(e.id)?{...e,status:t?.payload?.data.status}:e)}).addCase(Im.rejected,e=>{e.loading=!1}).addCase(Am.pending,e=>{e.loading=!0}).addCase(Am.fulfilled,(e,t)=>{e.loading=!1,e.data.data=e.data.data.filter(e=>!t.payload.id_of_deleted_entries.includes(e.id))}).addCase(Am.rejected,e=>{e.loading=!1}).addCase(Em.pending,e=>{e.loading=!0}).addCase(Em.fulfilled,(e,t)=>{e.loading=!1,e.data=t.payload}).addCase(Em.rejected,e=>{e.loading=!1}).addCase(Fm.pending,e=>{e.loading=!0}).addCase(Fm.fulfilled,(e,t)=>{e.loading=!1,e.data={...e.data,...t.payload}}).addCase(Fm.rejected,e=>{e.loading=!1})} | |
| 875 | -}),zm=Wm.reducer,{updateCurrentPage:Um,updateItemPerPage:Bm}=Wm.actions,Vm=window.moment;var $m=o.n(Vm);const qm=[{label:(0,r.__)("All","ablocks"),value:"all"},{label:(0,r.__)("Read","ablocks"),value:"read"},{label:(0,r.__)("Unread","ablocks"),value:"unread"},{label:(0,r.__)("Trash","ablocks"),value:"trash"}],Jm=()=>{const e=j(e=>e.submissions),t=w(),[o,l]=(0,a.useState)([]),[c,d]=(0,a.useState)({}),[u,m]=(0,a.useState)(!1),[_,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),b=(0,s.Zp)(),g=function(){const{search:e}=(0,s.zy)();return n().useMemo(()=>new URLSearchParams(e),[e])}(),y=g.get("status"),k=g.get("perPage"),v=g.get("search"),[x,M]=(0,a.useState)(y||"all"),L=(e="",t="")=>{let a=`${i.Y3}admin.php?page=ablocks-submissions`;if(""!==e&&null!==e&&"null"!==e&&"all"!==e){const t="?"===a[a.length-1]&&a.split(a.length-1);a=`${a}${t?"":"&"}status=${e}`}if(""!==t&&null!==t&&"null"!==t){const e="?"===a[a.length-1]&&a.split(a.length-1);a=`${a}${e?"":"&"}search=${t}`}b(a)},Y=[..."trash"!==x?[{ | |
| 876 | -suffix:"trash",label:(0,r.__)("Trash","ablocks"),onClick:()=>d({value:"trash",message:(0,r.__)("Are you sure, you want to move these item to trash!","ablocks")})}]:[],..."trash"===x?[{suffix:"restore",label:(0,r.__)("Restore","ablocks"),onClick:()=>d({value:"restore",message:(0,r.__)("Are you sure, you want to restore these items?","ablocks")})},{suffix:"delete",label:(0,r.__)("Delete Permanently","ablocks"),onClick:()=>d({value:"delete",message:(0,r.__)("Are you sure, you want to delete these items?","ablocks")})}]:[]];(0,a.useEffect)(()=>{f(!0),t(Cm({status:x})).then(()=>{f(!1),0===e?.data?.data?.length&&e?.data?.current_page>1&&C(e.data.current_page-1)})},[x]),(0,a.useEffect)(()=>{L(y,v)},[y,v]);const D=()=>{l([]),d({}),h(!0),m(!1)};n().useMemo(()=>{u?(async a=>{f(!0),"trash"!==x&&"trash"===a?(await Promise.all(o.map(e=>t(Rm({entryId:parseInt(e.id)})))),await t(Cm({status:x,page:e?.data?.current_page||1,per_page:e?.data?.per_page||10 | |
| 877 | -}))):"restore"===a?(await Promise.all(o.map(e=>t(Im({entryId:parseInt(e.id)})))),await t(Cm({status:y}))):(await Promise.all(o.map(e=>t(Am({entryIds:[parseInt(e.id)]})))),await t(Cm({status:x,page:e?.data?.current_page||1,per_page:e?.data?.per_page||10}))),f(!1),D()})(c.value):D()},[u]);const T=(e=1,a=10)=>{f(!0),t(Cm({status:x,page:e,per_page:a})).then(()=>{f(!1)})},C=(e,a=10)=>{t(Um(e)),T(e,a)},N=[{label:(0,r.__)("Read","ablocks"),value:"read"},{label:(0,r.__)("Unread","ablocks"),value:"unread"},{label:(0,r.__)("Trash","ablocks"),value:"trash"}],E=[{name:(0,r.__)("Main","ablocks"),cell:e=>(0,S.jsx)("div",{children:e?.user_email?e?.user_email:"submission"})},{name:(0,r.__)("Submission Date","ablocks"),cell:e=>(0,S.jsxs)("div",{children:[(0,S.jsx)("span",{children:$m()(e.created_at).format("MMMM DD, YYYY")}),(0,S.jsx)("br",{}),(0,S.jsx)("span",{className:"ablocks-table-time",children:$m()(e.created_at).format("h:mm A")})]})},{name:(0,r.__)("Form","ablocks"),cell:e=>(0,S.jsx)("a",{ | |
| 878 | -target:"_blank",href:`${i.IV}/wp-admin/post.php?post=${e?.post_id}&action=edit`,rel:"noreferrer",children:e?.form_type})},{name:(0,r.__)("Status","ablocks"),cell:a=>{return(0,S.jsx)("div",{className:"status-cell",children:(0,S.jsx)(wu,{value:a?.status,options:{items:(n=a?.status,"trash"===n?N.map(e=>{const t="trash"===n&&"trash"!==e.value;return{...e,isDisabled:t}}):N.map(e=>({...e,isDisabled:!1})))},onChangeHandler:n=>{"read"===n?t(Pm({entryIds:[parseInt(a?.id)]})):"unread"===n?t(Hm({entryIds:[parseInt(a?.id)]})):"trash"===n&&(f(!0),t(Rm({entryId:parseInt(a?.id)})).then(()=>{t(Cm({status:x,page:e?.data?.current_page||1,per_page:e?.data?.per_page||10})).then(()=>{f(!1)})}))}})});var n}},{name:(0,r.__)("Page","ablocks"),cell:e=>(0,S.jsx)("a",{target:"_blank",href:i.IV+"/"+e?.post_id+"-2",rel:"noreferrer",children:(0,r.sprintf)( | |
| 868 | +0===n.length||!1===n?M("400px"):k.current.offsetHeight<100?M("100px"):M(`${k.current.offsetHeight}px`)},[n?.length,k,y]),(0,a.useEffect)(()=>{const e=Y.filter(e=>!0===e.visible);function t(){window.innerWidth<1280||e.length>6?P(!0):P(!1)}return window.addEventListener("resize",t),t(),()=>{window.removeEventListener("resize",t)}},[window.innerWidth,Y]),(0,a.useEffect)(()=>{N(Y?.filter(e=>e.visible)),M(!1)},[Y]),(0,a.useEffect)(()=>{const e=JSON.parse(localStorage.getItem(_));if(e){const t=Y.reduce((t,a)=>(e.forEach(e=>{e.id===a.id&&t.push({...e,cell:a.cell})}),t),[]),a=e.reduce((e,a)=>(t.forEach(t=>{a.id===t.id&&e.push({...t})}),e),[]);O(a),D(a)}},[]),(0,a.useEffect)(()=>{"function"==typeof o&&o(L&&L?.filter(e=>e.select))},[L]),(0,a.useEffect)(()=>{b&&L&&j(L&&L?.map(e=>({...e,select:!1})))},[b]);const R=d&&L?.length>0;return(0,S.jsx)("div",{className:`kzui-table ${_&&"kzui-table--"+_}`,children:(0,S.jsxs)("div",{className:"kzui-table__container",children:[i&&(0,S.jsx)(pm,{ | |
| 869 | +subHeaderComponent:l,setTempCopyColumns:O,tempCopyColumns:E,showColumnFilter:c,checkedChange:({id:e,visible:t})=>{let a;a="reset"===e?E.map(e=>({...e,visible:!0})):E.map(a=>a.id===e?{...a,visible:t}:a),O(a)},setCopyColumns:D,copyColumns:Y,suffix:_}),(0,S.jsxs)("div",{className:`kzui-table__table ${A&&"kzui-table--has-slider"}`,children:[(0,S.jsx)(fm,{data:n,visibleColumn:C,copyDataArr:L,selectAllRow:e=>j(t=>t.map(t=>({...t,select:e.target.checked}))),isCheckboxColumnVisible:H}),(0,S.jsx)(gm,{dataFetchingStatus:f,copyDataArr:L,visibleColumn:C,isCheckboxColumnVisible:H,selectRowChange:({row:e,select:t})=>{const a=L.map(a=>a.rowId===e.rowId?{...a,select:t}:a);j(a)},noDataText:h,loadingHeight:w,bodyRef:k})]}),R&&(0,S.jsx)(Ym,{data:n,totalItems:p,paginationPerPageChange:e=>{x(e),M(`${k.current.offsetHeight}px`),m(parseInt(e),parseInt(g))},rowsPerPage:y,onChangePage:u,currentPageNumber:g})]})})};Tm.propTypes=Dm | |
| 870 | +;const Cm=Tm,Nm=ut("ablocks/FetchSubmissions",({status:e="all",page:t=1,per_page:a=10,search:n=""},s)=>{const o="trash"===e?"yes":"no";return(0,i.In)({action:"ablocks/get_entries",status:e,current_page:t,per_page:a,search:n,is_in_trash:o}).then(e=>e?.data?.success?e.data.data:(s.dispatch(wt({message:(0,r.__)("Failed to fetch entries!","ablocks"),isShow:!0,type:"error"})),s.rejectWithValue(e.data.data||"Failed to fetch entries!")))}),Em=ut("ablocks/exportEntriesAsCSV",()=>(0,i.In)({action:"ablocks/get_entries",export_csv:1}).then(e=>e.data.data)),Om=ut("ablocks/fetchEntry",({id:e},t)=>(0,i.In)({action:"ablocks/get_entry",entry_id:e}).then(e=>e?.data?.success?e.data.data:(t.dispatch(wt({message:(0,r.__)("Failed to fetch entry!","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue(e.data.data||"Failed to fetch entry!")))),Am=ut("ablocks/editEntry",({id:e,updatedData:t},a)=>(0,i.In)({action:"ablocks/edit_entry",entry_id:parseInt(e),data:t}).then(e=>e.data.success?(a.dispatch(wt({ | |
| 871 | +message:(0,r.__)("Successfully updated entry!","ablocks"),isShow:!0,type:"success"})),e.data.data):(a.dispatch(wt({message:(0,r.__)("Failed to update entry!","ablocks"),isShow:!0,type:"error"})),a.rejectWithValue(e.data.data||"Failed to update entry!")))),Pm=ut("ablocks/deleteEntry",({entryIds:e},t)=>(0,i.In)({action:"ablocks/delete_entries","entry_id_array[0]":e[0]}).then(e=>e.data.success?(t.dispatch(wt({message:(0,r.__)("Successfully deleted entries!","ablocks"),isShow:!0,type:"success"})),e.data.data):(t.dispatch(wt({message:(0,r.__)("Failed to delete entries!","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue(e.data.data||"Failed to delete entries!")))),Hm=ut("ablocks/markEntriesAsRead",({entryIds:e},t)=>(0,i.In)({action:"ablocks/mark_entries_as_read",entry_id_array:e}).then(e=>e.data.success?(t.dispatch(wt({message:(0,r.__)("Successfully marked entries as read!","ablocks"),isShow:!0,type:"success"})),e.data.data):(t.dispatch(wt({message:(0, | |
| 872 | +r.__)("Failed to mark entries as read!","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue(e.data.data||"Failed to mark entries as read!")))),Rm=ut("ablocks/markEntriesAsUnread",({entryIds:e},t)=>(0,i.In)({action:"ablocks/mark_entries_as_unread",entry_id_array:e}).then(e=>e.data.success?(t.dispatch(wt({message:(0,r.__)("Successfully marked entries as unread!","ablocks"),isShow:!0,type:"success"})),e.data.data):(t.dispatch(wt({message:(0,r.__)("Failed to mark entries as unread!","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue(e.data.data||"Failed to mark entries as unread!")))),Im=ut("ablocks/sendEntriesToTrash",({entryId:e},t)=>(0,i.In)({action:"ablocks/send_entries_to_trash",entry_id:e}).then(e=>e.data.success?(t.dispatch(wt({message:(0,r.__)("Successfully sent entries to trash!","ablocks"),isShow:!0,type:"success"})),e.data.data):(t.dispatch(wt({message:(0,r.__)("Failed to send entries to trash!","ablocks"),isShow:!0,type:"error"})), | |
| 873 | +t.rejectWithValue(e.data.data||"Failed to send entries to trash!")))),Fm=ut("ablocks/restoreEntriesFromTrash",({entryId:e},t)=>(0,i.In)({action:"ablocks/restore_entries_from_trash",entry_id:e}).then(e=>e.data.success?(t.dispatch(wt({message:(0,r.__)("Successfully restored entries from trash!","ablocks"),isShow:!0,type:"success"})),e.data.data):(t.dispatch(wt({message:(0,r.__)("Failed to restore entries from trash!","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue(e.data.data||"Failed to restore entries from trash!")))),Wm=ut("ablocks/updateSettings",async({values:e,url:t="ablocks/save_settings"},a)=>{try{const n=await(0,i.In)({action:t,...e});return n.data.success?(a.dispatch(wt({message:(0,r.__)("Settings Saved!","ablocks"),isShow:!0,type:"success"})),e):(a.dispatch(wt({message:(0,r.__)("Failed to save settings.","ablocks"),isShow:!0,type:"error"})),a.rejectWithValue(n.data.data))}catch(e){return a.dispatch(wt({message:e?.response?.data?.message??e.message,isShow:!0,type:"error" | |
| 874 | +})),a.rejectWithValue(e.message)}}),zm=bt({name:"submissions",initialState:{loading:!1,data:[]},reducers:{updateCurrentPage:(e,t)=>{e.data={...e.data,current_page:t.payload}},updateItemPerPage:(e,t)=>{e.data={...e.data,per_page:t.payload}}},extraReducers:e=>{e.addCase(Nm.pending,e=>{e.loading=!0}).addCase(Nm.fulfilled,(e,t)=>{e.loading=!1,e.data=t.payload}).addCase(Nm.rejected,e=>{e.loading=!1}).addCase(Em.pending,e=>{e.loading=!0}).addCase(Em.fulfilled,(e,t)=>{e.loading=!1,e.csv_data=t.payload.csv_data}).addCase(Em.rejected,e=>{e.loading=!1}).addCase(Hm.pending,e=>{e.loading=!0}).addCase(Hm.fulfilled,(e,t)=>{e.loading=!1,e.data.data=e.data.data.map(e=>t.payload.id_of_updated_entries.includes(e.id)?{...e,status:"read"}:e)}).addCase(Hm.rejected,e=>{e.loading=!1}).addCase(Rm.pending,e=>{e.loading=!0}).addCase(Rm.fulfilled,(e,t)=>{e.loading=!1,e.data.data=e.data.data.map(e=>t?.payload?.id_of_updated_entries.includes(e.id)?{...e,status:"unread"}:e)}).addCase(Rm.rejected,e=>{e.loading=!1 | |
| 875 | +}).addCase(Im.pending,e=>{e.loading=!0}).addCase(Im.fulfilled,(e,t)=>{e.loading=!1,e.data.data=e.data.data.filter(e=>t?.payload?.data.id!==parseInt(e.id))}).addCase(Im.rejected,e=>{e.loading=!1}).addCase(Fm.pending,e=>{e.loading=!0}).addCase(Fm.fulfilled,(e,t)=>{e.loading=!1,e.data.data=e.data.data.map(e=>t?.payload?.data.id===parseInt(e.id)?{...e,status:t?.payload?.data.status}:e)}).addCase(Fm.rejected,e=>{e.loading=!1}).addCase(Pm.pending,e=>{e.loading=!0}).addCase(Pm.fulfilled,(e,t)=>{e.loading=!1,e.data.data=e.data.data.filter(e=>!t.payload.id_of_deleted_entries.includes(e.id))}).addCase(Pm.rejected,e=>{e.loading=!1}).addCase(Om.pending,e=>{e.loading=!0}).addCase(Om.fulfilled,(e,t)=>{e.loading=!1,e.data=t.payload}).addCase(Om.rejected,e=>{e.loading=!1}).addCase(Wm.pending,e=>{e.loading=!0}).addCase(Wm.fulfilled,(e,t)=>{e.loading=!1,e.data={...e.data,...t.payload}}).addCase(Wm.rejected,e=>{e.loading=!1})} | |
| 876 | +}),Um=zm.reducer,{updateCurrentPage:Bm,updateItemPerPage:Vm}=zm.actions,$m=window.moment;var qm=o.n($m);const Jm=[{label:(0,r.__)("All","ablocks"),value:"all"},{label:(0,r.__)("Read","ablocks"),value:"read"},{label:(0,r.__)("Unread","ablocks"),value:"unread"},{label:(0,r.__)("Trash","ablocks"),value:"trash"}],Gm=()=>{const e=j(e=>e.submissions),t=w(),[o,l]=(0,a.useState)([]),[c,d]=(0,a.useState)({}),[u,m]=(0,a.useState)(!1),[_,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),b=(0,s.Zp)(),g=function(){const{search:e}=(0,s.zy)();return n().useMemo(()=>new URLSearchParams(e),[e])}(),y=g.get("status"),k=g.get("perPage"),v=g.get("search"),[x,M]=(0,a.useState)(y||"all"),L=(e="",t="")=>{let a=`${i.Y3}admin.php?page=ablocks-submissions`;if(""!==e&&null!==e&&"null"!==e&&"all"!==e){const t="?"===a[a.length-1]&&a.split(a.length-1);a=`${a}${t?"":"&"}status=${e}`}if(""!==t&&null!==t&&"null"!==t){const e="?"===a[a.length-1]&&a.split(a.length-1);a=`${a}${e?"":"&"}search=${t}`}b(a)},Y=[..."trash"!==x?[{ | |
| 877 | +suffix:"trash",label:(0,r.__)("Trash","ablocks"),onClick:()=>d({value:"trash",message:(0,r.__)("Are you sure, you want to move these item to trash!","ablocks")})}]:[],..."trash"===x?[{suffix:"restore",label:(0,r.__)("Restore","ablocks"),onClick:()=>d({value:"restore",message:(0,r.__)("Are you sure, you want to restore these items?","ablocks")})},{suffix:"delete",label:(0,r.__)("Delete Permanently","ablocks"),onClick:()=>d({value:"delete",message:(0,r.__)("Are you sure, you want to delete these items?","ablocks")})}]:[]];(0,a.useEffect)(()=>{f(!0),t(Nm({status:x})).then(()=>{f(!1),0===e?.data?.data?.length&&e?.data?.current_page>1&&C(e.data.current_page-1)})},[x]),(0,a.useEffect)(()=>{L(y,v)},[y,v]);const D=()=>{l([]),d({}),h(!0),m(!1)};n().useMemo(()=>{u?(async a=>{f(!0),"trash"!==x&&"trash"===a?(await Promise.all(o.map(e=>t(Im({entryId:parseInt(e.id)})))),await t(Nm({status:x,page:e?.data?.current_page||1,per_page:e?.data?.per_page||10 | |
| 878 | +}))):"restore"===a?(await Promise.all(o.map(e=>t(Fm({entryId:parseInt(e.id)})))),await t(Nm({status:y}))):(await Promise.all(o.map(e=>t(Pm({entryIds:[parseInt(e.id)]})))),await t(Nm({status:x,page:e?.data?.current_page||1,per_page:e?.data?.per_page||10}))),f(!1),D()})(c.value):D()},[u]);const T=(e=1,a=10)=>{f(!0),t(Nm({status:x,page:e,per_page:a})).then(()=>{f(!1)})},C=(e,a=10)=>{t(Bm(e)),T(e,a)},N=[{label:(0,r.__)("Read","ablocks"),value:"read"},{label:(0,r.__)("Unread","ablocks"),value:"unread"},{label:(0,r.__)("Trash","ablocks"),value:"trash"}],E=[{name:(0,r.__)("Main","ablocks"),cell:e=>(0,S.jsx)("div",{children:e?.user_email?e?.user_email:"submission"})},{name:(0,r.__)("Submission Date","ablocks"),cell:e=>(0,S.jsxs)("div",{children:[(0,S.jsx)("span",{children:qm()(e.created_at).format("MMMM DD, YYYY")}),(0,S.jsx)("br",{}),(0,S.jsx)("span",{className:"ablocks-table-time",children:qm()(e.created_at).format("h:mm A")})]})},{name:(0,r.__)("Form","ablocks"),cell:e=>(0,S.jsx)("a",{ | |
| 879 | +target:"_blank",href:`${i.IV}/wp-admin/post.php?post=${e?.post_id}&action=edit`,rel:"noreferrer",children:e?.form_type})},{name:(0,r.__)("Status","ablocks"),cell:a=>{return(0,S.jsx)("div",{className:"status-cell",children:(0,S.jsx)(Mu,{value:a?.status,options:{items:(n=a?.status,"trash"===n?N.map(e=>{const t="trash"===n&&"trash"!==e.value;return{...e,isDisabled:t}}):N.map(e=>({...e,isDisabled:!1})))},onChangeHandler:n=>{"read"===n?t(Hm({entryIds:[parseInt(a?.id)]})):"unread"===n?t(Rm({entryIds:[parseInt(a?.id)]})):"trash"===n&&(f(!0),t(Im({entryId:parseInt(a?.id)})).then(()=>{t(Nm({status:x,page:e?.data?.current_page||1,per_page:e?.data?.per_page||10})).then(()=>{f(!1)})}))}})});var n}},{name:(0,r.__)("Page","ablocks"),cell:e=>(0,S.jsx)("a",{target:"_blank",href:i.IV+"/"+e?.post_id+"-2",rel:"noreferrer",children:(0,r.sprintf)( | |
| 879 | 880 | // translators: %s is the post ID. |
| 880 | 881 | // translators: %s is the post ID. |
| 881 | -(0,r.__)("aBlocks #%s","ablocks"),e?.post_id)})},{name:(0,r.__)("Action","ablocks"),cell:e=>(0,S.jsx)("div",{className:"ablocks-form-action",children:(0,S.jsxs)("a",{href:`${i.IV}${i.Y3}admin.php?page=ablocks-submissions&id=${e?.id}`,children:[(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--eye"}),(0,S.jsx)("span",{children:(0,r.__)("Details","ablocks")})]})})}],O=n().useMemo(()=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"kzui-table__sub-header-actions-left",children:(0,S.jsx)("div",{className:"kzui-table-sub-header-tabs",children:qm.map((a,n)=>(0,S.jsx)("span",{role:"presentation",className:`tab ${a?.value===x?"is-active":""} `,onClick:()=>{var n;M(a.value),n=a.value,f(!0),L(n),t(Cm({status:n,page:1,per_page:e?.per_page})).then(()=>{f(!1)})},children:a.label},n))})}),(0,S.jsxs)("div",{className:"kzui-list-table-sub-header-actions-right",children:[(0,S.jsx)(Ua,{placeholder:(0,r.__)("Search Form","ablocks"),onSearchHandler:e=>{f(!0),t(Cm({status:"all",page:1, | |
| 882 | -per_page:10,search:e})).then(()=>{f(!1),L(y,k)})},defaultValue:v}),(0,S.jsx)(Ja,{label:(0,r.__)("Export CSV","ablocks"),size:"sm",suffix:"export-csv",preset:"transparent",border:"gray",onClick:()=>{t(Nm()).then(e=>{if(e?.payload?.csv_data){const t=new Blob([e.payload.csv_data],{type:"text/csv"}),a=URL.createObjectURL(t),n=document.createElement("a");n.href=a,n.download="submission.csv",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(a)}})}})]})]}),[qm,x,v]),A=0!==e?.data?.data?.length||v?(0,r.__)("No matching results found. Please try a different search.","ablocks"):(0,r.__)("Please, create a form to see the available list here.","ablocks");return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsx)(Tm,{columns:E,data:e?.data?.data??[],showSubHeader:!0,noDataText:A,subHeaderComponent:O,isRowSelectable:!0,showColumnFilter:!0,getSelectRowValue:e=>{l(e),h(!1)},showPagination:!0,onChangePage:C,onChangeItemsPerPage:(e,a)=>{t(Bm(e)),T(a,e),L(y)}, | |
| 883 | -totalItems:parseInt(e?.data?.total_entries),totalRows:e?.data?.data?.length,dataFetchingStatus:p,resetSelected:_,rowsPerPage:e?.data?.per_page?e?.data?.per_page:k,suffix:"ablocks-submission"}),o.length>0&&(0,S.jsx)(ju,{actionButtons:Y,itemsLength:o?.length,confirmHandler:m,isActionSelected:c,resetHandler:D})]})},Gm=(e={})=>{const t=e?.meta?.reduce((e,t)=>(e[t?.meta_key]=t?.meta_value,e),{});return t},Km=e=>e?.meta?.map((e,t)=>(0,S.jsxs)("label",{className:"ablocks-page-content-input",children:[" ",(0,S.jsx)("span",{className:"ablocks-title",children:(0,r.sprintf)(""==e?.label?e?.meta_key:e?.label)}),"textarea"===e?.inputType&&(0,S.jsx)(ka,{name:e?.meta_key,component:"textarea",cols:50,className:"ablocks-input"}),"checkbox"===e?.inputType&&(Array.isArray(e?.meta_value)?e?.meta_value.map((t,a)=>(0,S.jsxs)("div",{className:"checkbox-radio-dirColumn",children:[(0,S.jsx)(ka,{name:e?.meta_key,type:e?.inputType,defaultChecked:t}),(0,S.jsx)("span",{children:t})] | |
| 882 | +(0,r.__)("aBlocks #%s","ablocks"),e?.post_id)})},{name:(0,r.__)("Action","ablocks"),cell:e=>(0,S.jsx)("div",{className:"ablocks-form-action",children:(0,S.jsxs)("a",{href:`${i.IV}${i.Y3}admin.php?page=ablocks-submissions&id=${e?.id}`,children:[(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--eye"}),(0,S.jsx)("span",{children:(0,r.__)("Details","ablocks")})]})})}],O=n().useMemo(()=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"kzui-table__sub-header-actions-left",children:(0,S.jsx)("div",{className:"kzui-table-sub-header-tabs",children:Jm.map((a,n)=>(0,S.jsx)("span",{role:"presentation",className:`tab ${a?.value===x?"is-active":""} `,onClick:()=>{var n;M(a.value),n=a.value,f(!0),L(n),t(Nm({status:n,page:1,per_page:e?.per_page})).then(()=>{f(!1)})},children:a.label},n))})}),(0,S.jsxs)("div",{className:"kzui-list-table-sub-header-actions-right",children:[(0,S.jsx)(Ua,{placeholder:(0,r.__)("Search Form","ablocks"),onSearchHandler:e=>{f(!0),t(Nm({status:"all",page:1, | |
| 883 | +per_page:10,search:e})).then(()=>{f(!1),L(y,k)})},defaultValue:v}),(0,S.jsx)(Ja,{label:(0,r.__)("Export CSV","ablocks"),size:"sm",suffix:"export-csv",preset:"transparent",border:"gray",onClick:()=>{t(Em()).then(e=>{if(e?.payload?.csv_data){const t=new Blob([e.payload.csv_data],{type:"text/csv"}),a=URL.createObjectURL(t),n=document.createElement("a");n.href=a,n.download="submission.csv",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(a)}})}})]})]}),[Jm,x,v]),A=0!==e?.data?.data?.length||v?(0,r.__)("No matching results found. Please try a different search.","ablocks"):(0,r.__)("Please, create a form to see the available list here.","ablocks");return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsx)(Cm,{columns:E,data:e?.data?.data??[],showSubHeader:!0,noDataText:A,subHeaderComponent:O,isRowSelectable:!0,showColumnFilter:!0,getSelectRowValue:e=>{l(e),h(!1)},showPagination:!0,onChangePage:C,onChangeItemsPerPage:(e,a)=>{t(Vm(e)),T(a,e),L(y)}, | |
| 884 | +totalItems:parseInt(e?.data?.total_entries),totalRows:e?.data?.data?.length,dataFetchingStatus:p,resetSelected:_,rowsPerPage:e?.data?.per_page?e?.data?.per_page:k,suffix:"ablocks-submission"}),o.length>0&&(0,S.jsx)(Su,{actionButtons:Y,itemsLength:o?.length,confirmHandler:m,isActionSelected:c,resetHandler:D})]})},Km=(e={})=>{const t=e?.meta?.reduce((e,t)=>(e[t?.meta_key]=t?.meta_value,e),{});return t},Xm=e=>e?.meta?.map((e,t)=>(0,S.jsxs)("label",{className:"ablocks-page-content-input",children:[" ",(0,S.jsx)("span",{className:"ablocks-title",children:(0,r.sprintf)(""==e?.label?e?.meta_key:e?.label)}),"textarea"===e?.inputType&&(0,S.jsx)(ka,{name:e?.meta_key,component:"textarea",cols:50,className:"ablocks-input"}),"checkbox"===e?.inputType&&(Array.isArray(e?.meta_value)?e?.meta_value.map((t,a)=>(0,S.jsxs)("div",{className:"checkbox-radio-dirColumn",children:[(0,S.jsx)(ka,{name:e?.meta_key,type:e?.inputType,defaultChecked:t}),(0,S.jsx)("span",{children:t})] | |
| 884 | 885 | },a)):(!0===e?.meta_value||!1===e?.meta_value)&&(0,S.jsxs)("div",{className:"checkbox-radio-dirColumn",children:[(0,S.jsx)(ka,{name:e?.meta_key,type:"checkbox",defaultChecked:e?.meta_value}),(0,S.jsx)("span",{children:1==e?.meta_value?(0,r.__)("ON","ablocks"):(0,r.__)("OFF","ablocks")})]})),"radio"===e?.inputType&&(Array.isArray(e?.meta_value)?e?.meta_value.map((e,t)=>(0,S.jsx)("div",{className:"checkbox-radio-dirColumn",children:(0,S.jsxs)("span",{children:["🟢 ",e]})})):null),"readable:file"===e?.inputType&&Array.isArray(e?.meta_value)&&(0,S.jsx)("div",{children:e.meta_value.map((e,t)=>(0,S.jsx)("div",{children:"file"===e.type&&(0,S.jsxs)("div",{className:"ablocks-page-content--input__title",children:[(0,S.jsxs)("span",{className:"ablocks-title",children:[(0,r.__)("File Type:","ablocks")," ",e.mime," "," 📄 "]}),(0,S.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:(0,r.__)("View File","ablocks")})]})},t)) |
| 885 | -}),!["textarea","checkbox","radio","readable:file"].includes(e?.inputType)&&(0,S.jsx)(ka,{name:e?.meta_key,type:e?.inputType,className:"ablocks-input"})]},t)),Xm=({submissionData:e})=>{const{dirty:t,handleSubmit:a}=ta();return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsxs)("div",{className:"ablocks-page-content ablocks-page-content--general",children:[(0,S.jsxs)("div",{className:"ablocks-page-content__entry-left",children:[(0,S.jsxs)("div",{className:"ablocks-page-content__entry-left__header",children:[(0,S.jsx)("span",{className:"ablocks-heading",children:(0,r.sprintf)( | |
| 886 | +}),!["textarea","checkbox","radio","readable:file"].includes(e?.inputType)&&(0,S.jsx)(ka,{name:e?.meta_key,type:e?.inputType,className:"ablocks-input"})]},t)),Zm=({submissionData:e})=>{const{dirty:t,handleSubmit:a}=ta();return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsxs)("div",{className:"ablocks-page-content ablocks-page-content--general",children:[(0,S.jsxs)("div",{className:"ablocks-page-content__entry-left",children:[(0,S.jsxs)("div",{className:"ablocks-page-content__entry-left__header",children:[(0,S.jsx)("span",{className:"ablocks-heading",children:(0,r.sprintf)( | |
| 886 | 887 | // translators: %s is submission id. |
| 887 | 888 | // translators: %s is submission id. |
| 888 | -(0,r.__)("Submission %s","ablocks"),e?.id)}),(0,S.jsx)(Ja,{label:(0,r.__)("Edit","ablocks"),size:"sm",isDisabled:!t,onClick:a})]}),(0,S.jsx)("div",{className:"ablocks-page-content__entry-left__content",children:Km(e)})]}),(0,S.jsxs)("div",{className:"ablocks-page-content__entry-right",children:[(0,S.jsx)("span",{className:"ablocks-heading",children:(0,r.__)("Additional Info","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-page-content__entry-right__content",children:[(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{children:(0,r.__)("Form:","ablocks")})," ",(0,S.jsx)("a",{href:`${i.IV}/wp-admin/post.php?post=${e?.id}&action=edit`,children:e?.form_type})]}),(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{children:(0,r.__)("Page:","ablocks")})," ",(0,S.jsx)("a",{target:"_blank",href:i.IV+"/"+e?.post_id+"-2",rel:"noreferrer",children:(0,r.sprintf)( | |
| 889 | +(0,r.__)("Submission %s","ablocks"),e?.id)}),(0,S.jsx)(Ja,{label:(0,r.__)("Edit","ablocks"),size:"sm",isDisabled:!t,onClick:a})]}),(0,S.jsx)("div",{className:"ablocks-page-content__entry-left__content",children:Xm(e)})]}),(0,S.jsxs)("div",{className:"ablocks-page-content__entry-right",children:[(0,S.jsx)("span",{className:"ablocks-heading",children:(0,r.__)("Additional Info","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-page-content__entry-right__content",children:[(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{children:(0,r.__)("Form:","ablocks")})," ",(0,S.jsx)("a",{href:`${i.IV}/wp-admin/post.php?post=${e?.id}&action=edit`,children:e?.form_type})]}),(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{children:(0,r.__)("Page:","ablocks")})," ",(0,S.jsx)("a",{target:"_blank",href:i.IV+"/"+e?.post_id+"-2",rel:"noreferrer",children:(0,r.sprintf)( | |
| 889 | 890 | // translators: %s is the post ID. |
| 890 | 891 | // translators: %s is the post ID. |
| 891 | -(0,r.__)("aBlocks #%s","ablocks"),e?.post_id)})]}),(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{children:(0,r.__)("Created Date:","ablocks")})," ",$m()(e?.created_at).format("MMMM DD, YYYY")+" "+$m()(e?.created_at).format("h:mm A")]}),(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{children:(0,r.__)("Updated Date:","ablocks")})," ",$m()(e?.updated_at).format("MMMM DD, YYYY")+" "+$m()(e?.updated_at).format("h:mm A")]}),(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{children:(0,r.__)("User Agent:","ablocks")})," ",(0,S.jsx)("span",{children:e?.user_agent})]})]}),(0,S.jsx)("div",{className:"ablocks-page-content__entry-right__footer"})]})]})]})},Zm=()=>{const[e,t]=(0,a.useState)({}),[r,o]=(0,a.useState)(!0),i=w(),l=function(){const{search:e}=(0,s.zy)();return n().useMemo(()=>new URLSearchParams(e),[e])}().get("id");return n().useEffect(()=>{i(Em({id:parseInt(l)})).then(e=>{t(e.payload),o(!1)})},[]),(0,S.jsx)(S.Fragment,{children:r?(0,S.jsx)(Va,{}):(0,S.jsx)(pa,{enableReinitialize:!0, | |
| 892 | -initialValues:Gm(e),onSubmit:(e,t)=>{i(Om({id:l,updatedData:e})).then(()=>{t.setSubmitting(!1)})},children:({})=>(0,S.jsx)(Xm,{submissionData:e})})})},Qm=({field:e,disabled:t,form:{touched:a,errors:n},...s})=>(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-control-switch",children:[(0,S.jsxs)("label",{className:"ablocks-switch",children:[(0,S.jsx)("input",{type:"checkbox",className:"form-control",...e,...s,checked:!t&&e.value,disabled:t}),(0,S.jsx)("span",{className:"ablocks-slider"})]}),(0,S.jsx)("span",{className:"switch-title"}),n[e.name]&&a[e.name]?(0,S.jsx)("span",{className:"ablocks-control-switch__error",children:n[e.name]}):null]})}),e_={type:Aa().string};function t_({children:e,type:t="info"}){return(0,S.jsx)(n().Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-tooltip",children:["info"===t&&(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--information"}),"pro"===t&&(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--lock-light"}),(0, | |
| 893 | -S.jsx)("span",{className:"ablocks-tooltip__text",children:e})]})})}t_.propTypes=e_;const a_=ut("ablocks/fetchAdminMenuItems",e=>{try{return(0,i.In)({action:"ablocks/get_admin_menu_items"}).then(e=>JSON.parse(e?.data?.data))}catch(t){e.dispatch(showNotification({message:t?.response?.data?.message??t?.message,isShow:!0,type:"error"}))}}),n_=bt({name:"menus",initialState:{data:i.MK?JSON.parse(i.MK):{}},extraReducers:e=>{e.addCase(a_.pending,e=>{e.loading=!0}).addCase(a_.fulfilled,(e,t)=>{e.loading=!1,e.data=t.payload}).addCase(a_.rejected,e=>{e.loading=!1})}}),s_=n_.reducer,r_=ut("ablocks/fetchAddons",e=>{try{return(0,i.In)({action:"ablocks/addons/get_all_addons"}).then(t=>t.data?.success?t.data?.data:(e.dispatch(wt({message:t.data?.data?.message??__("Some thing went wrong","ablocks"),isShow:!0,type:"error"})),t.data))}catch(t){e.dispatch(wt({message:t?.response?.data?.message??t?.message,isShow:!0,type:"error"}))}}),o_=ut("ablocks/saveAddon",({addon:e,status:t},a)=>{try{return(0,i.In)({ | |
| 894 | -action:"ablocks/addons/saved_addon_status",addon_name:e.label,addon_slug:e.name,status:t,required_plugin:e.required_plugin}).then(e=>(e.data?.success||a.dispatch(wt({message:e?.data.data,isShow:!0,type:"error"})),e.data))}catch(e){a.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"}))}}),i_=bt({name:"addons",initialState:{},extraReducers:e=>{e.addCase(r_.fulfilled,(e,t)=>t.payload).addCase(o_.fulfilled,(e,t)=>t.payload)}}),l_=i_.reducer,c_=({item:e,index:t,value:a,setFieldValue:o})=>{const l=w(),{values:c}=ta(),d=!i.zX&&e.is_pro;return(0,S.jsx)(n().Fragment,{children:(0,S.jsx)("div",{className:`ablocks-dashboard-addon-card ablocks-dashboard-addon-card--${t}`,disabled:d,children:(0,S.jsxs)("div",{className:"ablocks-dashboard-addon-card-top",children:[(0,S.jsx)("span",{className:"ablocks-dashboard-addon-card__icon",children:(0,S.jsx)("span",{className:`ablocks-icon ablocks-icon--${e.icon}`,"aria-hidden":!0})}),(0,S.jsx)("span",{ | |
| 895 | -className:"ablocks-dashboard-addon-card__heading",children:e.label}),(0,S.jsx)("span",{className:"ablocks-dashboard-addon-card__details",children:e.details}),d?(0,S.jsx)("span",{className:"ablocks-dashboard-addon-card__pro",children:(0,S.jsx)("span",{className:"ablocks-pro-badge",children:"PRO"})}):(0,S.jsx)(S.Fragment,{children:!d&&c[e.name]&&!1!==e.url&&(0,S.jsx)(s.N_,{to:e.url,children:(0,S.jsx)(sn,{icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--settings"}),className:"ablocks-btn-settings"})})}),(0,S.jsxs)("div",{className:"ablocks-dashboard-addon-card-bottom",children:[(0,S.jsx)("div",{className:"ablocks-dashboard-addon-card-bottom--left",children:(0,S.jsxs)("span",{children:[e.required_plugin?(0,r.__)("Required plugins","ablocks"):(0,r.__)("No extra plugin required","ablocks"),e.required_plugin.length>0&&(0,S.jsx)(t_,{children:e.required_plugin.map((e,t)=>(0,S.jsx)("span",{children:e.plugin_name},t))})]})}),!d&&(0,S.jsx)(ka,{type:"checkbox",name:`${e.name}`, | |
| 896 | -onChange:()=>{const t=!a;l(o_({addon:e,status:t})).then(({payload:{data:a,success:n}})=>{n?(o(e.name,t),l(r_()),l(a_()).then(()=>{const t=a[e.name]?(0,r.__)("Activated","ablocks"):(0,r.__)("Deactivate","ablocks");l(wt((0,r.sprintf)( | |
| 892 | +(0,r.__)("aBlocks #%s","ablocks"),e?.post_id)})]}),(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{children:(0,r.__)("Created Date:","ablocks")})," ",qm()(e?.created_at).format("MMMM DD, YYYY")+" "+qm()(e?.created_at).format("h:mm A")]}),(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{children:(0,r.__)("Updated Date:","ablocks")})," ",qm()(e?.updated_at).format("MMMM DD, YYYY")+" "+qm()(e?.updated_at).format("h:mm A")]}),(0,S.jsxs)("p",{children:[(0,S.jsx)("span",{children:(0,r.__)("User Agent:","ablocks")})," ",(0,S.jsx)("span",{children:e?.user_agent})]})]}),(0,S.jsx)("div",{className:"ablocks-page-content__entry-right__footer"})]})]})]})},Qm=()=>{const[e,t]=(0,a.useState)({}),[r,o]=(0,a.useState)(!0),i=w(),l=function(){const{search:e}=(0,s.zy)();return n().useMemo(()=>new URLSearchParams(e),[e])}().get("id");return n().useEffect(()=>{i(Om({id:parseInt(l)})).then(e=>{t(e.payload),o(!1)})},[]),(0,S.jsx)(S.Fragment,{children:r?(0,S.jsx)(Va,{}):(0,S.jsx)(pa,{enableReinitialize:!0, | |
| 893 | +initialValues:Km(e),onSubmit:(e,t)=>{i(Am({id:l,updatedData:e})).then(()=>{t.setSubmitting(!1)})},children:({})=>(0,S.jsx)(Zm,{submissionData:e})})})},e_=({field:e,disabled:t,form:{touched:a,errors:n},...s})=>(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-control-switch",children:[(0,S.jsxs)("label",{className:"ablocks-switch",children:[(0,S.jsx)("input",{type:"checkbox",className:"form-control",...e,...s,checked:!t&&e.value,disabled:t}),(0,S.jsx)("span",{className:"ablocks-slider"})]}),(0,S.jsx)("span",{className:"switch-title"}),n[e.name]&&a[e.name]?(0,S.jsx)("span",{className:"ablocks-control-switch__error",children:n[e.name]}):null]})}),t_={type:Aa().string};function a_({children:e,type:t="info"}){return(0,S.jsx)(n().Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-tooltip",children:["info"===t&&(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--information"}),"pro"===t&&(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--lock-light"}),(0, | |
| 894 | +S.jsx)("span",{className:"ablocks-tooltip__text",children:e})]})})}a_.propTypes=t_;const n_=ut("ablocks/fetchAdminMenuItems",e=>{try{return(0,i.In)({action:"ablocks/get_admin_menu_items"}).then(e=>JSON.parse(e?.data?.data))}catch(t){e.dispatch(showNotification({message:t?.response?.data?.message??t?.message,isShow:!0,type:"error"}))}}),s_=bt({name:"menus",initialState:{data:i.MK?JSON.parse(i.MK):{}},extraReducers:e=>{e.addCase(n_.pending,e=>{e.loading=!0}).addCase(n_.fulfilled,(e,t)=>{e.loading=!1,e.data=t.payload}).addCase(n_.rejected,e=>{e.loading=!1})}}),r_=s_.reducer,o_=ut("ablocks/fetchAddons",e=>{try{return(0,i.In)({action:"ablocks/addons/get_all_addons"}).then(t=>t.data?.success?t.data?.data:(e.dispatch(wt({message:t.data?.data?.message??__("Some thing went wrong","ablocks"),isShow:!0,type:"error"})),t.data))}catch(t){e.dispatch(wt({message:t?.response?.data?.message??t?.message,isShow:!0,type:"error"}))}}),i_=ut("ablocks/saveAddon",({addon:e,status:t},a)=>{try{return(0,i.In)({ | |
| 895 | +action:"ablocks/addons/saved_addon_status",addon_name:e.label,addon_slug:e.name,status:t,required_plugin:e.required_plugin}).then(e=>(e.data?.success||a.dispatch(wt({message:e?.data.data,isShow:!0,type:"error"})),e.data))}catch(e){a.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"}))}}),l_=bt({name:"addons",initialState:{},extraReducers:e=>{e.addCase(o_.fulfilled,(e,t)=>t.payload).addCase(i_.fulfilled,(e,t)=>t.payload)}}),c_=l_.reducer,d_=({item:e,index:t,value:a,setFieldValue:o})=>{const l=w(),{values:c}=ta(),d=!i.zX&&e.is_pro;return(0,S.jsx)(n().Fragment,{children:(0,S.jsx)("div",{className:`ablocks-dashboard-addon-card ablocks-dashboard-addon-card--${t}`,disabled:d,children:(0,S.jsxs)("div",{className:"ablocks-dashboard-addon-card-top",children:[(0,S.jsx)("span",{className:"ablocks-dashboard-addon-card__icon",children:(0,S.jsx)("span",{className:`ablocks-icon ablocks-icon--${e.icon}`,"aria-hidden":!0})}),(0,S.jsx)("span",{ | |
| 896 | +className:"ablocks-dashboard-addon-card__heading",children:e.label}),(0,S.jsx)("span",{className:"ablocks-dashboard-addon-card__details",children:e.details}),d?(0,S.jsx)("span",{className:"ablocks-dashboard-addon-card__pro",children:(0,S.jsx)("span",{className:"ablocks-pro-badge",children:"PRO"})}):(0,S.jsx)(S.Fragment,{children:!d&&c[e.name]&&!1!==e.url&&(0,S.jsx)(s.N_,{to:e.url,children:(0,S.jsx)(sn,{icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--settings"}),className:"ablocks-btn-settings"})})}),(0,S.jsxs)("div",{className:"ablocks-dashboard-addon-card-bottom",children:[(0,S.jsx)("div",{className:"ablocks-dashboard-addon-card-bottom--left",children:(0,S.jsxs)("span",{children:[e.required_plugin?(0,r.__)("Required plugins","ablocks"):(0,r.__)("No extra plugin required","ablocks"),e.required_plugin.length>0&&(0,S.jsx)(a_,{children:e.required_plugin.map((e,t)=>(0,S.jsx)("span",{children:e.plugin_name},t))})]})}),!d&&(0,S.jsx)(ka,{type:"checkbox",name:`${e.name}`, | |
| 897 | +onChange:()=>{const t=!a;l(i_({addon:e,status:t})).then(({payload:{data:a,success:n}})=>{n?(o(e.name,t),l(o_()),l(n_()).then(()=>{const t=a[e.name]?(0,r.__)("Activated","ablocks"):(0,r.__)("Deactivate","ablocks");l(wt((0,r.sprintf)( | |
| 897 | 898 | // translators: %1$s: AddonName, %2$s: AddonStatus |
| 898 | 899 | // translators: %1$s: AddonName, %2$s: AddonStatus |
| 899 | -(0,r.__)("%1$s successfully %2$s","ablocks"),e.label,t),!0,"success"))}),l(kn())):(o(e.name,!1),l(wt(response.data?.data,!0,"error")))})},component:Qm})]})]})},t)})},d_=[{label:(0,r.__)("Theme Builder","ablocks"),name:"theme-builder",is_pro:!1,details:(0,r.__)("Design and customize your entire WordPress theme visually with full layout control and flexibility.","ablocks"),required_plugin:!1,icon:"theme-builder",url:!1,docsUrl:""},{label:(0,r.__)("Cookie Consent","ablocks"),name:"cookie-consent",is_pro:!1,details:(0,r.__)("Ask before third-party scripts run. Blocks trackers until consent is given, records the decision, and speaks Google Consent Mode v2.","ablocks"),required_plugin:!1,icon:"checks",url:!1,docsUrl:""},{label:(0,r.__)("Link Guard","ablocks"),name:"link-guard",is_pro:!1,details:(0,r.__)("Hides links to posts that are not live yet — scheduled, draft, private or deleted — and shows them again the moment the post is published.","ablocks"),required_plugin:!1,icon:"unlink", | |
| 900 | -url:!1,docsUrl:""}],u_=[{slug:"all",title:(0,r.__)("All","ablocks")},{slug:"active",title:(0,r.__)("Active","ablocks")},{slug:"inactive",title:(0,r.__)("Inactive","ablocks")}],m_=()=>{const e=j(e=>e.addons),[t,n]=(0,a.useState)(""),[s,o]=(0,a.useState)("all"),i=w();return(0,a.useEffect)(()=>{i(r_())},[]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsxs)("div",{className:"ablocks-page-content ablocks-page-content--addons",children:[(0,S.jsxs)("div",{className:"ablocks-addons-wrap",children:[(0,S.jsx)("div",{className:"ablocks-addons-filter-options",children:u_.map((e,t)=>(0,S.jsx)("button",{className:"ablocks-addons-filter-option "+(s===e.slug?"active-filter":""),onClick:()=>o(e.slug),children:(0,S.jsx)("span",{children:e.title})},t))}),(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(Ua,{placeholder:(0,r.__)("Search Add-ons","ablocks"),onSearchHandler:e=>n(e.trim())})})]}),(0,S.jsx)("div",{className:"ablocks-addons",children:(0,S.jsx)(pa,{enableReinitialize:!0,initialValues:{ | |
| 901 | -"theme-builder":!1,"cookie-consent":!1,"link-guard":!1,...e},children:({setFieldValue:e,values:a})=>{const n=(e=>d_.filter(a=>{if(a.label.toLowerCase().includes(t.toLowerCase())){if("all"===s)return a;if("active"===s&&e[a.name])return a;if("inactive"===s&&!e[a.name])return a;if("pro"===s&&a.is_pro)return a;if("free"===s&&!a.is_pro)return a}return!1}))(a);return(0,S.jsx)("form",{children:(0,S.jsx)("div",{className:"ablocks-dashboard-addon-cards",children:n.length?n.map((t,n)=>(0,S.jsx)(c_,{item:t,index:n,value:a[t.name],setFieldValue:e},n)):(0,S.jsx)("div",{className:"ablocks-dashboard-addon-cards-message",children:(0,S.jsx)(fm,{title:(0,r.__)("No Addons Found!","ablocks")})})})})}})})]})]})},h_=m_;m_.propTypes={};const p_=ut("ablocks/fetchAllTB",({status:e="all",page:t=1,per_page:a=10,search:n=""},s)=>{try{let o={status:"all"===e?"any":e,page:t,per_page:a};return n&&(o={...o,search:n}),i.nC.get(i.MF+"ablocks_tb",{params:o}).then(o=>200===o.status?{data:o.data, | |
| 902 | -totalItems:parseInt(o.headers["x-wp-total"]),status:e,page:t,per_page:a,search:n}:s.rejectWithValue({message:o.data.message||(0,r.__)("Failed to fetch TB","ablocks")}))}catch(e){return s.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"})),s.rejectWithValue({message:e?.response?.data?.message??e?.message})}}),f_=ut("ablocks/fetchTB",(e,t)=>{try{return i.nC.post(`${i.MF}ablocks_tb/${parseInt(e)}`).then(e=>e.data)}catch(e){t.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"}))}}),b_=ut("ablocks/createNewTB",(e,t)=>{try{return i.nC.post(i.MF+"ablocks_tb",e).then(e=>201===e.status?(t.dispatch(wt({message:(0,r.__)("Successfully created.","ablocks"),isShow:!0,type:"success"})),e.data):(t.dispatch(wt({message:(0,r.__)("Failed to create.","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0,r.__)("Failed to create.","ablocks"),success:!1})))}catch(e){return t.dispatch(wt({ | |
| 903 | -message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:e?.response?.data?.message??e?.message})}}),g_=ut("ablocks/updateTB",(e,t)=>{try{return i.nC.post(`${i.MF}ablocks_tb/${parseInt(e.id)}`,{...e}).then(e=>200===e.status?(t.dispatch(wt({message:(0,r.__)("Successfully updated.","ablocks"),isShow:!0,type:"success"})),e.data):(t.dispatch(wt({message:(0,r.__)("Failed to Update.","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0,r.__)("Failed to Update.","ablocks"),success:!1})))}catch(e){return t.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:e?.response?.data?.message??e?.message})}}),y_=ut("ablocks/statusUpdateTB",(e,t)=>{try{return i.nC.post(`${i.MF}ablocks_tb/${parseInt(e.id)}`,e).then(e=>200===e.status?(t.dispatch(wt({message:(0,r.__)("Successfully Status updated.","ablocks"),isShow:!0,type:"success"})),e.data):(t.dispatch(wt({message:(0, | |
| 904 | -r.__)("Failed to Update.","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0,r.__)("Failed to Update.","ablocks"),success:!1})))}catch(e){return t.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:e?.response?.data?.message??e?.message})}}),k_=ut("ablocks/deleteTB",(e,t)=>{try{return i.nC.post(`${i.MF}ablocks_tb/${parseInt(e.id)}`,{force:!0},{headers:{"X-HTTP-Method-Override":"DELETE"}}).then(e=>200===e.status?(t.dispatch(wt({message:(0,r.__)("Deleted!","ablocks"),isShow:!0,type:"success"})),e.data.previous):(t.dispatch(wt({message:(0,r.__)("Failed to delete.","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0,r.__)("Failed to delete.","ablocks"),success:!1})))}catch(e){return t.dispatch(wt({message:error?.response?.data?.message??error?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:error?.response?.data?.message??error?.message})}}),v_=ut("ablocks/moveTBToTrash",async(e,t)=>{ | |
| 905 | -try{const a=await i.nC.post(`${i.MF}ablocks_tb/${parseInt(e)}`,{force:!1},{headers:{"X-HTTP-Method-Override":"DELETE"}});return 200===a.status?(t.dispatch(wt({message:(0,r.__)("Moved to trash!","ablocks"),isShow:!0,type:"success"})),a.data):(t.dispatch(wt({message:(0,r.__)("Failed to trashed.","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0,r.__)("Failed to trashed.","ablocks"),success:!1}))}catch(e){return t.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:e?.response?.data?.message??e?.message})}}),x_=ut("ablocks/restoreTB",(e,t)=>{const a={...e,status:"draft"};try{return i.nC.post(`${i.MF}ablocks_tb/${parseInt(e.id)}`,a).then(e=>200===e.status?(t.dispatch(wt({message:(0,r.__)("Them Restored Successfully!","ablocks"),isShow:!0,type:"success"})),e.data):(t.dispatch(wt({message:(0,r.__)("Failed to restore theme","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0, | |
| 906 | -r.__)("Failed to restore theme.","ablocks"),success:!1})))}catch(e){return t.dispatch(wt({message:error?.response?.data?.message??error?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:error?.response?.data?.message??error?.message})}}),w_=bt({name:"themeBuilder",initialState:{data:[],rowsPerPage:10,status:"all",page:1,search:""},reducers:{updateTBCurrentPage:(e,t)=>{e.page=t.payload},updateTBItemPerPage:(e,t)=>{e.per_page=t.payload}},extraReducers:e=>{e.addCase(p_.fulfilled,(e,t)=>{const a=t.payload;e.data=a.data,e.totalItems=a.totalItems,e.per_page=a.per_page,e.status=a.status,e.page=a.page,e.search=a.search}).addCase(f_.fulfilled,(e,t)=>{const a=e.data.findIndex(e=>parseInt(e.id)===parseInt(t.payload.id));-1!==a?e.data[a]=t.payload:e.data.length?e.data=[...e.data,t.payload]:e.data=[t.payload]}).addCase(b_.fulfilled,(e,t)=>{e.data.length?e.data=[...e.data,t.payload]:e.data=[t.payload]}).addCase(g_.fulfilled,(e,t)=>{ | |
| 907 | -e.data=e.data.map(e=>parseInt(e.id)===parseInt(t.payload.id)?{...e,...t.payload}:e)}).addCase(k_.fulfilled,(e,t)=>{e.data=e.data.filter(e=>parseInt(e.id)!==parseInt(t.payload?.id))}).addCase(v_.fulfilled,(e,t)=>{e.data=e.data.filter(e=>parseInt(e.id)!==parseInt(t.payload?.id))}).addCase(y_.fulfilled,(e,t)=>{e.loading=!1,e.data=e.data.map(e=>parseInt(e.id)===parseInt(t.payload.id)?{...e,...t.payload}:e)}).addCase(x_.fulfilled,(e,t)=>{e.loading=!1,e.data=e.data.map(e=>parseInt(e.id)===parseInt(t.payload.id)?{...e,...t.payload}:e)})}}),{updateTBCurrentPage:M_,updateTBItemPerPage:L_}=w_.actions,j_=w_.reducer;function S_({heading:e,children:t}){return(0,S.jsx)(n().Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-sub-top-header",children:[(0,S.jsx)("div",{className:"ablocks-sub-top-header__title",children:e}),(0,S.jsx)("div",{className:"ablocks-sub-top-header__content",children:t})]})})}S_.propTypes={};const Y_={icon:Aa().string,suffix:Aa().string,options:Aa().array},D_=e=>{ | |
| 900 | +(0,r.__)("%1$s successfully %2$s","ablocks"),e.label,t),!0,"success"))}),l(kn())):(o(e.name,!1),l(wt(response.data?.data,!0,"error")))})},component:e_})]})]})},t)})},u_=[{label:(0,r.__)("Theme Builder","ablocks"),name:"theme-builder",is_pro:!1,details:(0,r.__)("Design and customize your entire WordPress theme visually with full layout control and flexibility.","ablocks"),required_plugin:!1,icon:"theme-builder",url:!1,docsUrl:""},{label:(0,r.__)("Cookie Consent","ablocks"),name:"cookie-consent",is_pro:!1,details:(0,r.__)("Ask before third-party scripts run. Blocks trackers until consent is given, records the decision, and speaks Google Consent Mode v2.","ablocks"),required_plugin:!1,icon:"checks",url:!1,docsUrl:""},{label:(0,r.__)("Link Guard","ablocks"),name:"link-guard",is_pro:!1,details:(0,r.__)("Hides links to posts that are not live yet — scheduled, draft, private or deleted — and shows them again the moment the post is published.","ablocks"),required_plugin:!1,icon:"unlink", | |
| 901 | +url:!1,docsUrl:""}],m_=[{slug:"all",title:(0,r.__)("All","ablocks")},{slug:"active",title:(0,r.__)("Active","ablocks")},{slug:"inactive",title:(0,r.__)("Inactive","ablocks")}],h_=()=>{const e=j(e=>e.addons),[t,n]=(0,a.useState)(""),[s,o]=(0,a.useState)("all"),i=w();return(0,a.useEffect)(()=>{i(o_())},[]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsxs)("div",{className:"ablocks-page-content ablocks-page-content--addons",children:[(0,S.jsxs)("div",{className:"ablocks-addons-wrap",children:[(0,S.jsx)("div",{className:"ablocks-addons-filter-options",children:m_.map((e,t)=>(0,S.jsx)("button",{className:"ablocks-addons-filter-option "+(s===e.slug?"active-filter":""),onClick:()=>o(e.slug),children:(0,S.jsx)("span",{children:e.title})},t))}),(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(Ua,{placeholder:(0,r.__)("Search Add-ons","ablocks"),onSearchHandler:e=>n(e.trim())})})]}),(0,S.jsx)("div",{className:"ablocks-addons",children:(0,S.jsx)(pa,{enableReinitialize:!0,initialValues:{ | |
| 902 | +"theme-builder":!1,"cookie-consent":!1,"link-guard":!1,...e},children:({setFieldValue:e,values:a})=>{const n=(e=>u_.filter(a=>{if(a.label.toLowerCase().includes(t.toLowerCase())){if("all"===s)return a;if("active"===s&&e[a.name])return a;if("inactive"===s&&!e[a.name])return a;if("pro"===s&&a.is_pro)return a;if("free"===s&&!a.is_pro)return a}return!1}))(a);return(0,S.jsx)("form",{children:(0,S.jsx)("div",{className:"ablocks-dashboard-addon-cards",children:n.length?n.map((t,n)=>(0,S.jsx)(d_,{item:t,index:n,value:a[t.name],setFieldValue:e},n)):(0,S.jsx)("div",{className:"ablocks-dashboard-addon-cards-message",children:(0,S.jsx)(bm,{title:(0,r.__)("No Addons Found!","ablocks")})})})})}})})]})]})},p_=h_;h_.propTypes={};const f_=ut("ablocks/fetchAllTB",({status:e="all",page:t=1,per_page:a=10,search:n=""},s)=>{try{let o={status:"all"===e?"any":e,page:t,per_page:a};return n&&(o={...o,search:n}),i.nC.get(i.MF+"ablocks_tb",{params:o}).then(o=>200===o.status?{data:o.data, | |
| 903 | +totalItems:parseInt(o.headers["x-wp-total"]),status:e,page:t,per_page:a,search:n}:s.rejectWithValue({message:o.data.message||(0,r.__)("Failed to fetch TB","ablocks")}))}catch(e){return s.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"})),s.rejectWithValue({message:e?.response?.data?.message??e?.message})}}),b_=ut("ablocks/fetchTB",(e,t)=>{try{return i.nC.post(`${i.MF}ablocks_tb/${parseInt(e)}`).then(e=>e.data)}catch(e){t.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"}))}}),g_=ut("ablocks/createNewTB",(e,t)=>{try{return i.nC.post(i.MF+"ablocks_tb",e).then(e=>201===e.status?(t.dispatch(wt({message:(0,r.__)("Successfully created.","ablocks"),isShow:!0,type:"success"})),e.data):(t.dispatch(wt({message:(0,r.__)("Failed to create.","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0,r.__)("Failed to create.","ablocks"),success:!1})))}catch(e){return t.dispatch(wt({ | |
| 904 | +message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:e?.response?.data?.message??e?.message})}}),y_=ut("ablocks/updateTB",(e,t)=>{try{return i.nC.post(`${i.MF}ablocks_tb/${parseInt(e.id)}`,{...e}).then(e=>200===e.status?(t.dispatch(wt({message:(0,r.__)("Successfully updated.","ablocks"),isShow:!0,type:"success"})),e.data):(t.dispatch(wt({message:(0,r.__)("Failed to Update.","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0,r.__)("Failed to Update.","ablocks"),success:!1})))}catch(e){return t.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:e?.response?.data?.message??e?.message})}}),k_=ut("ablocks/statusUpdateTB",(e,t)=>{try{return i.nC.post(`${i.MF}ablocks_tb/${parseInt(e.id)}`,e).then(e=>200===e.status?(t.dispatch(wt({message:(0,r.__)("Successfully Status updated.","ablocks"),isShow:!0,type:"success"})),e.data):(t.dispatch(wt({message:(0, | |
| 905 | +r.__)("Failed to Update.","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0,r.__)("Failed to Update.","ablocks"),success:!1})))}catch(e){return t.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:e?.response?.data?.message??e?.message})}}),v_=ut("ablocks/deleteTB",(e,t)=>{try{return i.nC.post(`${i.MF}ablocks_tb/${parseInt(e.id)}`,{force:!0},{headers:{"X-HTTP-Method-Override":"DELETE"}}).then(e=>200===e.status?(t.dispatch(wt({message:(0,r.__)("Deleted!","ablocks"),isShow:!0,type:"success"})),e.data.previous):(t.dispatch(wt({message:(0,r.__)("Failed to delete.","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0,r.__)("Failed to delete.","ablocks"),success:!1})))}catch(e){return t.dispatch(wt({message:error?.response?.data?.message??error?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:error?.response?.data?.message??error?.message})}}),x_=ut("ablocks/moveTBToTrash",async(e,t)=>{ | |
| 906 | +try{const a=await i.nC.post(`${i.MF}ablocks_tb/${parseInt(e)}`,{force:!1},{headers:{"X-HTTP-Method-Override":"DELETE"}});return 200===a.status?(t.dispatch(wt({message:(0,r.__)("Moved to trash!","ablocks"),isShow:!0,type:"success"})),a.data):(t.dispatch(wt({message:(0,r.__)("Failed to trashed.","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0,r.__)("Failed to trashed.","ablocks"),success:!1}))}catch(e){return t.dispatch(wt({message:e?.response?.data?.message??e?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:e?.response?.data?.message??e?.message})}}),w_=ut("ablocks/restoreTB",(e,t)=>{const a={...e,status:"draft"};try{return i.nC.post(`${i.MF}ablocks_tb/${parseInt(e.id)}`,a).then(e=>200===e.status?(t.dispatch(wt({message:(0,r.__)("Them Restored Successfully!","ablocks"),isShow:!0,type:"success"})),e.data):(t.dispatch(wt({message:(0,r.__)("Failed to restore theme","ablocks"),isShow:!0,type:"error"})),t.rejectWithValue({message:(0, | |
| 907 | +r.__)("Failed to restore theme.","ablocks"),success:!1})))}catch(e){return t.dispatch(wt({message:error?.response?.data?.message??error?.message,isShow:!0,type:"error"})),t.rejectWithValue({message:error?.response?.data?.message??error?.message})}}),M_=bt({name:"themeBuilder",initialState:{data:[],rowsPerPage:10,status:"all",page:1,search:""},reducers:{updateTBCurrentPage:(e,t)=>{e.page=t.payload},updateTBItemPerPage:(e,t)=>{e.per_page=t.payload}},extraReducers:e=>{e.addCase(f_.fulfilled,(e,t)=>{const a=t.payload;e.data=a.data,e.totalItems=a.totalItems,e.per_page=a.per_page,e.status=a.status,e.page=a.page,e.search=a.search}).addCase(b_.fulfilled,(e,t)=>{const a=e.data.findIndex(e=>parseInt(e.id)===parseInt(t.payload.id));-1!==a?e.data[a]=t.payload:e.data.length?e.data=[...e.data,t.payload]:e.data=[t.payload]}).addCase(g_.fulfilled,(e,t)=>{e.data.length?e.data=[...e.data,t.payload]:e.data=[t.payload]}).addCase(y_.fulfilled,(e,t)=>{ | |
| 908 | +e.data=e.data.map(e=>parseInt(e.id)===parseInt(t.payload.id)?{...e,...t.payload}:e)}).addCase(v_.fulfilled,(e,t)=>{e.data=e.data.filter(e=>parseInt(e.id)!==parseInt(t.payload?.id))}).addCase(x_.fulfilled,(e,t)=>{e.data=e.data.filter(e=>parseInt(e.id)!==parseInt(t.payload?.id))}).addCase(k_.fulfilled,(e,t)=>{e.loading=!1,e.data=e.data.map(e=>parseInt(e.id)===parseInt(t.payload.id)?{...e,...t.payload}:e)}).addCase(w_.fulfilled,(e,t)=>{e.loading=!1,e.data=e.data.map(e=>parseInt(e.id)===parseInt(t.payload.id)?{...e,...t.payload}:e)})}}),{updateTBCurrentPage:L_,updateTBItemPerPage:j_}=M_.actions,S_=M_.reducer;function Y_({heading:e,children:t}){return(0,S.jsx)(n().Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-sub-top-header",children:[(0,S.jsx)("div",{className:"ablocks-sub-top-header__title",children:e}),(0,S.jsx)("div",{className:"ablocks-sub-top-header__content",children:t})]})})}Y_.propTypes={};const D_={icon:Aa().string,suffix:Aa().string,options:Aa().array},T_=e=>{ | |
| 908 | 909 | const{icon:t="vertical-menu",options:s=[],iconClass:r,suffix:o=""}=e,[i,l]=(0,a.useState)(!1),c=(0,a.useRef)(null),d=(0,a.useRef)(null),u=e=>{!c?.current||c?.current?.contains(e.target)||d.current.contains(e.target)||l(!1)};return(0,a.useEffect)(()=>(document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)),[]),(0,a.useEffect)(()=>{if(i&&d.current){const e=d.current.getBoundingClientRect(),t=e.left+window.pageXOffset,a=e.top+window.pageYOffset,n=d.current.offsetHeight;c.current.style.position="absolute",c.current.style.left=t-155+"px",c.current.style.top=`${a+n+10}px`,document.body.appendChild(c.current)}else d.current&&d.current.parentNode===document.body&&document.body.removeChild(c.current)},[i,d]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("button",{className:`ablocks-dropdown-menu ${o&&`ablocks-dropdown-menu--${o}`}`,type:"button",ref:d,onClick:()=>{l(!i)},children:r||(0,S.jsx)("span",{className:`ablocks-icon ablocks-icon--${t}`})}),i&&(0, |
| 909 | -jr.createPortal)((0,S.jsx)("div",{className:`ablocks-dropdown-menu__lists ${o&&`ablocks-dropdown-menu--list-${o}`}`,ref:c,children:(0,S.jsx)("ul",{className:"ablocks-more-options",children:s.map((e,t)=>(0,S.jsx)(n().Fragment,{children:e.action?(0,S.jsxs)("form",{className:"ablocks-more-options__item",action:e.action,method:e.method,children:[(0,S.jsx)(sn,{preset:"transparent",iconPosition:"left",...e}),e.hasBorder&&(0,S.jsx)("hr",{className:"ablocks-option-separator"})]},t):(0,S.jsxs)("li",{className:"ablocks-more-options__item",children:[(0,S.jsx)(sn,{preset:"transparent",iconPosition:"left",...e,onClick:()=>(l(!1),"button"===e.type?e?.onClick():null)}),e.hasBorder&&(0,S.jsx)("hr",{className:"ablocks-option-separator"})]},t)},t))})}),document.body)]})};D_.propTypes=Y_;const T_=D_,C_=[{label:(0,r.__)("All","ablocks"),value:"all"},{label:(0,r.__)("Publish","ablocks"),value:"publish"},{label:(0,r.__)("Draft","ablocks"),value:"draft"},{label:(0,r.__)("Trash","ablocks"),value:"trash" | |
| 910 | -}],N_=()=>{const e=j(e=>e.themeBuilder),t=w(),[o,l]=(0,a.useState)([]),[c,d]=(0,a.useState)({}),[u,m]=(0,a.useState)(!1),[_,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),b=(0,s.Zp)(),g=function(){const{search:e}=(0,s.zy)();return n().useMemo(()=>new URLSearchParams(e),[e])}(),y=g.get("status"),k=g.get("themePerPage"),v=g.get("search"),[x,M]=(0,a.useState)(y||"all"),L=(e="",t="")=>{let a=`${i.Y3}admin.php?page=ablocks-theme-builder`;if(""!==e&&null!==e&&"null"!==e&&"all"!==e){const t="?"===a[a.length-1]&&a.split(a.length-1);a=`${a}${t?"":"&"}status=${e}`}if(""!==t&&null!==t&&"null"!==t){const e="?"===a[a.length-1]&&a.split(a.length-1);a=`${a}${e?"":"&"}search=${t}`}b(a)},Y=[..."trash"!==x?[{suffix:"trash",label:(0,r.__)("Trash","ablocks"),onClick:()=>d({value:"trash",message:(0,r.__)("Are you sure, you want to move these item to trash!","ablocks")})}]:[],..."trash"===x?[{suffix:"restore",label:(0,r.__)("Restore","ablocks"),onClick:()=>d({value:"restore",message:(0, | |
| 911 | -r.__)("Are you sure, you want to restore these items?","ablocks")})},{suffix:"delete",label:(0,r.__)("Delete Permanently","ablocks"),onClick:()=>d({value:"delete",message:(0,r.__)("Are you sure, you want to delete these items?","ablocks")})}]:[]];(0,a.useEffect)(()=>{(!e?.data||e?.data&&e?.data.length<=1)&&(null!==k&&t(k),f(!0),t(p_({status:x})).then(()=>{f(!1)}))},[]),(0,a.useEffect)(()=>{L(y,v)},[y,v]);const D=()=>{l([]),d({}),h(!0),m(!1)};n().useMemo(()=>{u?(async e=>{if("trash"!==x&&"trash"===e){for(const e of o)await t(v_(e?.id));D()}else"restore"===e?(o.forEach(e=>{t(x_(e))}),D()):o.forEach(e=>{t(k_(e)),D()})})(c.value):D()},[u]);const T=(e=1,a=10)=>{f(!0),t(p_({status:x,page:e,per_page:a})).then(()=>{f(!1)})},C=[{label:(0,r.__)("Publish","ablocks"),value:"publish"},{label:(0,r.__)("Draft","ablocks"),value:"draft"},{label:(0,r.__)("Trash","ablocks"),value:"trash"}],N=[{name:(0,r.__)("Title","ablocks"),cell:e=>(0,S.jsx)("div",{className:"ablocks-table-title-wrap",children:(0, | |
| 910 | +jr.createPortal)((0,S.jsx)("div",{className:`ablocks-dropdown-menu__lists ${o&&`ablocks-dropdown-menu--list-${o}`}`,ref:c,children:(0,S.jsx)("ul",{className:"ablocks-more-options",children:s.map((e,t)=>(0,S.jsx)(n().Fragment,{children:e.action?(0,S.jsxs)("form",{className:"ablocks-more-options__item",action:e.action,method:e.method,children:[(0,S.jsx)(sn,{preset:"transparent",iconPosition:"left",...e}),e.hasBorder&&(0,S.jsx)("hr",{className:"ablocks-option-separator"})]},t):(0,S.jsxs)("li",{className:"ablocks-more-options__item",children:[(0,S.jsx)(sn,{preset:"transparent",iconPosition:"left",...e,onClick:()=>(l(!1),"button"===e.type?e?.onClick():null)}),e.hasBorder&&(0,S.jsx)("hr",{className:"ablocks-option-separator"})]},t)},t))})}),document.body)]})};T_.propTypes=D_;const C_=T_,N_=[{label:(0,r.__)("All","ablocks"),value:"all"},{label:(0,r.__)("Publish","ablocks"),value:"publish"},{label:(0,r.__)("Draft","ablocks"),value:"draft"},{label:(0,r.__)("Trash","ablocks"),value:"trash" | |
| 911 | +}],E_=()=>{const e=j(e=>e.themeBuilder),t=w(),[o,l]=(0,a.useState)([]),[c,d]=(0,a.useState)({}),[u,m]=(0,a.useState)(!1),[_,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),b=(0,s.Zp)(),g=function(){const{search:e}=(0,s.zy)();return n().useMemo(()=>new URLSearchParams(e),[e])}(),y=g.get("status"),k=g.get("themePerPage"),v=g.get("search"),[x,M]=(0,a.useState)(y||"all"),L=(e="",t="")=>{let a=`${i.Y3}admin.php?page=ablocks-theme-builder`;if(""!==e&&null!==e&&"null"!==e&&"all"!==e){const t="?"===a[a.length-1]&&a.split(a.length-1);a=`${a}${t?"":"&"}status=${e}`}if(""!==t&&null!==t&&"null"!==t){const e="?"===a[a.length-1]&&a.split(a.length-1);a=`${a}${e?"":"&"}search=${t}`}b(a)},Y=[..."trash"!==x?[{suffix:"trash",label:(0,r.__)("Trash","ablocks"),onClick:()=>d({value:"trash",message:(0,r.__)("Are you sure, you want to move these item to trash!","ablocks")})}]:[],..."trash"===x?[{suffix:"restore",label:(0,r.__)("Restore","ablocks"),onClick:()=>d({value:"restore",message:(0, | |
| 912 | +r.__)("Are you sure, you want to restore these items?","ablocks")})},{suffix:"delete",label:(0,r.__)("Delete Permanently","ablocks"),onClick:()=>d({value:"delete",message:(0,r.__)("Are you sure, you want to delete these items?","ablocks")})}]:[]];(0,a.useEffect)(()=>{(!e?.data||e?.data&&e?.data.length<=1)&&(null!==k&&t(k),f(!0),t(f_({status:x})).then(()=>{f(!1)}))},[]),(0,a.useEffect)(()=>{L(y,v)},[y,v]);const D=()=>{l([]),d({}),h(!0),m(!1)};n().useMemo(()=>{u?(async e=>{if("trash"!==x&&"trash"===e){for(const e of o)await t(x_(e?.id));D()}else"restore"===e?(o.forEach(e=>{t(w_(e))}),D()):o.forEach(e=>{t(v_(e)),D()})})(c.value):D()},[u]);const T=(e=1,a=10)=>{f(!0),t(f_({status:x,page:e,per_page:a})).then(()=>{f(!1)})},C=[{label:(0,r.__)("Publish","ablocks"),value:"publish"},{label:(0,r.__)("Draft","ablocks"),value:"draft"},{label:(0,r.__)("Trash","ablocks"),value:"trash"}],N=[{name:(0,r.__)("Title","ablocks"),cell:e=>(0,S.jsx)("div",{className:"ablocks-table-title-wrap",children:(0, | |
| 912 | 913 | S.jsx)(s.N_,{to:`${i.Y3}admin.php?page=ablocks-theme-builder&id=${e.id}&action=edit`,children:(0,S.jsx)("div",{className:"ablocks-table-title",children:e.title?.rendered??e.title?.raw})})})},{name:(0,r.__)("Shortcode","ablocks"),cell:e=>(0,S.jsx)("div",{className:"ablocks-table-title-wrap",children:"custom-block"===e?.meta?.ablocks_tb_template_type&&(0,S.jsx)("code",{children:`[ablocks_template id="${e?.id}"]`})})},{name:(0,r.__)("Display Rules","ablocks"),cell:e=>{const t=e?.meta?.ablocks_tb_template_display_locations||[],a=e?.meta?.ablocks_tb_template_not_display_locations||[],n=e?.meta?.ablocks_tb_template_target_user_roles||[];return[...t,...a,...n].some(e=>e.value)||"info-popup-builder"===e?.meta?.ablocks_tb_template_type?(0,S.jsx)("div",{children:"info-popup-builder"===e?.meta?.ablocks_tb_template_type?(0,S.jsx)("div",{children:(0,r.__)("Enter Website","ablocks")}):(0,S.jsxs)(S.Fragment,{children:[t.map(e=>e.value&&(0,S.jsx)("div",{children:(0,r.sprintf)( |
| 913 | 914 | // translators: %s is the display location label. |
| 914 | 915 | // translators: %s is the display location label. |
| 915 | 916 | (0,r.__)("Display: %s","ablocks"),e.label)})),a.map(e=>e.value&&(0,S.jsx)("div",{children:(0,r.sprintf)( |
| @@ -917,92 +918,92 @@ | ||
| 917 | 918 | // translators: %s is the exclusion location label. |
| 918 | 919 | (0,r.__)("Exclusion: %s","ablocks"),e.label)})),n.map(e=>e.value&&(0,S.jsx)("div",{children:(0,r.sprintf)( |
| 919 | 920 | // translators: %s is the user role label. |
| 920 | 921 | // translators: %s is the user role label. |
| 921 | -(0,r.__)("User Role: %s","ablocks"),e.label)}))]})}):(0,S.jsx)("span",{children:"…"})}},{name:(0,r.__)("Status","ablocks"),cell:e=>{return(0,S.jsx)("div",{className:"status-cell",children:(0,S.jsx)(wu,{value:e?.status,options:{items:(a=e?.status,"trash"===a?C.map(e=>{const t="trash"===a&&"trash"!==e.value;return{...e,isDisabled:t}}):C.map(e=>({...e,isDisabled:!1})))},onChangeHandler:a=>{const n={...e,status:a};t("trash"===a?v_(parseInt(e?.id)):y_(n))}})});var a}},{name:(0,r.__)("Date","ablocks"),cell:e=>(0,S.jsx)("div",{children:$m()(e.date).format("D MMMM, YYYY")})},{name:(0,r.__)("Action","ablocks"),cell:e=>{const a="trash"!==e.status?[{type:"button",label:(0,r.__)("Trash","ablocks"),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--trash","aria-hidden":!0}),onClick:()=>t(v_(parseInt(e?.id))),suffix:"trash"}]:[],n="trash"===e.status?[{type:"button",label:(0,r.__)("Restore","ablocks"),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--rotate","aria-hidden":!0}), | |
| 922 | -onClick:()=>{t(x_(e))}},{type:"button",label:(0,r.__)("Delete","ablocks"),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--delete","aria-hidden":!0}),onClick:()=>t(k_(e)),suffix:"delete"}]:[];return(0,S.jsx)("div",{className:"action-cell",children:(0,S.jsx)(T_,{options:[{type:"button",label:(0,r.__)("Edit","ablocks"),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--edit","aria-hidden":!0}),onClick:()=>(e=>{b(`${i.Y3}admin.php?page=ablocks-theme-builder&id=${e.id}&action=edit`)})(e)},..."trash"!==e.status&&"draft"!==e.status?[{type:"button",label:(0,r.__)("View","ablocks"),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--eye","aria-hidden":!0}),onClick:()=>(e=>{window.location.href=`${i.Y3}post.php?post=${e.id}&action=edit`})(e)}]:[],...a,...n]})})}}],E=n().useMemo(()=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"kzui-table__sub-header-actions-left",children:(0,S.jsx)("div",{className:"kzui-table-sub-header-tabs", | |
| 923 | -children:C_.map((e,a)=>(0,S.jsx)("span",{role:"presentation",className:`tab ${e?.value===x?"is-active":""} `,onClick:()=>{var a;M(e.value),a=e.value,f(!0),L(a),t(p_({status:a,page:1,per_page:k})).then(()=>{f(!1)})},children:e.label},a))})}),(0,S.jsx)("div",{className:"kzui-list-table-sub-header-actions-right",children:(0,S.jsx)(Ua,{placeholder:(0,r.__)("Search Form","ablocks"),onSearchHandler:e=>{f(!0),t(p_({status:"all",page:1,per_page:10,search:e})).then(()=>{f(!1),L(y,perPage)})},defaultValue:v})})]}),[C_,x,v]),O=0!==e?.data?.length||v?(0,r.__)("No matching results found. Please try a different search.","ablocks"):(0,r.__)("Please, create a form to see the available list here.","ablocks");return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsx)(S_,{heading:(0,r.__)("Theme Builder","ablocks"),children:(0,S.jsx)(s.N_,{to:`${i.Y3}admin.php?page=ablocks-theme-builder&action=new`,className:"ablocks-btn ablocks-btn--md ablocks-btn--preset-purple",children:(0,S.jsx)("span",{ | |
| 924 | -className:"ablocks-btn--label",children:(0,r.__)("Add New","ablocks")})})}),(0,S.jsx)(Tm,{columns:N,data:e?.data??[],showSubHeader:!0,noDataText:O,subHeaderComponent:E,isRowSelectable:!0,showColumnFilter:!1,getSelectRowValue:e=>{l(e),h(!1)},showPagination:!0,onChangePage:(e,a=10)=>{t(M_(e)),T(e,a)},onChangeItemsPerPage:(e=10,a=1)=>{t(L_(e)),T(a,e),L(y)},totalItems:parseInt(e?.totalItems),totalRows:e?.data?.length,dataFetchingStatus:p,resetSelected:_,rowsPerPage:e?.per_page,suffix:"ablocks-theme-builder"}),o.length>0&&(0,S.jsx)(ju,{actionButtons:Y,itemsLength:o?.length,confirmHandler:m,isActionSelected:c,resetHandler:D})]})},E_=[{label:"Header",value:"header"},{label:"Before Footer",value:"before-footer"},{label:"Footer",value:"footer"},{label:"Custom Block",value:"custom-block"},{label:"Info/Popup Builder",value:"info-popup-builder"}],O_=(e=null,t=[])=>{if(e&&t&&t.length>0){t=t.find(t=>parseInt(t?.id)===parseInt(e));const{status:a,title:n={raw:"",rendered:""},slug:s,meta:r}=t;return{ | |
| 925 | -title:n?.raw?n?.raw:n?.rendered,slug:s,status:a||"all",id:e||"",meta:{ablocks_tb_template_type:r.ablocks_tb_template_type,ablocks_tb_template_target_user_roles:r.ablocks_tb_template_target_user_roles,ablocks_tb_template_not_display_locations:r.ablocks_tb_template_not_display_locations,ablocks_tb_template_display_locations:r.ablocks_tb_template_display_locations,ablocks_tb_enabled_layout_template:r.ablocks_tb_enabled_layout_template}}}return{title:"",slug:"",status:"publish",id:e,meta:{ablocks_tb_template_type:"",ablocks_tb_template_target_user_roles:[{}],ablocks_tb_template_not_display_locations:[],ablocks_tb_template_display_locations:[{}]}}},A_=({name:e,title:t})=>{const{values:s,setFieldValue:o}=ta(),[l,c]=(0,a.useState)([]),[d,u]=(0,a.useState)(!1),m=Wa(e=>{0===l.filter(t=>t.label.toLowerCase().includes(e)).length&&((e="")=>{u(!0),(0,i.In)({action:"ablocks_theme_builder/search_anything",keyword:e}).then(e=>{u(!1),c(e?.data?.data)})})(e)},500);return(0,S.jsx)("div",{ | |
| 926 | -className:"ablocks-tb-locations ablocks-tb-locations--display",children:(0,S.jsx)(Sa,{name:`meta.${e}`,children:({push:a,remove:c})=>(0,S.jsx)(n().Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"ablocks-template-locations",children:t}),(0,S.jsxs)("div",{id:"ablocks-template-locations",className:"ablocks-tb-locations__items",children:[s.meta[e].length>0&&s.meta[e].map((t,a)=>(0,S.jsxs)("div",{className:"ablocks-tb-location-item",children:[(0,S.jsx)(Ji,{isClearable:!0,placeholder:(0,r.__)("Select Option","ablocks"),menuPlacement:"top",options:i._P?.locations,value:s.meta[e][a]??{},onChange:t=>o(`meta.${e}.${a}`,t)}),"specifics"===s.meta[e][a]?.value&&(0,S.jsx)(Ji,{isClearable:!0,options:l,value:s.meta[e][a].specific??"",placeholder:(0,r.__)("Search page","ablocks"),onChange:t=>o(`meta.${e}.${a}.specific`,t),onInputChange:m,isLoading:d,menuPlacement:"top",isMulti:!0}),(0,S.jsx)("span",{onClick:()=>c(a), | |
| 927 | -className:"ablocks-icon ablocks-icon--delete"})]})),(0,S.jsxs)("div",{className:"ablocks-tb-location-item__add-btn",children:["ablocks_tb_template_display_locations"===e&&(0,S.jsx)(Ja,{type:"button",label:(0,r.__)("Add Display Rule","ablocks"),onClick:()=>a({})}),(0,S.jsx)(Ja,{type:"button",label:(0,r.__)("Add Exclusion Rule","ablocks"),onClick:()=>{Array.isArray(s.meta.ablocks_tb_template_not_display_locations)?o("meta.ablocks_tb_template_not_display_locations",[...s.meta.ablocks_tb_template_not_display_locations,{}]):o("meta.ablocks_tb_template_not_display_locations",[{}])}})]})]})]})})})})},P_=({name:e,title:t})=>{const{values:a,setFieldValue:n}=ta();return(0,S.jsx)("div",{className:"ablocks-tb-locations ablocks-tb-locations--user",children:(0,S.jsx)(Sa,{name:`meta.${e}`,children:({push:s,remove:o})=>(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"ablocks-template-locations",children:t}),(0, | |
| 928 | -S.jsxs)("div",{id:"ablocks-template-locations",className:"ablocks-tb-locations__items",children:[a.meta[e].length>0&&a.meta[e].map((t,s)=>(0,S.jsxs)("div",{className:"ablocks-tb-location-item",children:[(0,S.jsx)(Ji,{isClearable:!0,menuPlacement:"top",options:i._P?.roles,value:a?.meta[e][s]??{},onChange:t=>n(`meta.${e}.${s}`,t)}),(0,S.jsx)("span",{onClick:()=>o(s),className:"ablocks-icon ablocks-icon--delete"})]})),(0,S.jsx)(Ja,{type:"button",label:(0,r.__)("Add User Role","ablocks"),onClick:()=>s({})})]})]})})})})},H_=({title:e})=>{const{values:t}=ta(),n=j(e=>e?.themeBuilder),s=`[ablocks_template id="${(0,a.useMemo)(()=>t?.id?t.id:Math.max(...n?.data?.map(e=>parseInt(e.id))||[0])+1,[t?.id,n.data])}"]`;return(0,S.jsx)("div",{className:"ablocks-tb-locations ablocks-tb-locations--shortcode",children:(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"ablocks-template-locations",children:e}),(0,S.jsx)("div",{ | |
| 929 | -className:"ablocks-shortcode-preview",children:(0,S.jsx)("code",{children:s})})]})})},R_=()=>{const{values:e,setFieldValue:t}=ta(),a=e?.meta?.ablocks_tb_template_type&&"custom-block"!==e.meta.ablocks_tb_template_type&&"info-popup-builder"!==e.meta.ablocks_tb_template_type,s="custom-block"===e?.meta?.ablocks_tb_template_type,o=!(e?.id||e?.payload?.id);return(0,S.jsxs)(n().Fragment,{children:[(0,S.jsxs)("div",{className:"ablocks-tb-content__options",children:[(0,S.jsx)(cu,{placeholder:(0,r.__)("Title","ablocks"),name:"title"}),(0,S.jsx)(Ia,{preset:"purple",type:"link",isDisabled:o,link:`${i.yT}post.php?post=${e?.id}&action=edit`,label:(0,r.__)("Edit with Ablocks","ablocks"),suffix:"edit-with-ablocks"})]}),i.cK&&a&&(0,S.jsxs)("div",{className:"ablocks-tb-content__warning",children:[(0,S.jsx)("div",{className:"ablocks-tb-content__warning-icon",children:"!"}),(0,S.jsxs)("div",{className:"ablocks-tb-content__warning-content",children:[(0,S.jsx)("div",{ | |
| 930 | -className:"ablocks-tb-content__warning-title",children:(0,r.__)("Requires Classic Theme","ablocks")}),(0,S.jsx)("div",{className:"ablocks-tb-content__warning-message",children:(0,r.__)("Theme builder features like header, before footer, and footer require a Classic theme. It won't work with FSE themes.","ablocks")})]})]}),(0,S.jsxs)("div",{className:"ablocks-tb-content__options ablocks-tb-content__options--builder",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Ablocks Header & Footer Builder Options","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"types-templates",children:(0,r.__)("Type of Template","ablocks")}),(0,S.jsx)(Ji,{isClearable:!0,placeholder:(0,r.__)("Select Template","ablocks"),menuPlacement:"top",options:E_,value:E_.find(t=>t?.value===e?.meta?.ablocks_tb_template_type),onChange:e=>t("meta.ablocks_tb_template_type",e?.value)})]}),a&&(0,S.jsxs)(S.Fragment,{ | |
| 931 | -children:[(0,S.jsx)(A_,{title:(0,r.__)("Display On","ablocks"),name:"ablocks_tb_template_display_locations"}),e?.meta?.ablocks_tb_template_not_display_locations?.length>0&&(0,S.jsx)(A_,{title:(0,r.__)("Do Not Display On","ablocks"),name:"ablocks_tb_template_not_display_locations"}),(0,S.jsx)(P_,{title:(0,r.__)("User Roles","ablocks"),name:"ablocks_tb_template_target_user_roles"})]}),s&&(0,S.jsx)(H_,{title:(0,r.__)("Shortcode","ablocks")})]})]})},I_={type:Aa().string,name:Aa().string,value:Aa().string,saveValueHandler:Aa().func,isSubmitDisabled:Aa().bool},F_=({label:e,isSubmitted:t,value:n="publish",name:s="status",isSubmitDisabled:o=!1})=>{const{setFieldValue:i,handleSubmit:l,values:c}=ta(),[d,u]=(0,a.useState)(n),[m,_]=(0,a.useState)(!1);(0,a.useEffect)(()=>{u(n)},[n]);const h=[{label:(0,r.__)("Publish","ablocks"),value:"publish",description:(0,r.__)("Visible to everyone.","ablocks")},{label:(0,r.__)("Draft","ablocks"),value:"draft",description:(0, | |
| 932 | -r.__)("Not ready to publish.","ablocks")}],p=e=>{u(e),i(s,e)};return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(sn,{label:h.find(e=>e.value===d)?.label||(0,r.__)("Select","ablocks"),onClick:()=>_(!0),preset:"transparent",border:"gray",icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--arrow-down"}),className:"ablocks-status-select__button",iconPosition:"right",suffix:"status-select"}),m&&(0,S.jsx)(Pa.Popover,{onClose:()=>_(!1),className:"ablocks-status-select__popover",children:(0,S.jsx)("ul",{className:"ablocks-status-select__dropdown",children:h.map(({value:e,label:t,description:a})=>(0,S.jsx)("li",{className:"ablocks-status-select__item "+(e===d?"ablocks-status-select__item--selected":""),onClick:()=>p(e),children:(0,S.jsxs)("label",{className:"ablocks-status-select__label",children:[(0,S.jsx)("input",{type:"radio",className:"ablocks-status-option",name:"status-option",value:e,checked:e===d,onChange:()=>p(e)}),(0,S.jsxs)("p",{className:"ablocks-title-subtitle",children:[(0, | |
| 933 | -S.jsx)("span",{className:"ablocks-title",children:t}),(0,S.jsx)("span",{className:"ablocks-sub-title",children:a})]})]})},e))})})]})};F_.propTypes=I_;const W_=F_,z_=({id:e})=>{const t=j(e=>e.themeBuilder),o=w(),i=(0,s.Zp)();return(0,a.useEffect)(()=>{(!t?.data||t?.data&&t?.data.length<=1)&&o(f_(e)).then(()=>{})},[]),(0,S.jsx)(n().Fragment,{children:(0,S.jsx)(pa,{enableReinitialize:!0,initialValues:O_(e,t.data),onSubmit:(t,a)=>{e?o(g_(t)).then(({payload:t})=>{a.setValues(O_(e,[t])),a.setSubmitting(!1)}):o(b_(t)).then(({payload:t})=>{a.setValues(O_(e,[t]));const n=new URLSearchParams(window.location.search);n.set("id",t?.id),n.set("action","edit"),i(`?${n.toString()}`)})},children:({isSubmitting:t,dirty:a,submitForm:n,values:s})=>(0,S.jsxs)(va,{children:[(0,S.jsx)(Mt,{render:()=>(0,S.jsxs)("div",{className:"ablocks-settings-topbar",children:[(0,S.jsx)(W_,{value:s?.status,isSubmitted:t}),(0,S.jsx)(Ia,{type:"submit",label:e?(0,r.__)("Update","ablocks"):(0,r.__)("Publish","ablocks"), | |
| 934 | -onClick:n,isLoading:t,isDisabled:!a})]})}),(0,S.jsx)(S_,{heading:(0,r.__)("Theme Builder","ablocks")}),(0,S.jsx)("div",{className:"ablocks-page-content",children:(0,S.jsx)("div",{className:"ablocks-tb-content",children:(0,S.jsx)(R_,{})})})]})})})};function U_({title:e,description:t,children:a,aside:n}){return(0,S.jsxs)("section",{className:"ablocks-cc-section",children:[(0,S.jsxs)("header",{className:"ablocks-cc-section__head",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("h4",{className:"ablocks-cc-section__title",children:e}),t&&(0,S.jsx)("p",{className:"ablocks-cc-section__desc",children:t})]}),n]}),(0,S.jsx)("div",{className:"ablocks-cc-section__body",children:a})]})}function B_({label:e,help:t,children:a,stacked:n=!1,controlClass:s=""}){return(0,S.jsxs)("div",{className:"ablocks-cc-row"+(n?" ablocks-cc-row--stacked":""),children:[(0,S.jsxs)("div",{className:"ablocks-cc-row__label",children:[(0,S.jsx)("span",{children:e}),t&&(0,S.jsx)("small",{children:t})]}),(0,S.jsx)("div",{ | |
| 935 | -className:"ablocks-cc-row__control"+(s?` ${s}`:""),children:a})]})}function V_({checked:e,onChange:t,label:a,ariaLabel:n}){return(0,S.jsxs)("label",{className:"ablocks-cc-switch",children:[(0,S.jsx)("input",{type:"checkbox",checked:!!e,"aria-label":a||n,onChange:e=>t(e.target.checked)}),(0,S.jsx)("span",{className:"ablocks-cc-switch__track","aria-hidden":"true"}),a&&(0,S.jsx)("span",{className:"ablocks-cc-switch__label",children:a})]})}function $_({value:e,onChange:t,placeholder:a,type:n="text",...s}){return(0,S.jsx)("input",{className:"ablocks-cc-input",type:n,value:e??"",placeholder:a,onChange:e=>t(e.target.value),...s})}function q_({value:e,onChange:t,min:a=0,max:n,step:s=1,suffix:r}){return(0,S.jsxs)("span",{className:"ablocks-cc-number",children:[(0,S.jsx)("input",{className:"ablocks-cc-input ablocks-cc-input--number",type:"number",value:e??"",min:a,max:n,step:s,onChange:e=>t(""===e.target.value?"":parseInt(e.target.value,10))}),r&&(0,S.jsx)("em",{ | |
| 936 | -className:"ablocks-cc-number__suffix",children:r})]})}function J_({value:e,onChange:t,rows:a=3,placeholder:n}){return(0,S.jsx)("textarea",{className:"ablocks-cc-input ablocks-cc-textarea",rows:a,value:e??"",placeholder:n,onChange:e=>t(e.target.value)})}function G_({value:e,onChange:t,options:a}){return(0,S.jsx)("select",{className:"ablocks-cc-input ablocks-cc-select",value:e??"",onChange:e=>t(e.target.value),children:a.map(e=>(0,S.jsx)("option",{value:e.value,children:e.label},e.value))})}function K_({value:e,onChange:t}){return(0,S.jsxs)("span",{className:"ablocks-cc-color",children:[(0,S.jsx)("input",{type:"color",value:e||"#000000",onChange:e=>t(e.target.value),"aria-label":(0,r.__)("Colour","ablocks")}),(0,S.jsx)("input",{className:"ablocks-cc-input ablocks-cc-color__text",type:"text",value:e??"",onChange:e=>t(e.target.value)})]})}function X_({value:e,onChange:t,options:a}){return(0,S.jsx)("div",{className:"ablocks-cc-segmented",role:"group",children:a.map(a=>(0,S.jsx)("button",{ | |
| 937 | -type:"button",className:"ablocks-cc-segmented__item"+(e===a.value?" is-active":""),onClick:()=>t(a.value),children:a.label},a.value))})}const Z_=[{value:"bar",label:(0,r.__)("Bar","ablocks")},{value:"box",label:(0,r.__)("Box","ablocks")},{value:"popup",label:(0,r.__)("Popup","ablocks")}],Q_=[{value:"inline",label:(0,r.__)("In the banner","ablocks")},{value:"modal",label:(0,r.__)("A dialog","ablocks")}],eh=[{value:"link",label:(0,r.__)("Link","ablocks")},{value:"outline",label:(0,r.__)("Outline","ablocks")},{value:"solid",label:(0,r.__)("Solid","ablocks")}],th=[{value:"dismiss",label:(0,r.__)("Just close it","ablocks")},{value:"reject",label:(0,r.__)('Count as "Reject all"',"ablocks")}],ah=[{value:"switch",label:(0,r.__)("Switch","ablocks")},{value:"checkbox",label:(0,r.__)("Checkbox","ablocks")}],nh=[{value:"text",label:(0,r.__)("Plain text","ablocks")},{value:"badge",label:(0,r.__)("Badge","ablocks")}],sh={bar:[{value:"bottom",label:(0,r.__)("Bottom","ablocks")},{value:"top",label:(0, | |
| 938 | -r.__)("Top","ablocks")}],box:[{value:"bottom-left",label:(0,r.__)("Bottom left","ablocks")},{value:"bottom-right",label:(0,r.__)("Bottom right","ablocks")},{value:"bottom",label:(0,r.__)("Bottom centre","ablocks")}],popup:[{value:"center",label:(0,r.__)("Centre","ablocks")}]},rh=[{name:"layout",label:(0,r.__)("Layout","ablocks")},{name:"content",label:(0,r.__)("Content","ablocks")},{name:"buttons",label:(0,r.__)("Buttons","ablocks")},{name:"prefs",label:(0,r.__)("Preferences","ablocks")},{name:"colours",label:(0,r.__)("Colours","ablocks")}];function oh(e){return!e.show_reject&&!e.show_settings&&!e.show_banner_close}function ih({banner:e,set:t}){const[n,s]=(0,a.useState)(rh[0].name),o=sh[e.layout]||sh.bar,i=oh(e);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"ablocks-cc-subnav",role:"tablist",children:rh.map(e=>(0,S.jsx)("button",{type:"button",role:"tab","aria-selected":n===e.name,className:"ablocks-cc-subnav__tab"+(n===e.name?" is-active":""),onClick:()=>s(e.name), | |
| 939 | -children:e.label},e.name))}),"layout"===n&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(U_,{title:(0,r.__)("Layout","ablocks"),description:(0,r.__)("Where the banner sits and how much of the screen it takes.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Style","ablocks"),children:(0,S.jsx)(X_,{value:e.layout,options:Z_,onChange:a=>{const n=sh[a]||sh.bar;t({layout:a,position:n.some(t=>t.value===e.position)?e.position:n[0].value})}})}),(0,S.jsx)(B_,{label:(0,r.__)("Position","ablocks"),children:(0,S.jsx)(X_,{value:e.position,options:o,onChange:e=>t({position:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Dim the page behind","ablocks"),help:(0,r.__)("Makes the choice unavoidable. Effective, and heavy-handed — most sites should leave this off.","ablocks"),children:(0,S.jsx)(V_,{checked:e.overlay,onChange:e=>t({overlay:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Drop shadow","ablocks"),children:(0,S.jsx)(V_,{checked:e.shadow,onChange:e=>t({shadow:e})})}),(0,S.jsx)(B_,{label:(0, | |
| 940 | -r.__)("Maximum width","ablocks"),children:(0,S.jsx)(q_,{value:e.max_width,min:320,max:1600,suffix:"PX",onChange:e=>t({max_width:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Corner radius","ablocks"),children:(0,S.jsx)(q_,{value:e.radius,min:0,max:40,suffix:"PX",onChange:e=>t({radius:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Show after","ablocks"),help:(0,r.__)("A delay only postpones the banner. It does not postpone the blocking, which has already happened server-side.","ablocks"),children:(0,S.jsx)(q_,{value:e.delay,min:0,max:1e4,step:100,suffix:"MS",onChange:e=>t({delay:e})})})]})}),"content"===n&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(U_,{title:(0,r.__)("Content","ablocks"),description:(0,r.__)("Say what you actually collect and why. A vague notice is a notice nobody can consent to.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Title","ablocks"),children:(0,S.jsx)($_,{value:e.title,onChange:e=>t({title:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Message","ablocks"),stacked:!0,children:(0, | |
| 941 | -S.jsx)(J_,{rows:4,value:e.message,onChange:e=>t({message:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Privacy policy URL","ablocks"),children:(0,S.jsx)($_,{type:"url",placeholder:"https://",value:e.policy_url,onChange:e=>t({policy_url:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Policy link text","ablocks"),children:(0,S.jsx)($_,{value:e.policy_label,onChange:e=>t({policy_label:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Cookie policy URL","ablocks"),help:(0,r.__)("A separate document from the privacy policy: this one lists what is stored and for how long. Leave it empty if the privacy policy covers both.","ablocks"),children:(0,S.jsx)($_,{type:"url",placeholder:"https://",value:e.cookie_policy_url,onChange:e=>t({cookie_policy_url:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Cookie policy link text","ablocks"),children:(0,S.jsx)($_,{value:e.cookie_policy_label,onChange:e=>t({cookie_policy_label:e})})})]})}),"buttons"===n&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(U_,{title:(0,r.__)("Buttons","ablocks"), | |
| 942 | -description:(0,r.__)("Refusing must be as easy as agreeing. Hiding Reject behind Preferences is the single most commonly enforced-against dark pattern.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Accept","ablocks"),children:(0,S.jsx)($_,{value:e.accept_label,onChange:e=>t({accept_label:e})})}),(0,S.jsx)(B_,{label:(0,r.__)('Show "Reject all"',"ablocks"),help:i?(0,r.__)("With Preferences and the close button off as well, the banner offers nothing but Accept — a visitor who will not accept has no way past it, on any page. Turn on any one of the three.","ablocks"):void 0,children:(0,S.jsx)(V_,{checked:e.show_reject,onChange:e=>t({show_reject:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Reject","ablocks"),children:(0,S.jsx)($_,{value:e.reject_label,onChange:e=>t({reject_label:e})})}),(0,S.jsx)(B_,{label:(0,r.__)('Show "Preferences"',"ablocks"),help:i?(0, | |
| 943 | -r.__)("The floating button reopens the categories, but only once a decision exists — which is too late to be the way one is made.","ablocks"):void 0,children:(0,S.jsx)(V_,{checked:e.show_settings,onChange:e=>t({show_settings:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Preferences","ablocks"),children:(0,S.jsx)($_,{value:e.settings_label,onChange:e=>t({settings_label:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Preferences style","ablocks"),help:(0,r.__)("How much weight it carries next to Accept. A link is the quietest; an outline reads as a real button without pulling as hard.","ablocks"),children:(0,S.jsx)(X_,{value:e.settings_style,options:eh,onChange:e=>t({settings_style:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Save choices","ablocks"),children:(0,S.jsx)($_,{value:e.save_label,onChange:e=>t({save_label:e})})})]}),(0,S.jsxs)(U_,{title:(0,r.__)("Closing without answering","ablocks"),description:(0, | |
| 944 | -r.__)("A visitor who will not accept needs somewhere to go. Without this the banner stays in front of them on every page until they agree — which is not a choice, and it is worth more to you as a working site than as a wall.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Show a close button","ablocks"),help:(0,r.__)("A small × in the corner of the banner. Closing never grants anything — every refusable category stays blocked either way.","ablocks"),children:(0,S.jsx)(V_,{checked:e.show_banner_close,onChange:e=>t({show_banner_close:e})})}),e.show_banner_close&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(B_,{label:(0,r.__)("Closing means","ablocks"),help:"reject"===e.close_behaviour?(0,r.__)("Writes a refusal and stops asking for as long as any other decision would last. Cleaner, and the visitor is not asked again on their next visit.","ablocks"):(0, | |
| 945 | -r.__)("Stores no decision at all — it only stops asking. They are asked again, so a visitor who was merely busy still gets the chance to agree later.","ablocks"),children:(0,S.jsx)(X_,{value:e.close_behaviour,options:th,onChange:e=>t({close_behaviour:e})})}),"dismiss"===e.close_behaviour&&(0,S.jsx)(B_,{label:(0,r.__)("Ask again after","ablocks"),help:(0,r.__)("0 waits until the browser closes — they are not nagged for the rest of this visit, and the question is still open on the next one.","ablocks"),children:(0,S.jsx)(q_,{value:e.dismiss_days,min:0,max:365,suffix:(0,r.__)("DAYS","ablocks"),onChange:e=>t({dismiss_days:e})})})]})]}),(0,S.jsxs)(U_,{title:(0,r.__)("The way back in","ablocks"),description:(0,r.__)("Withdrawal has to be as easy as granting, so there has to be a way back to the toggles. You can also drop the shortcode [ablocks_cookie_preferences] into a privacy policy page.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Show floating button","ablocks"),children:(0, | |
| 946 | -S.jsx)(V_,{checked:e.reopen,onChange:e=>t({reopen:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Button text","ablocks"),children:(0,S.jsx)($_,{value:e.reopen_label,onChange:e=>t({reopen_label:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Button position","ablocks"),children:(0,S.jsx)(G_,{value:e.reopen_position,options:[{value:"bottom-left",label:(0,r.__)("Bottom left","ablocks")},{value:"bottom-right",label:(0,r.__)("Bottom right","ablocks")}],onChange:e=>t({reopen_position:e})})})]})]}),"prefs"===n&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(U_,{title:(0,r.__)("Preferences panel","ablocks"),description:(0,r.__)("What the visitor sees when they open the category toggles.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Opens as","ablocks"),help:"modal"===e.prefs_layout?(0,r.__)("A centred dialog, with the banner still visible behind it. Use this when the banner is a small corner notice: the categories need more room than it has.","ablocks"):(0, | |
| 947 | -r.__)("The banner swaps its own contents for the category list. Simple, and it keeps everything in one place — but the panel is only ever as wide as the banner.","ablocks"),children:(0,S.jsx)(X_,{value:e.prefs_layout,options:Q_,onChange:e=>t({prefs_layout:e})})}),"modal"===e.prefs_layout&&(0,S.jsx)(B_,{label:(0,r.__)("Dialog width","ablocks"),children:(0,S.jsx)(q_,{value:e.prefs_max_width,min:320,max:1e3,suffix:"PX",onChange:e=>t({prefs_max_width:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Heading","ablocks"),children:(0,S.jsx)($_,{value:e.prefs_title,onChange:e=>t({prefs_title:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Introduction","ablocks"),help:(0,r.__)("Basic HTML is allowed here, so you can link out mid-sentence. The two policy links above are added underneath either way.","ablocks"),stacked:!0,children:(0,S.jsx)(J_,{value:e.prefs_intro,onChange:e=>t({prefs_intro:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Show a close button","ablocks"),help:(0, | |
| 948 | -r.__)("Closes the panel and goes back to the banner. It never dismisses the banner and never records a decision — closing a dialog is not an answer.","ablocks"),children:(0,S.jsx)(V_,{checked:e.show_close,onChange:e=>t({show_close:e})})})]}),(0,S.jsxs)(U_,{title:(0,r.__)("Categories in the panel","ablocks"),description:(0,r.__)("How each category is drawn. The wording lives on the Categories tab; this is only its presentation.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Collapse descriptions","ablocks"),help:(0,r.__)("Each category becomes a row you can expand. Worth it once the descriptions are long enough that the panel scrolls.","ablocks"),children:(0,S.jsx)(V_,{checked:e.prefs_accordion,onChange:e=>t({prefs_accordion:e})})}),e.prefs_accordion&&(0,S.jsx)(B_,{label:(0,r.__)("Open the first one","ablocks"),children:(0,S.jsx)(V_,{checked:e.prefs_open_first,onChange:e=>t({prefs_open_first:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("List the cookies","ablocks"),help:(0, | |
| 949 | -r.__)("Shows the name, provider, lifetime and purpose of each cookie in a category — filled in on the Categories tab. This is the disclosure regulators ask for by name.","ablocks"),children:(0,S.jsx)(V_,{checked:e.show_cookie_table,onChange:e=>t({show_cookie_table:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Toggle style","ablocks"),help:(0,r.__)("A switch can read as something already on; a checkbox as something to tick. Neither is wrong — pick the one your audience will read correctly.","ablocks"),children:(0,S.jsx)(X_,{value:e.switch_style,options:ah,onChange:e=>t({switch_style:e})})}),(0,S.jsx)(B_,{label:(0,r.__)('"Always on" text',"ablocks"),children:(0,S.jsx)($_,{value:e.locked_label,onChange:e=>t({locked_label:e})})}),(0,S.jsx)(B_,{label:(0,r.__)('"Always on" style',"ablocks"),children:(0,S.jsx)(X_,{value:e.locked_style,options:nh,onChange:e=>t({locked_style:e})})})]}),(0,S.jsxs)(U_,{title:(0,r.__)("Buttons under the categories","ablocks"),description:(0, | |
| 950 | -r.__)("The preferences panel has its own row of buttons. Save is always there; the other two are yours to decide on.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)('Show "Reject all"',"ablocks"),help:e.show_prefs_reject||e.show_reject?(0,r.__)("Refusing everything from inside the panel, without having to switch four things off by hand.","ablocks"):(0,r.__)("Reject is now switched off in both places, which leaves a visitor no one-click way to refuse. That is the pattern regulators act on most often.","ablocks"),children:(0,S.jsx)(V_,{checked:e.show_prefs_reject,onChange:e=>t({show_prefs_reject:e})})}),(0,S.jsx)(B_,{label:(0,r.__)('Show "Accept all"',"ablocks"),help:(0,r.__)("Lets someone who opened the panel out of curiosity agree to everything without going back.","ablocks"),children:(0,S.jsx)(V_,{checked:e.show_prefs_accept,onChange:e=>t({show_prefs_accept:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Accept all","ablocks"),children:(0,S.jsx)($_,{value:e.prefs_accept_label,onChange:e=>t({ | |
| 951 | -prefs_accept_label:e})})})]})]}),"colours"===n&&(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(U_,{title:(0,r.__)("Colours","ablocks"),description:(0,r.__)("Each one is a CSS custom property on the banner, so a theme can override any of them without touching these.","ablocks"),children:(0,S.jsx)("div",{className:"ablocks-cc-grid",children:[["bg",(0,r.__)("Background","ablocks")],["text",(0,r.__)("Text","ablocks")],["muted",(0,r.__)("Secondary text","ablocks")],["border",(0,r.__)("Border","ablocks")],["accent",(0,r.__)("Accept button","ablocks")],["accent_text",(0,r.__)("Accept label","ablocks")],["secondary_bg",(0,r.__)("Reject button","ablocks")],["secondary_text",(0,r.__)("Reject label","ablocks")],["save_bg",(0,r.__)("Save button","ablocks")],["save_text",(0,r.__)("Save label","ablocks")],["locked_bg",(0,r.__)('"Always on" badge',"ablocks")],["locked_text",(0,r.__)('"Always on" text',"ablocks")]].map(([a,n])=>(0,S.jsx)(B_,{label:n,children:(0,S.jsx)(K_,{value:e[a],onChange:e=>t({[a]:e})}) | |
| 952 | -},a))})})})]})}const lh=[["name",(0,r.__)("Cookie name","ablocks"),"_ga"],["provider",(0,r.__)("Provider","ablocks"),"Google"],["duration",(0,r.__)("Expires after","ablocks"),"2 years"],["purpose",(0,r.__)("Purpose","ablocks"),(0,r.__)("What it is for","ablocks")]];function ch({cookies:e,onChange:t}){const a=e||[];return(0,S.jsxs)("div",{className:"ablocks-cc-cookies",children:[(0,S.jsxs)("div",{className:"ablocks-cc-cookies__head",children:[(0,S.jsx)("span",{className:"ablocks-cc-cookies__title",children:(0,r.__)("Cookies in this category","ablocks")}),(0,S.jsx)("button",{type:"button",className:"ablocks-cc-cookies__add",onClick:()=>t([...a,{name:"",provider:"",duration:"",purpose:""}]),children:(0,r.__)("+ Add cookie","ablocks")})]}),!a.length&&(0,S.jsx)("p",{className:"ablocks-cc-cookies__empty",children:(0,r.__)('Nothing listed yet. Add a row for each cookie this category sets, then switch on "List the cookies" in the Banner tab to show the table to visitors.',"ablocks") | |
| 953 | -}),a.map((e,n)=>(0,S.jsxs)("div",{className:"ablocks-cc-cookies__row",children:[lh.map(([s,r,o])=>(0,S.jsxs)("label",{className:"ablocks-cc-cookies__cell",children:[(0,S.jsx)("span",{className:"ablocks-cc-cookies__label",children:r}),(0,S.jsx)($_,{value:e[s]||"",placeholder:o,onChange:e=>((e,n)=>t(a.map((t,a)=>a===e?{...t,...n}:t)))(n,{[s]:e})})]},s)),(0,S.jsx)("button",{type:"button",className:"ablocks-cc-cookies__remove","aria-label":(0,r.__)("Remove this cookie","ablocks"),onClick:()=>t(a.filter((e,t)=>t!==n)),children:"×"})]},n))]})}function dh({categories:e,setCategories:t}){const a=(a,n)=>{t(e.map((e,t)=>t===a?{...e,...n}:e))};return(0,S.jsx)(U_,{title:(0,r.__)("Categories","ablocks"),description:(0,r.__)("Everything except strictly necessary starts denied — that is what opt-in means. Switching a category off here removes it from the banner entirely, and any rule pointing at it stops gating.","ablocks"),children:e.map((e,t)=>(0,S.jsxs)("div",{className:"ablocks-cc-category", | |
| 954 | -children:[(0,S.jsxs)("div",{className:"ablocks-cc-category__head",children:[(0,S.jsx)("code",{className:"ablocks-cc-category__slug",children:e.slug}),e.locked?(0,S.jsx)("span",{className:"ablocks-cc-pill",children:(0,r.__)("Always on","ablocks")}):(0,S.jsx)(V_,{checked:e.enabled,label:(0,r.__)("Offer this category","ablocks"),onChange:e=>a(t,{enabled:e})})]}),(0,S.jsx)(B_,{label:(0,r.__)("Label","ablocks"),children:(0,S.jsx)($_,{value:e.label,onChange:e=>a(t,{label:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Description","ablocks"),stacked:!0,children:(0,S.jsx)(J_,{value:e.description,onChange:e=>a(t,{description:e})})}),(0,S.jsx)(ch,{cookies:e.cookies,onChange:e=>a(t,{cookies:e})})]},e.slug))})}function uh({isOpen:e,close:t,content:a}){return e?(0,S.jsx)("div",{className:"ablocks-pro-modal-overlay",children:(0,S.jsxs)("div",{className:"ablocks-pro-modal",children:[(0,S.jsx)("button",{className:"ablocks-pro-modal__close",onClick:()=>{t(!1)},children:"×"}),(0,S.jsx)("div",{ | |
| 955 | -className:"ablocks-pro-modal__content",children:a||(0,r.__)("This feature is only available in the Pro version.","ablocks")}),(0,S.jsx)("button",{className:"ablocks-pro-modal__button",onClick:()=>window.open("https://ablocks.pro/pricing/","_blank"),children:(0,r.__)("Upgrade to aBlocks Pro","ablocks")})]})}):null}uh.propTypes={isOpen:Aa().bool.isRequired,close:Aa().func.isRequired,content:Aa().string};const mh=e=>!!(i.kg&&i.kg.pro||{})[e];function _h(){return(0,S.jsx)("span",{className:"ablocks-cc-crown","aria-hidden":"true",children:(0,S.jsx)("svg",{viewBox:"0 0 24 24",width:"13",height:"13",fill:"currentColor",children:(0,S.jsx)("path",{d:"M3 8.5 6.8 11 12 4.5 17.2 11 21 8.5 19.3 18H4.7L3 8.5Zm2 11.5h14v1.5H5V20Z"})})})}function hh(){return(0,S.jsxs)("span",{className:"ablocks-cc-pro-pill",children:[(0,S.jsx)(_h,{}),(0,r.__)("PRO","ablocks")]})}function ph({feature:e,reason:t,children:n}){const[s,r]=(0,a.useState)(!1);return mh(e)?n:(0,S.jsxs)(S.Fragment,{children:[(0, | |
| 956 | -S.jsxs)("span",{className:"ablocks-cc-locked",role:"button",tabIndex:0,"aria-disabled":"true",title:t,onClickCapture:e=>{e.preventDefault(),e.stopPropagation(),r(!0)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),r(!0))},children:[(0,S.jsx)("span",{className:"ablocks-cc-locked__inner","aria-hidden":"true",children:n}),(0,S.jsx)(hh,{})]}),(0,S.jsx)(uh,{isOpen:s,close:r,content:t})]})}function fh({feature:e,title:t,body:a}){return mh(e)?null:(0,S.jsxs)("div",{className:"ablocks-cc-promo",children:[(0,S.jsx)("div",{className:"ablocks-cc-promo__rail","aria-hidden":"true",children:(0,S.jsx)(_h,{})}),(0,S.jsxs)("div",{className:"ablocks-cc-promo__body",children:[(0,S.jsx)("p",{className:"ablocks-cc-promo__title",children:t}),(0,S.jsx)("p",{className:"ablocks-cc-promo__text",children:a})]}),(0,S.jsx)("a",{className:"ablocks-cc-promo__cta",href:"https://ablocks.pro/pricing/",target:"_blank",rel:"noreferrer",children:(0,r.__)("Get Pro","ablocks")})]})}function bh({dryRun:e}){ | |
| 957 | -const[t,n]=(0,a.useState)(null),[s,o]=(0,a.useState)(!1),l=()=>{o(!0),(0,i.In)({action:"ablocks/cookie_consent/get_report"}).then(e=>n(e?.data?.data?.entries||[])).finally(()=>o(!1))};return(0,a.useEffect)(l,[]),(0,S.jsxs)(U_,{title:(0,r.__)("What the gate has seen","ablocks"),description:e?(0,r.__)("Dry run is on, so nothing below was actually blocked. Load a few pages of the site as a logged-out visitor, then read this list.","ablocks"):(0,r.__)("Scripts matched by a rule, plus any third-party script no rule classified. The second group is the one worth reading — an unclassified tracker is a tracker running before consent.","ablocks"),aside:(0,S.jsxs)("div",{className:"ablocks-cc-section__actions",children:[(0,S.jsx)(Ja,{preset:"gray",label:(0,r.__)("Refresh","ablocks"),onClick:l,isLoading:s}),(0,S.jsx)(Ja,{preset:"gray",label:(0,r.__)("Clear","ablocks"),onClick:()=>{(0,i.In)({action:"ablocks/cookie_consent/clear_report"}).then(()=>n([]))}})]}),children:[null===t&&(0,S.jsx)("p",{ | |
| 922 | +(0,r.__)("User Role: %s","ablocks"),e.label)}))]})}):(0,S.jsx)("span",{children:"…"})}},{name:(0,r.__)("Status","ablocks"),cell:e=>{return(0,S.jsx)("div",{className:"status-cell",children:(0,S.jsx)(Mu,{value:e?.status,options:{items:(a=e?.status,"trash"===a?C.map(e=>{const t="trash"===a&&"trash"!==e.value;return{...e,isDisabled:t}}):C.map(e=>({...e,isDisabled:!1})))},onChangeHandler:a=>{const n={...e,status:a};t("trash"===a?x_(parseInt(e?.id)):k_(n))}})});var a}},{name:(0,r.__)("Date","ablocks"),cell:e=>(0,S.jsx)("div",{children:qm()(e.date).format("D MMMM, YYYY")})},{name:(0,r.__)("Action","ablocks"),cell:e=>{const a="trash"!==e.status?[{type:"button",label:(0,r.__)("Trash","ablocks"),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--trash","aria-hidden":!0}),onClick:()=>t(x_(parseInt(e?.id))),suffix:"trash"}]:[],n="trash"===e.status?[{type:"button",label:(0,r.__)("Restore","ablocks"),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--rotate","aria-hidden":!0}), | |
| 923 | +onClick:()=>{t(w_(e))}},{type:"button",label:(0,r.__)("Delete","ablocks"),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--delete","aria-hidden":!0}),onClick:()=>t(v_(e)),suffix:"delete"}]:[];return(0,S.jsx)("div",{className:"action-cell",children:(0,S.jsx)(C_,{options:[{type:"button",label:(0,r.__)("Edit","ablocks"),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--edit","aria-hidden":!0}),onClick:()=>(e=>{b(`${i.Y3}admin.php?page=ablocks-theme-builder&id=${e.id}&action=edit`)})(e)},..."trash"!==e.status&&"draft"!==e.status?[{type:"button",label:(0,r.__)("View","ablocks"),icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--eye","aria-hidden":!0}),onClick:()=>(e=>{window.location.href=`${i.Y3}post.php?post=${e.id}&action=edit`})(e)}]:[],...a,...n]})})}}],E=n().useMemo(()=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"kzui-table__sub-header-actions-left",children:(0,S.jsx)("div",{className:"kzui-table-sub-header-tabs", | |
| 924 | +children:N_.map((e,a)=>(0,S.jsx)("span",{role:"presentation",className:`tab ${e?.value===x?"is-active":""} `,onClick:()=>{var a;M(e.value),a=e.value,f(!0),L(a),t(f_({status:a,page:1,per_page:k})).then(()=>{f(!1)})},children:e.label},a))})}),(0,S.jsx)("div",{className:"kzui-list-table-sub-header-actions-right",children:(0,S.jsx)(Ua,{placeholder:(0,r.__)("Search Form","ablocks"),onSearchHandler:e=>{f(!0),t(f_({status:"all",page:1,per_page:10,search:e})).then(()=>{f(!1),L(y,perPage)})},defaultValue:v})})]}),[N_,x,v]),O=0!==e?.data?.length||v?(0,r.__)("No matching results found. Please try a different search.","ablocks"):(0,r.__)("Please, create a form to see the available list here.","ablocks");return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsx)(Y_,{heading:(0,r.__)("Theme Builder","ablocks"),children:(0,S.jsx)(s.N_,{to:`${i.Y3}admin.php?page=ablocks-theme-builder&action=new`,className:"ablocks-btn ablocks-btn--md ablocks-btn--preset-purple",children:(0,S.jsx)("span",{ | |
| 925 | +className:"ablocks-btn--label",children:(0,r.__)("Add New","ablocks")})})}),(0,S.jsx)(Cm,{columns:N,data:e?.data??[],showSubHeader:!0,noDataText:O,subHeaderComponent:E,isRowSelectable:!0,showColumnFilter:!1,getSelectRowValue:e=>{l(e),h(!1)},showPagination:!0,onChangePage:(e,a=10)=>{t(L_(e)),T(e,a)},onChangeItemsPerPage:(e=10,a=1)=>{t(j_(e)),T(a,e),L(y)},totalItems:parseInt(e?.totalItems),totalRows:e?.data?.length,dataFetchingStatus:p,resetSelected:_,rowsPerPage:e?.per_page,suffix:"ablocks-theme-builder"}),o.length>0&&(0,S.jsx)(Su,{actionButtons:Y,itemsLength:o?.length,confirmHandler:m,isActionSelected:c,resetHandler:D})]})},O_=[{label:(0,r.__)("Header","ablocks"),value:"header"},{label:(0,r.__)("Before Footer","ablocks"),value:"before-footer"},{label:(0,r.__)("Footer","ablocks"),value:"footer"},{label:(0,r.__)("Custom Block","ablocks"),value:"custom-block"},{label:(0,r.__)("Info/Popup Builder","ablocks"),value:"info-popup-builder"}],A_=(e=null,t=[])=>{if(e&&t&&t.length>0){ | |
| 926 | +t=t.find(t=>parseInt(t?.id)===parseInt(e));const{status:a,title:n={raw:"",rendered:""},slug:s,meta:r}=t;return{title:n?.raw?n?.raw:n?.rendered,slug:s,status:a||"all",id:e||"",meta:{ablocks_tb_template_type:r.ablocks_tb_template_type,ablocks_tb_template_target_user_roles:r.ablocks_tb_template_target_user_roles,ablocks_tb_template_not_display_locations:r.ablocks_tb_template_not_display_locations,ablocks_tb_template_display_locations:r.ablocks_tb_template_display_locations,ablocks_tb_enabled_layout_template:r.ablocks_tb_enabled_layout_template}}}return{title:"",slug:"",status:"publish",id:e,meta:{ablocks_tb_template_type:"",ablocks_tb_template_target_user_roles:[{}],ablocks_tb_template_not_display_locations:[],ablocks_tb_template_display_locations:[{}]}}},P_=({name:e,title:t})=>{const{values:s,setFieldValue:o}=ta(),[l,c]=(0,a.useState)([]),[d,u]=(0,a.useState)(!1),m=Wa(e=>{0===l.filter(t=>t.label.toLowerCase().includes(e)).length&&((e="")=>{u(!0),(0,i.In)({ | |
| 927 | +action:"ablocks_theme_builder/search_anything",keyword:e}).then(e=>{u(!1),c(e?.data?.data)})})(e)},500);return(0,S.jsx)("div",{className:"ablocks-tb-locations ablocks-tb-locations--display",children:(0,S.jsx)(Sa,{name:`meta.${e}`,children:({push:a,remove:c})=>(0,S.jsx)(n().Fragment,{children:(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"ablocks-template-locations",children:t}),(0,S.jsxs)("div",{id:"ablocks-template-locations",className:"ablocks-tb-locations__items",children:[s.meta[e].length>0&&s.meta[e].map((t,a)=>(0,S.jsxs)("div",{className:"ablocks-tb-location-item",children:[(0,S.jsx)(Ji,{...Gi(),isClearable:!0,placeholder:(0,r.__)("Select Option","ablocks"),menuPlacement:"top",options:i._P?.locations,value:s.meta[e][a]??{},onChange:t=>o(`meta.${e}.${a}`,t)}),"specifics"===s.meta[e][a]?.value&&(0,S.jsx)(Ji,{...Gi(),isClearable:!0,options:l,value:s.meta[e][a].specific??"",placeholder:(0,r.__)("Search page","ablocks"), | |
| 928 | +onChange:t=>o(`meta.${e}.${a}.specific`,t),onInputChange:m,isLoading:d,menuPlacement:"top",isMulti:!0}),(0,S.jsx)("span",{onClick:()=>c(a),className:"ablocks-icon ablocks-icon--delete"})]})),(0,S.jsxs)("div",{className:"ablocks-tb-location-item__add-btn",children:["ablocks_tb_template_display_locations"===e&&(0,S.jsx)(Ja,{type:"button",label:(0,r.__)("Add Display Rule","ablocks"),onClick:()=>a({})}),(0,S.jsx)(Ja,{type:"button",label:(0,r.__)("Add Exclusion Rule","ablocks"),onClick:()=>{Array.isArray(s.meta.ablocks_tb_template_not_display_locations)?o("meta.ablocks_tb_template_not_display_locations",[...s.meta.ablocks_tb_template_not_display_locations,{}]):o("meta.ablocks_tb_template_not_display_locations",[{}])}})]})]})]})})})})},H_=({name:e,title:t})=>{const{values:a,setFieldValue:n}=ta();return(0,S.jsx)("div",{className:"ablocks-tb-locations ablocks-tb-locations--user",children:(0,S.jsx)(Sa,{name:`meta.${e}`,children:({push:s,remove:o})=>(0,S.jsx)(S.Fragment,{children:(0, | |
| 929 | +S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"ablocks-template-locations",children:t}),(0,S.jsxs)("div",{id:"ablocks-template-locations",className:"ablocks-tb-locations__items",children:[a.meta[e].length>0&&a.meta[e].map((t,s)=>(0,S.jsxs)("div",{className:"ablocks-tb-location-item",children:[(0,S.jsx)(Ji,{...Gi(),isClearable:!0,menuPlacement:"top",options:i._P?.roles,value:a?.meta[e][s]??{},onChange:t=>n(`meta.${e}.${s}`,t)}),(0,S.jsx)("span",{onClick:()=>o(s),className:"ablocks-icon ablocks-icon--delete"})]})),(0,S.jsx)(Ja,{type:"button",label:(0,r.__)("Add User Role","ablocks"),onClick:()=>s({})})]})]})})})})},R_=({title:e})=>{const{values:t}=ta(),n=j(e=>e?.themeBuilder),s=`[ablocks_template id="${(0,a.useMemo)(()=>t?.id?t.id:Math.max(...n?.data?.map(e=>parseInt(e.id))||[0])+1,[t?.id,n.data])}"]`;return(0,S.jsx)("div",{className:"ablocks-tb-locations ablocks-tb-locations--shortcode",children:(0,S.jsxs)("div",{ | |
| 930 | +className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"ablocks-template-locations",children:e}),(0,S.jsx)("div",{className:"ablocks-shortcode-preview",children:(0,S.jsx)("code",{children:s})})]})})},I_=()=>{const{values:e,setFieldValue:t}=ta(),a=e?.meta?.ablocks_tb_template_type&&"custom-block"!==e.meta.ablocks_tb_template_type&&"info-popup-builder"!==e.meta.ablocks_tb_template_type,s="custom-block"===e?.meta?.ablocks_tb_template_type,o=!(e?.id||e?.payload?.id);return(0,S.jsxs)(n().Fragment,{children:[(0,S.jsxs)("div",{className:"ablocks-tb-content__options",children:[(0,S.jsx)(du,{placeholder:(0,r.__)("Title","ablocks"),name:"title"}),(0,S.jsx)(Ia,{preset:"purple",type:"link",isDisabled:o,link:`${i.yT}post.php?post=${e?.id}&action=edit`,label:(0,r.__)("Edit with Ablocks","ablocks"),suffix:"edit-with-ablocks"})]}),i.cK&&a&&(0,S.jsxs)("div",{className:"ablocks-tb-content__warning",children:[(0,S.jsx)("div",{ | |
| 931 | +className:"ablocks-tb-content__warning-icon",children:"!"}),(0,S.jsxs)("div",{className:"ablocks-tb-content__warning-content",children:[(0,S.jsx)("div",{className:"ablocks-tb-content__warning-title",children:(0,r.__)("Requires Classic Theme","ablocks")}),(0,S.jsx)("div",{className:"ablocks-tb-content__warning-message",children:(0,r.__)("Theme builder features like header, before footer, and footer require a Classic theme. It won't work with FSE themes.","ablocks")})]})]}),(0,S.jsxs)("div",{className:"ablocks-tb-content__options ablocks-tb-content__options--builder",children:[(0,S.jsx)("h3",{className:"ablocks-general-content__heading",children:(0,r.__)("Ablocks Header & Footer Builder Options","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-d-flex",children:[(0,S.jsx)("label",{className:"ablocks-title",htmlFor:"types-templates",children:(0,r.__)("Type of Template","ablocks")}),(0,S.jsx)(Ji,{...Gi(),isClearable:!0,placeholder:(0,r.__)("Select Template","ablocks"),menuPlacement:"top", | |
| 932 | +options:O_,value:O_.find(t=>t?.value===e?.meta?.ablocks_tb_template_type),onChange:e=>t("meta.ablocks_tb_template_type",e?.value)})]}),a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(P_,{title:(0,r.__)("Display On","ablocks"),name:"ablocks_tb_template_display_locations"}),e?.meta?.ablocks_tb_template_not_display_locations?.length>0&&(0,S.jsx)(P_,{title:(0,r.__)("Do Not Display On","ablocks"),name:"ablocks_tb_template_not_display_locations"}),(0,S.jsx)(H_,{title:(0,r.__)("User Roles","ablocks"),name:"ablocks_tb_template_target_user_roles"})]}),s&&(0,S.jsx)(R_,{title:(0,r.__)("Shortcode","ablocks")})]})]})},F_={type:Aa().string,name:Aa().string,value:Aa().string,saveValueHandler:Aa().func,isSubmitDisabled:Aa().bool},W_=({label:e,isSubmitted:t,value:n="publish",name:s="status",isSubmitDisabled:o=!1})=>{const{setFieldValue:i,handleSubmit:l,values:c}=ta(),[d,u]=(0,a.useState)(n),[m,_]=(0,a.useState)(!1);(0,a.useEffect)(()=>{u(n)},[n]);const h=[{label:(0,r.__)("Publish","ablocks"), | |
| 933 | +value:"publish",description:(0,r.__)("Visible to everyone.","ablocks")},{label:(0,r.__)("Draft","ablocks"),value:"draft",description:(0,r.__)("Not ready to publish.","ablocks")}],p=e=>{u(e),i(s,e)};return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(sn,{label:h.find(e=>e.value===d)?.label||(0,r.__)("Select","ablocks"),onClick:()=>_(!0),preset:"transparent",border:"gray",icon:(0,S.jsx)("span",{className:"ablocks-icon ablocks-icon--arrow-down"}),className:"ablocks-status-select__button",iconPosition:"right",suffix:"status-select"}),m&&(0,S.jsx)(Pa.Popover,{onClose:()=>_(!1),className:"ablocks-status-select__popover",children:(0,S.jsx)("ul",{className:"ablocks-status-select__dropdown",children:h.map(({value:e,label:t,description:a})=>(0,S.jsx)("li",{className:"ablocks-status-select__item "+(e===d?"ablocks-status-select__item--selected":""),onClick:()=>p(e),children:(0,S.jsxs)("label",{className:"ablocks-status-select__label",children:[(0,S.jsx)("input",{type:"radio", | |
| 934 | +className:"ablocks-status-option",name:"status-option",value:e,checked:e===d,onChange:()=>p(e)}),(0,S.jsxs)("p",{className:"ablocks-title-subtitle",children:[(0,S.jsx)("span",{className:"ablocks-title",children:t}),(0,S.jsx)("span",{className:"ablocks-sub-title",children:a})]})]})},e))})})]})};W_.propTypes=F_;const z_=W_,U_=({id:e})=>{const t=j(e=>e.themeBuilder),o=w(),i=(0,s.Zp)();return(0,a.useEffect)(()=>{(!t?.data||t?.data&&t?.data.length<=1)&&o(b_(e)).then(()=>{})},[]),(0,S.jsx)(n().Fragment,{children:(0,S.jsx)(pa,{enableReinitialize:!0,initialValues:A_(e,t.data),onSubmit:(t,a)=>{e?o(y_(t)).then(({payload:t})=>{a.setValues(A_(e,[t])),a.setSubmitting(!1)}):o(g_(t)).then(({payload:t})=>{a.setValues(A_(e,[t]));const n=new URLSearchParams(window.location.search);n.set("id",t?.id),n.set("action","edit"),i(`?${n.toString()}`)})},children:({isSubmitting:t,dirty:a,submitForm:n,values:s})=>(0,S.jsxs)(va,{children:[(0,S.jsx)(Mt,{render:()=>(0,S.jsxs)("div",{ | |
| 935 | +className:"ablocks-settings-topbar",children:[(0,S.jsx)(z_,{value:s?.status,isSubmitted:t}),(0,S.jsx)(Ia,{type:"submit",label:e?(0,r.__)("Update","ablocks"):(0,r.__)("Publish","ablocks"),onClick:n,isLoading:t,isDisabled:!a})]})}),(0,S.jsx)(Y_,{heading:(0,r.__)("Theme Builder","ablocks")}),(0,S.jsx)("div",{className:"ablocks-page-content",children:(0,S.jsx)("div",{className:"ablocks-tb-content",children:(0,S.jsx)(I_,{})})})]})})})};function B_({title:e,description:t,children:a,aside:n}){return(0,S.jsxs)("section",{className:"ablocks-cc-section",children:[(0,S.jsxs)("header",{className:"ablocks-cc-section__head",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("h4",{className:"ablocks-cc-section__title",children:e}),t&&(0,S.jsx)("p",{className:"ablocks-cc-section__desc",children:t})]}),n]}),(0,S.jsx)("div",{className:"ablocks-cc-section__body",children:a})]})}function V_({label:e,help:t,children:a,stacked:n=!1,controlClass:s=""}){return(0,S.jsxs)("div",{ | |
| 936 | +className:"ablocks-cc-row"+(n?" ablocks-cc-row--stacked":""),children:[(0,S.jsxs)("div",{className:"ablocks-cc-row__label",children:[(0,S.jsx)("span",{children:e}),t&&(0,S.jsx)("small",{children:t})]}),(0,S.jsx)("div",{className:"ablocks-cc-row__control"+(s?` ${s}`:""),children:a})]})}function $_({checked:e,onChange:t,label:a,ariaLabel:n}){return(0,S.jsxs)("label",{className:"ablocks-cc-switch",children:[(0,S.jsx)("input",{type:"checkbox",checked:!!e,"aria-label":a||n,onChange:e=>t(e.target.checked)}),(0,S.jsx)("span",{className:"ablocks-cc-switch__track","aria-hidden":"true"}),a&&(0,S.jsx)("span",{className:"ablocks-cc-switch__label",children:a})]})}function q_({value:e,onChange:t,placeholder:a,type:n="text",...s}){return(0,S.jsx)("input",{className:"ablocks-cc-input",type:n,value:e??"",placeholder:a,onChange:e=>t(e.target.value),...s})}function J_({value:e,onChange:t,min:a=0,max:n,step:s=1,suffix:r}){return(0,S.jsxs)("span",{className:"ablocks-cc-number",children:[(0,S.jsx)("input",{ | |
| 937 | +className:"ablocks-cc-input ablocks-cc-input--number",type:"number",value:e??"",min:a,max:n,step:s,onChange:e=>t(""===e.target.value?"":parseInt(e.target.value,10))}),r&&(0,S.jsx)("em",{className:"ablocks-cc-number__suffix",children:r})]})}function G_({value:e,onChange:t,rows:a=3,placeholder:n}){return(0,S.jsx)("textarea",{className:"ablocks-cc-input ablocks-cc-textarea",rows:a,value:e??"",placeholder:n,onChange:e=>t(e.target.value)})}function K_({value:e,onChange:t,options:a}){return(0,S.jsx)("select",{className:"ablocks-cc-input ablocks-cc-select",value:e??"",onChange:e=>t(e.target.value),children:a.map(e=>(0,S.jsx)("option",{value:e.value,children:e.label},e.value))})}function X_({value:e,onChange:t}){return(0,S.jsxs)("span",{className:"ablocks-cc-color",children:[(0,S.jsx)("input",{type:"color",value:e||"#000000",onChange:e=>t(e.target.value),"aria-label":(0,r.__)("Colour","ablocks")}),(0,S.jsx)("input",{className:"ablocks-cc-input ablocks-cc-color__text",type:"text",value:e??"", | |
| 938 | +onChange:e=>t(e.target.value)})]})}function Z_({value:e,onChange:t,options:a}){return(0,S.jsx)("div",{className:"ablocks-cc-segmented",role:"group",children:a.map(a=>(0,S.jsx)("button",{type:"button",className:"ablocks-cc-segmented__item"+(e===a.value?" is-active":""),onClick:()=>t(a.value),children:a.label},a.value))})}const Q_=[{value:"bar",label:(0,r.__)("Bar","ablocks")},{value:"box",label:(0,r.__)("Box","ablocks")},{value:"popup",label:(0,r.__)("Popup","ablocks")}],eh=[{value:"inline",label:(0,r.__)("In the banner","ablocks")},{value:"modal",label:(0,r.__)("A dialog","ablocks")}],th=[{value:"link",label:(0,r.__)("Link","ablocks")},{value:"outline",label:(0,r.__)("Outline","ablocks")},{value:"solid",label:(0,r.__)("Solid","ablocks")}],ah=[{value:"dismiss",label:(0,r.__)("Just close it","ablocks")},{value:"reject",label:(0,r.__)('Count as "Reject all"',"ablocks")}],nh=[{value:"switch",label:(0,r.__)("Switch","ablocks")},{value:"checkbox",label:(0,r.__)("Checkbox","ablocks")}],sh=[{ | |
| 939 | +value:"text",label:(0,r.__)("Plain text","ablocks")},{value:"badge",label:(0,r.__)("Badge","ablocks")}],rh={bar:[{value:"bottom",label:(0,r.__)("Bottom","ablocks")},{value:"top",label:(0,r.__)("Top","ablocks")}],box:[{value:"bottom-left",label:(0,r.__)("Bottom left","ablocks")},{value:"bottom-right",label:(0,r.__)("Bottom right","ablocks")},{value:"bottom",label:(0,r.__)("Bottom centre","ablocks")}],popup:[{value:"center",label:(0,r.__)("Centre","ablocks")}]},oh=[{name:"layout",label:(0,r.__)("Layout","ablocks")},{name:"content",label:(0,r.__)("Content","ablocks")},{name:"buttons",label:(0,r.__)("Buttons","ablocks")},{name:"prefs",label:(0,r.__)("Preferences","ablocks")},{name:"colours",label:(0,r.__)("Colours","ablocks")}];function ih(e){return!e.show_reject&&!e.show_settings&&!e.show_banner_close}function lh({banner:e,set:t}){const[n,s]=(0,a.useState)(oh[0].name),o=rh[e.layout]||rh.bar,i=ih(e);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"ablocks-cc-subnav", | |
| 940 | +role:"tablist",children:oh.map(e=>(0,S.jsx)("button",{type:"button",role:"tab","aria-selected":n===e.name,className:"ablocks-cc-subnav__tab"+(n===e.name?" is-active":""),onClick:()=>s(e.name),children:e.label},e.name))}),"layout"===n&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(B_,{title:(0,r.__)("Layout","ablocks"),description:(0,r.__)("Where the banner sits and how much of the screen it takes.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Style","ablocks"),children:(0,S.jsx)(Z_,{value:e.layout,options:Q_,onChange:a=>{const n=rh[a]||rh.bar;t({layout:a,position:n.some(t=>t.value===e.position)?e.position:n[0].value})}})}),(0,S.jsx)(V_,{label:(0,r.__)("Position","ablocks"),children:(0,S.jsx)(Z_,{value:e.position,options:o,onChange:e=>t({position:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Dim the page behind","ablocks"),help:(0,r.__)("Makes the choice unavoidable. Effective, and heavy-handed — most sites should leave this off.","ablocks"),children:(0,S.jsx)($_,{checked:e.overlay, | |
| 941 | +onChange:e=>t({overlay:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Drop shadow","ablocks"),children:(0,S.jsx)($_,{checked:e.shadow,onChange:e=>t({shadow:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Maximum width","ablocks"),children:(0,S.jsx)(J_,{value:e.max_width,min:320,max:1600,suffix:"PX",onChange:e=>t({max_width:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Corner radius","ablocks"),children:(0,S.jsx)(J_,{value:e.radius,min:0,max:40,suffix:"PX",onChange:e=>t({radius:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Show after","ablocks"),help:(0,r.__)("A delay only postpones the banner. It does not postpone the blocking, which has already happened server-side.","ablocks"),children:(0,S.jsx)(J_,{value:e.delay,min:0,max:1e4,step:100,suffix:"MS",onChange:e=>t({delay:e})})})]})}),"content"===n&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(B_,{title:(0,r.__)("Content","ablocks"),description:(0,r.__)("Say what you actually collect and why. A vague notice is a notice nobody can consent to.","ablocks"),children:[(0, | |
| 942 | +S.jsx)(V_,{label:(0,r.__)("Title","ablocks"),children:(0,S.jsx)(q_,{value:e.title,onChange:e=>t({title:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Message","ablocks"),stacked:!0,children:(0,S.jsx)(G_,{rows:4,value:e.message,onChange:e=>t({message:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Privacy policy URL","ablocks"),children:(0,S.jsx)(q_,{type:"url",placeholder:"https://",value:e.policy_url,onChange:e=>t({policy_url:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Policy link text","ablocks"),children:(0,S.jsx)(q_,{value:e.policy_label,onChange:e=>t({policy_label:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Cookie policy URL","ablocks"),help:(0,r.__)("A separate document from the privacy policy: this one lists what is stored and for how long. Leave it empty if the privacy policy covers both.","ablocks"),children:(0,S.jsx)(q_,{type:"url",placeholder:"https://",value:e.cookie_policy_url,onChange:e=>t({cookie_policy_url:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Cookie policy link text","ablocks"),children:(0, | |
| 943 | +S.jsx)(q_,{value:e.cookie_policy_label,onChange:e=>t({cookie_policy_label:e})})})]})}),"buttons"===n&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(B_,{title:(0,r.__)("Buttons","ablocks"),description:(0,r.__)("Refusing must be as easy as agreeing. Hiding Reject behind Preferences is the single most commonly enforced-against dark pattern.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Accept","ablocks"),children:(0,S.jsx)(q_,{value:e.accept_label,onChange:e=>t({accept_label:e})})}),(0,S.jsx)(V_,{label:(0,r.__)('Show "Reject all"',"ablocks"),help:i?(0,r.__)("With Preferences and the close button off as well, the banner offers nothing but Accept — a visitor who will not accept has no way past it, on any page. Turn on any one of the three.","ablocks"):void 0,children:(0,S.jsx)($_,{checked:e.show_reject,onChange:e=>t({show_reject:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Reject","ablocks"),children:(0,S.jsx)(q_,{value:e.reject_label,onChange:e=>t({reject_label:e})})}),(0,S.jsx)(V_,{label:(0, | |
| 944 | +r.__)('Show "Preferences"',"ablocks"),help:i?(0,r.__)("The floating button reopens the categories, but only once a decision exists — which is too late to be the way one is made.","ablocks"):void 0,children:(0,S.jsx)($_,{checked:e.show_settings,onChange:e=>t({show_settings:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Preferences","ablocks"),children:(0,S.jsx)(q_,{value:e.settings_label,onChange:e=>t({settings_label:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Preferences style","ablocks"),help:(0,r.__)("How much weight it carries next to Accept. A link is the quietest; an outline reads as a real button without pulling as hard.","ablocks"),children:(0,S.jsx)(Z_,{value:e.settings_style,options:th,onChange:e=>t({settings_style:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Save choices","ablocks"),children:(0,S.jsx)(q_,{value:e.save_label,onChange:e=>t({save_label:e})})})]}),(0,S.jsxs)(B_,{title:(0,r.__)("Closing without answering","ablocks"),description:(0, | |
| 945 | +r.__)("A visitor who will not accept needs somewhere to go. Without this the banner stays in front of them on every page until they agree — which is not a choice, and it is worth more to you as a working site than as a wall.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Show a close button","ablocks"),help:(0,r.__)("A small × in the corner of the banner. Closing never grants anything — every refusable category stays blocked either way.","ablocks"),children:(0,S.jsx)($_,{checked:e.show_banner_close,onChange:e=>t({show_banner_close:e})})}),e.show_banner_close&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(V_,{label:(0,r.__)("Closing means","ablocks"),help:"reject"===e.close_behaviour?(0,r.__)("Writes a refusal and stops asking for as long as any other decision would last. Cleaner, and the visitor is not asked again on their next visit.","ablocks"):(0, | |
| 946 | +r.__)("Stores no decision at all — it only stops asking. They are asked again, so a visitor who was merely busy still gets the chance to agree later.","ablocks"),children:(0,S.jsx)(Z_,{value:e.close_behaviour,options:ah,onChange:e=>t({close_behaviour:e})})}),"dismiss"===e.close_behaviour&&(0,S.jsx)(V_,{label:(0,r.__)("Ask again after","ablocks"),help:(0,r.__)("0 waits until the browser closes — they are not nagged for the rest of this visit, and the question is still open on the next one.","ablocks"),children:(0,S.jsx)(J_,{value:e.dismiss_days,min:0,max:365,suffix:(0,r.__)("DAYS","ablocks"),onChange:e=>t({dismiss_days:e})})})]})]}),(0,S.jsxs)(B_,{title:(0,r.__)("The way back in","ablocks"),description:(0,r.__)("Withdrawal has to be as easy as granting, so there has to be a way back to the toggles. You can also drop the shortcode [ablocks_cookie_preferences] into a privacy policy page.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Show floating button","ablocks"),children:(0, | |
| 947 | +S.jsx)($_,{checked:e.reopen,onChange:e=>t({reopen:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Button text","ablocks"),children:(0,S.jsx)(q_,{value:e.reopen_label,onChange:e=>t({reopen_label:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Button position","ablocks"),children:(0,S.jsx)(K_,{value:e.reopen_position,options:[{value:"bottom-left",label:(0,r.__)("Bottom left","ablocks")},{value:"bottom-right",label:(0,r.__)("Bottom right","ablocks")}],onChange:e=>t({reopen_position:e})})})]})]}),"prefs"===n&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(B_,{title:(0,r.__)("Preferences panel","ablocks"),description:(0,r.__)("What the visitor sees when they open the category toggles.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Opens as","ablocks"),help:"modal"===e.prefs_layout?(0,r.__)("A centred dialog, with the banner still visible behind it. Use this when the banner is a small corner notice: the categories need more room than it has.","ablocks"):(0, | |
| 948 | +r.__)("The banner swaps its own contents for the category list. Simple, and it keeps everything in one place — but the panel is only ever as wide as the banner.","ablocks"),children:(0,S.jsx)(Z_,{value:e.prefs_layout,options:eh,onChange:e=>t({prefs_layout:e})})}),"modal"===e.prefs_layout&&(0,S.jsx)(V_,{label:(0,r.__)("Dialog width","ablocks"),children:(0,S.jsx)(J_,{value:e.prefs_max_width,min:320,max:1e3,suffix:"PX",onChange:e=>t({prefs_max_width:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Heading","ablocks"),children:(0,S.jsx)(q_,{value:e.prefs_title,onChange:e=>t({prefs_title:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Introduction","ablocks"),help:(0,r.__)("Basic HTML is allowed here, so you can link out mid-sentence. The two policy links above are added underneath either way.","ablocks"),stacked:!0,children:(0,S.jsx)(G_,{value:e.prefs_intro,onChange:e=>t({prefs_intro:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Show a close button","ablocks"),help:(0, | |
| 949 | +r.__)("Closes the panel and goes back to the banner. It never dismisses the banner and never records a decision — closing a dialog is not an answer.","ablocks"),children:(0,S.jsx)($_,{checked:e.show_close,onChange:e=>t({show_close:e})})})]}),(0,S.jsxs)(B_,{title:(0,r.__)("Categories in the panel","ablocks"),description:(0,r.__)("How each category is drawn. The wording lives on the Categories tab; this is only its presentation.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Collapse descriptions","ablocks"),help:(0,r.__)("Each category becomes a row you can expand. Worth it once the descriptions are long enough that the panel scrolls.","ablocks"),children:(0,S.jsx)($_,{checked:e.prefs_accordion,onChange:e=>t({prefs_accordion:e})})}),e.prefs_accordion&&(0,S.jsx)(V_,{label:(0,r.__)("Open the first one","ablocks"),children:(0,S.jsx)($_,{checked:e.prefs_open_first,onChange:e=>t({prefs_open_first:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("List the cookies","ablocks"),help:(0, | |
| 950 | +r.__)("Shows the name, provider, lifetime and purpose of each cookie in a category — filled in on the Categories tab. This is the disclosure regulators ask for by name.","ablocks"),children:(0,S.jsx)($_,{checked:e.show_cookie_table,onChange:e=>t({show_cookie_table:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Toggle style","ablocks"),help:(0,r.__)("A switch can read as something already on; a checkbox as something to tick. Neither is wrong — pick the one your audience will read correctly.","ablocks"),children:(0,S.jsx)(Z_,{value:e.switch_style,options:nh,onChange:e=>t({switch_style:e})})}),(0,S.jsx)(V_,{label:(0,r.__)('"Always on" text',"ablocks"),children:(0,S.jsx)(q_,{value:e.locked_label,onChange:e=>t({locked_label:e})})}),(0,S.jsx)(V_,{label:(0,r.__)('"Always on" style',"ablocks"),children:(0,S.jsx)(Z_,{value:e.locked_style,options:sh,onChange:e=>t({locked_style:e})})})]}),(0,S.jsxs)(B_,{title:(0,r.__)("Buttons under the categories","ablocks"),description:(0, | |
| 951 | +r.__)("The preferences panel has its own row of buttons. Save is always there; the other two are yours to decide on.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)('Show "Reject all"',"ablocks"),help:e.show_prefs_reject||e.show_reject?(0,r.__)("Refusing everything from inside the panel, without having to switch four things off by hand.","ablocks"):(0,r.__)("Reject is now switched off in both places, which leaves a visitor no one-click way to refuse. That is the pattern regulators act on most often.","ablocks"),children:(0,S.jsx)($_,{checked:e.show_prefs_reject,onChange:e=>t({show_prefs_reject:e})})}),(0,S.jsx)(V_,{label:(0,r.__)('Show "Accept all"',"ablocks"),help:(0,r.__)("Lets someone who opened the panel out of curiosity agree to everything without going back.","ablocks"),children:(0,S.jsx)($_,{checked:e.show_prefs_accept,onChange:e=>t({show_prefs_accept:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Accept all","ablocks"),children:(0,S.jsx)(q_,{value:e.prefs_accept_label,onChange:e=>t({ | |
| 952 | +prefs_accept_label:e})})})]})]}),"colours"===n&&(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(B_,{title:(0,r.__)("Colours","ablocks"),description:(0,r.__)("Each one is a CSS custom property on the banner, so a theme can override any of them without touching these.","ablocks"),children:(0,S.jsx)("div",{className:"ablocks-cc-grid",children:[["bg",(0,r.__)("Background","ablocks")],["text",(0,r.__)("Text","ablocks")],["muted",(0,r.__)("Secondary text","ablocks")],["border",(0,r.__)("Border","ablocks")],["accent",(0,r.__)("Accept button","ablocks")],["accent_text",(0,r.__)("Accept label","ablocks")],["secondary_bg",(0,r.__)("Reject button","ablocks")],["secondary_text",(0,r.__)("Reject label","ablocks")],["save_bg",(0,r.__)("Save button","ablocks")],["save_text",(0,r.__)("Save label","ablocks")],["locked_bg",(0,r.__)('"Always on" badge',"ablocks")],["locked_text",(0,r.__)('"Always on" text',"ablocks")]].map(([a,n])=>(0,S.jsx)(V_,{label:n,children:(0,S.jsx)(X_,{value:e[a],onChange:e=>t({[a]:e})}) | |
| 953 | +},a))})})})]})}const ch=[["name",(0,r.__)("Cookie name","ablocks"),"_ga"],["provider",(0,r.__)("Provider","ablocks"),"Google"],["duration",(0,r.__)("Expires after","ablocks"),"2 years"],["purpose",(0,r.__)("Purpose","ablocks"),(0,r.__)("What it is for","ablocks")]];function dh({cookies:e,onChange:t}){const a=e||[];return(0,S.jsxs)("div",{className:"ablocks-cc-cookies",children:[(0,S.jsxs)("div",{className:"ablocks-cc-cookies__head",children:[(0,S.jsx)("span",{className:"ablocks-cc-cookies__title",children:(0,r.__)("Cookies in this category","ablocks")}),(0,S.jsx)("button",{type:"button",className:"ablocks-cc-cookies__add",onClick:()=>t([...a,{name:"",provider:"",duration:"",purpose:""}]),children:(0,r.__)("+ Add cookie","ablocks")})]}),!a.length&&(0,S.jsx)("p",{className:"ablocks-cc-cookies__empty",children:(0,r.__)('Nothing listed yet. Add a row for each cookie this category sets, then switch on "List the cookies" in the Banner tab to show the table to visitors.',"ablocks") | |
| 954 | +}),a.map((e,n)=>(0,S.jsxs)("div",{className:"ablocks-cc-cookies__row",children:[ch.map(([s,r,o])=>(0,S.jsxs)("label",{className:"ablocks-cc-cookies__cell",children:[(0,S.jsx)("span",{className:"ablocks-cc-cookies__label",children:r}),(0,S.jsx)(q_,{value:e[s]||"",placeholder:o,onChange:e=>((e,n)=>t(a.map((t,a)=>a===e?{...t,...n}:t)))(n,{[s]:e})})]},s)),(0,S.jsx)("button",{type:"button",className:"ablocks-cc-cookies__remove","aria-label":(0,r.__)("Remove this cookie","ablocks"),onClick:()=>t(a.filter((e,t)=>t!==n)),children:"×"})]},n))]})}function uh({categories:e,setCategories:t}){const a=(a,n)=>{t(e.map((e,t)=>t===a?{...e,...n}:e))};return(0,S.jsx)(B_,{title:(0,r.__)("Categories","ablocks"),description:(0,r.__)("Everything except strictly necessary starts denied — that is what opt-in means. Switching a category off here removes it from the banner entirely, and any rule pointing at it stops gating.","ablocks"),children:e.map((e,t)=>(0,S.jsxs)("div",{className:"ablocks-cc-category", | |
| 955 | +children:[(0,S.jsxs)("div",{className:"ablocks-cc-category__head",children:[(0,S.jsx)("code",{className:"ablocks-cc-category__slug",children:e.slug}),e.locked?(0,S.jsx)("span",{className:"ablocks-cc-pill",children:(0,r.__)("Always on","ablocks")}):(0,S.jsx)($_,{checked:e.enabled,label:(0,r.__)("Offer this category","ablocks"),onChange:e=>a(t,{enabled:e})})]}),(0,S.jsx)(V_,{label:(0,r.__)("Label","ablocks"),children:(0,S.jsx)(q_,{value:e.label,onChange:e=>a(t,{label:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Description","ablocks"),stacked:!0,children:(0,S.jsx)(G_,{value:e.description,onChange:e=>a(t,{description:e})})}),(0,S.jsx)(dh,{cookies:e.cookies,onChange:e=>a(t,{cookies:e})})]},e.slug))})}function mh({isOpen:e,close:t,content:a}){return e?(0,S.jsx)("div",{className:"ablocks-pro-modal-overlay",children:(0,S.jsxs)("div",{className:"ablocks-pro-modal",children:[(0,S.jsx)("button",{className:"ablocks-pro-modal__close",onClick:()=>{t(!1)},children:"×"}),(0,S.jsx)("div",{ | |
| 956 | +className:"ablocks-pro-modal__content",children:a||(0,r.__)("This feature is only available in the Pro version.","ablocks")}),(0,S.jsx)("button",{className:"ablocks-pro-modal__button",onClick:()=>window.open("https://ablocks.pro/pricing/","_blank"),children:(0,r.__)("Upgrade to aBlocks Pro","ablocks")})]})}):null}mh.propTypes={isOpen:Aa().bool.isRequired,close:Aa().func.isRequired,content:Aa().string};const _h=e=>!!(i.kg&&i.kg.pro||{})[e];function hh(){return(0,S.jsx)("span",{className:"ablocks-cc-crown","aria-hidden":"true",children:(0,S.jsx)("svg",{viewBox:"0 0 24 24",width:"13",height:"13",fill:"currentColor",children:(0,S.jsx)("path",{d:"M3 8.5 6.8 11 12 4.5 17.2 11 21 8.5 19.3 18H4.7L3 8.5Zm2 11.5h14v1.5H5V20Z"})})})}function ph(){return(0,S.jsxs)("span",{className:"ablocks-cc-pro-pill",children:[(0,S.jsx)(hh,{}),(0,r.__)("PRO","ablocks")]})}function fh({feature:e,reason:t,children:n}){const[s,r]=(0,a.useState)(!1);return _h(e)?n:(0,S.jsxs)(S.Fragment,{children:[(0, | |
| 957 | +S.jsxs)("span",{className:"ablocks-cc-locked",role:"button",tabIndex:0,"aria-disabled":"true",title:t,onClickCapture:e=>{e.preventDefault(),e.stopPropagation(),r(!0)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),r(!0))},children:[(0,S.jsx)("span",{className:"ablocks-cc-locked__inner","aria-hidden":"true",children:n}),(0,S.jsx)(ph,{})]}),(0,S.jsx)(mh,{isOpen:s,close:r,content:t})]})}function bh({feature:e,title:t,body:a}){return _h(e)?null:(0,S.jsxs)("div",{className:"ablocks-cc-promo",children:[(0,S.jsx)("div",{className:"ablocks-cc-promo__rail","aria-hidden":"true",children:(0,S.jsx)(hh,{})}),(0,S.jsxs)("div",{className:"ablocks-cc-promo__body",children:[(0,S.jsx)("p",{className:"ablocks-cc-promo__title",children:t}),(0,S.jsx)("p",{className:"ablocks-cc-promo__text",children:a})]}),(0,S.jsx)("a",{className:"ablocks-cc-promo__cta",href:"https://ablocks.pro/pricing/",target:"_blank",rel:"noreferrer",children:(0,r.__)("Get Pro","ablocks")})]})}function gh({dryRun:e}){ | |
| 958 | +const[t,n]=(0,a.useState)(null),[s,o]=(0,a.useState)(!1),l=()=>{o(!0),(0,i.In)({action:"ablocks/cookie_consent/get_report"}).then(e=>n(e?.data?.data?.entries||[])).finally(()=>o(!1))};return(0,a.useEffect)(l,[]),(0,S.jsxs)(B_,{title:(0,r.__)("What the gate has seen","ablocks"),description:e?(0,r.__)("Dry run is on, so nothing below was actually blocked. Load a few pages of the site as a logged-out visitor, then read this list.","ablocks"):(0,r.__)("Scripts matched by a rule, plus any third-party script no rule classified. The second group is the one worth reading — an unclassified tracker is a tracker running before consent.","ablocks"),aside:(0,S.jsxs)("div",{className:"ablocks-cc-section__actions",children:[(0,S.jsx)(Ja,{preset:"gray",label:(0,r.__)("Refresh","ablocks"),onClick:l,isLoading:s}),(0,S.jsx)(Ja,{preset:"gray",label:(0,r.__)("Clear","ablocks"),onClick:()=>{(0,i.In)({action:"ablocks/cookie_consent/clear_report"}).then(()=>n([]))}})]}),children:[null===t&&(0,S.jsx)("p",{ | |
| 958 | 959 | className:"ablocks-cc-empty",children:(0,r.__)("Loading…","ablocks")}),null!==t&&0===t.length&&(0,S.jsx)("p",{className:"ablocks-cc-empty",children:(0,r.__)("Nothing recorded yet. Open the site in a private window and load a page or two.","ablocks")}),null!==t&&t.length>0&&(0,S.jsxs)("table",{className:"ablocks-cc-table",children:[(0,S.jsx)("thead",{children:(0,S.jsxs)("tr",{children:[(0,S.jsx)("th",{children:(0,r.__)("Script","ablocks")}),(0,S.jsx)("th",{children:(0,r.__)("Where","ablocks")}),(0,S.jsx)("th",{children:(0,r.__)("Verdict","ablocks")})]})}),(0,S.jsx)("tbody",{children:t.map((e,t)=>(0,S.jsxs)("tr",{children:[(0,S.jsxs)("td",{children:[(0,S.jsx)("code",{children:e.subject}),e.url&&(0,S.jsx)("small",{className:"ablocks-cc-table__sub",children:e.url})]}),(0,S.jsx)("td",{children:e.source}),(0,S.jsx)("td",{children:e.category?(0,S.jsx)("span",{className:"ablocks-cc-pill ablocks-cc-pill--ok",children:e.category}):(0,S.jsx)("span",{ |
| 959 | -className:"ablocks-cc-pill ablocks-cc-pill--warn",children:(0,r.__)("not classified","ablocks")})})]},t))})]})]})}const gh=(0,r.__)('Pro lets you write your own matchers — a tracker we do not ship a rule for, a plugin that enqueues its own, anything on the "not classified" list below.',"ablocks");function yh({shipped:e,overrides:t,onChange:a,refusable:n,pickable:s=!0}){const r={};(t||[]).forEach(e=>{e&&e.id&&(r[e.id]=e)});const o=(t,n)=>{const s=e.map(e=>({id:e.id,enabled:r[e.id]?.enabled??e.enabled,category:r[e.id]?.category||e.category,...e.id===t?n:{}}));a(s)};return e.map(e=>{const t=r[e.id]||{},a=t.enabled??e.enabled,i=t.category||e.category;return(0,S.jsxs)(B_,{label:e.label,children:[s&&(0,S.jsx)(G_,{value:i,options:n,onChange:t=>o(e.id,{category:t})}),(0,S.jsx)(V_,{checked:!!a,ariaLabel:e.label,onChange:t=>o(e.id,{enabled:t})})]},e.id)})}function kh({settings:e,set:t,categories:a,embedDefaults:n={}}){const s=a.filter(e=>!e.locked&&e.enabled).map(e=>({value:e.slug,label:e.label | |
| 960 | -})),o=e.rules||[],i=mh("custom_rules"),l=(e,a)=>{t({rules:o.map((t,n)=>n===e?{...t,...a}:t)})},c=n.embed||[],d=n.pixel||[];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(U_,{title:(0,r.__)("Mode","ablocks"),description:(0,r.__)("Opt-in holds scripts back until their category is granted. Notice shows the banner and gates nothing — honest for a site that only sets its own cookies, and not enough for one that runs analytics.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Behaviour","ablocks"),children:(0,S.jsx)(G_,{value:e.mode,options:[{value:"optin",label:(0,r.__)("Opt-in — block until granted","ablocks")},{value:"notice",label:(0,r.__)("Notice only — inform, block nothing","ablocks")}],onChange:e=>t({mode:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Scan inline and pasted tags","ablocks"),help:(0,r.__)("GTM, GA4 and the Meta Pixel are almost never enqueued — they are pasted into a header hook. Without this, they are not covered.","ablocks"),children:(0,S.jsx)(V_,{ | |
| 961 | -checked:e.buffer_gating,onChange:e=>t({buffer_gating:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Dry run","ablocks"),help:(0,r.__)("Match everything, block nothing, and report what would have happened. Turn this on first on any site that already has tags on it.","ablocks"),children:(0,S.jsx)(V_,{checked:e.dry_run,onChange:e=>t({dry_run:e})})})]}),(0,S.jsxs)(U_,{title:(0,r.__)("Rules","ablocks"),description:(0,r.__)("Patterns are regular expressions matched against a script URL or the contents of an inline script. A rule that fires on something it does not understand takes a site down, so leave the shipped ones alone unless you have a reason.","ablocks"),aside:(0,S.jsx)(ph,{feature:"custom_rules",reason:gh,children:(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Add rule","ablocks"),onClick:()=>t({rules:[...o,{id:"rule-"+Math.random().toString(36).slice(2,10),label:"",category:"analytics",src:"",inline:"",handles:"",enabled:!0}]})})}),children:[(0,S.jsx)(fh,{feature:"custom_rules",title:(0, | |
| 962 | -r.__)("Tracking something we have no rule for?","ablocks"),body:gh}),o.map((e,a)=>(0,S.jsxs)("div",{className:"ablocks-cc-rule",children:[(0,S.jsxs)("div",{className:"ablocks-cc-rule__head",children:[(0,S.jsx)(V_,{checked:e.enabled,onChange:e=>l(a,{enabled:e})}),(0,S.jsx)("input",{className:"ablocks-cc-input ablocks-cc-rule__name",value:e.label,placeholder:(0,r.__)("Name","ablocks"),readOnly:!i,onChange:e=>l(a,{label:e.target.value})}),(0,S.jsx)(G_,{value:e.category,options:s,onChange:e=>l(a,{category:e})}),i&&(0,S.jsx)("button",{type:"button",className:"ablocks-cc-rule__remove","aria-label":(0,r.__)("Remove rule","ablocks"),onClick:()=>t({rules:o.filter((e,t)=>t!==a)}),children:"×"})]}),(0,S.jsx)(B_,{label:(0,r.__)("URL pattern","ablocks"),children:(0,S.jsx)(ph,{feature:"custom_rules",reason:gh,children:(0,S.jsx)($_,{value:e.src,placeholder:"googletagmanager\\.com/gtm\\.js",onChange:e=>l(a,{src:e})})})}),(0,S.jsx)(B_,{label:(0,r.__)("Inline pattern","ablocks"),children:(0,S.jsx)(ph,{ | |
| 963 | -feature:"custom_rules",reason:gh,children:(0,S.jsx)($_,{value:e.inline,placeholder:"fbq\\s*\\(",onChange:e=>l(a,{inline:e})})})}),(0,S.jsx)(B_,{label:(0,r.__)("Script handles","ablocks"),help:(0,r.__)("Comma separated. For a plugin that enqueues its tracker properly.","ablocks"),children:(0,S.jsx)(ph,{feature:"custom_rules",reason:gh,children:(0,S.jsx)($_,{value:e.handles,onChange:e=>l(a,{handles:e})})})})]},e.id||a))]}),(0,S.jsxs)(U_,{title:(0,r.__)("Embedded content and pixels","ablocks"),description:(0, | |
| 964 | -r.__)("A YouTube embed sets its cookies while the page is still parsing, without running a line of the site’s own JavaScript — which is why blocking every script and leaving the video is not a partial job but a broken one. A blocked embed is replaced by a card offering to load it; a tracking pixel is simply not fetched, because a 1×1 image is not content anyone is missing. Only the providers listed here are ever touched, so a payment form or a captcha cannot be caught by accident.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Block embeds and pixels","ablocks"),help:(0,r.__)("Independent of the script buffer above — a site can hold scripts back and leave its videos alone, or the reverse.","ablocks"),children:(0,S.jsx)(V_,{checked:e.embed_gating,onChange:e=>t({embed_gating:e})})}),e.embed_gating&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(yh,{shipped:c,overrides:e.embed_rules,refusable:s,onChange:e=>t({embed_rules:e})}),(0,S.jsx)(yh,{shipped:d,overrides:e.pixel_rules,refusable:s, | |
| 965 | -pickable:!1,onChange:e=>t({pixel_rules:e})})]})]}),(0,S.jsx)(bh,{dryRun:e.dry_run})]})}const vh=(0,r.__)("Pro keeps a server-side log of every decision — when it was made, which policy version and wording were shown, and what was allowed. That is what Art. 7(1) means by being able to demonstrate consent.","ablocks");function xh({settings:e,set:t}){const[n,s]=(0,a.useState)([]),[o,l]=(0,a.useState)(0),[c,d]=(0,a.useState)(!1),u=mh("records"),m=()=>{u&&(d(!0),(0,i.In)({action:"ablocks/cookie_consent/get_records",page:1}).then(e=>{s(e?.data?.data?.records||[]),l(e?.data?.data?.total||0)}).finally(()=>d(!1)))};return(0,a.useEffect)(m,[]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(fh,{feature:"records",title:(0,r.__)("Need to prove consent was given?","ablocks"),body:vh}),(0,S.jsxs)(U_,{title:(0,r.__)("Recording","ablocks"),description:u?(0, | |
| 966 | -r.__)("One row per decision, including changes of mind. Records are exported and erased through WordPress’ own privacy tools for logged-in visitors.","ablocks"):(0,r.__)("Nothing is stored on the server on this plan. The decision still lives in the visitor’s own cookie, and the banner still honours it — there is simply no log of it to show anyone.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Store consent records","ablocks"),children:(0,S.jsx)(ph,{feature:"records",reason:vh,children:(0,S.jsx)(V_,{checked:u&&e.record_enabled,onChange:e=>t({record_enabled:e})})})}),(0,S.jsx)(B_,{label:(0,r.__)("Also store IP address","ablocks"),help:(0,r.__)("Off by default. An IP address is personal data and needs its own lawful basis — switching this on makes the record itself something you have to justify.","ablocks"),children:(0,S.jsx)(ph,{feature:"records",reason:vh,children:(0,S.jsx)(V_,{checked:u&&e.record_ip,onChange:e=>t({record_ip:e})})})}),(0,S.jsx)(B_,{label:(0, | |
| 967 | -r.__)("Keep records for","ablocks"),help:(0,r.__)("Records older than this are deleted daily. A record kept forever is a record kept without a purpose.","ablocks"),children:(0,S.jsx)(ph,{feature:"records",reason:vh,children:(0,S.jsx)(q_,{value:e.record_retention_days,min:30,max:3650,suffix:(0,r.__)("DAYS","ablocks"),onChange:e=>t({record_retention_days:e})})})})]}),u&&(0,S.jsx)(U_,{title:(0,r.__)("Stored records","ablocks"),description:(0,r.sprintf)(/* translators: %s: number of stored consent records. */ /* translators: %s: number of stored consent records. */ | |
| 960 | +className:"ablocks-cc-pill ablocks-cc-pill--warn",children:(0,r.__)("not classified","ablocks")})})]},t))})]})]})}const yh=(0,r.__)('Pro lets you write your own matchers — a tracker we do not ship a rule for, a plugin that enqueues its own, anything on the "not classified" list below.',"ablocks");function kh({shipped:e,overrides:t,onChange:a,refusable:n,pickable:s=!0}){const r={};(t||[]).forEach(e=>{e&&e.id&&(r[e.id]=e)});const o=(t,n)=>{const s=e.map(e=>({id:e.id,enabled:r[e.id]?.enabled??e.enabled,category:r[e.id]?.category||e.category,...e.id===t?n:{}}));a(s)};return e.map(e=>{const t=r[e.id]||{},a=t.enabled??e.enabled,i=t.category||e.category;return(0,S.jsxs)(V_,{label:e.label,children:[s&&(0,S.jsx)(K_,{value:i,options:n,onChange:t=>o(e.id,{category:t})}),(0,S.jsx)($_,{checked:!!a,ariaLabel:e.label,onChange:t=>o(e.id,{enabled:t})})]},e.id)})}function vh({settings:e,set:t,categories:a,embedDefaults:n={}}){const s=a.filter(e=>!e.locked&&e.enabled).map(e=>({value:e.slug,label:e.label | |
| 961 | +})),o=e.rules||[],i=_h("custom_rules"),l=(e,a)=>{t({rules:o.map((t,n)=>n===e?{...t,...a}:t)})},c=n.embed||[],d=n.pixel||[];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(B_,{title:(0,r.__)("Mode","ablocks"),description:(0,r.__)("Opt-in holds scripts back until their category is granted. Notice shows the banner and gates nothing — honest for a site that only sets its own cookies, and not enough for one that runs analytics.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Behaviour","ablocks"),children:(0,S.jsx)(K_,{value:e.mode,options:[{value:"optin",label:(0,r.__)("Opt-in — block until granted","ablocks")},{value:"notice",label:(0,r.__)("Notice only — inform, block nothing","ablocks")}],onChange:e=>t({mode:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Scan inline and pasted tags","ablocks"),help:(0,r.__)("GTM, GA4 and the Meta Pixel are almost never enqueued — they are pasted into a header hook. Without this, they are not covered.","ablocks"),children:(0,S.jsx)($_,{ | |
| 962 | +checked:e.buffer_gating,onChange:e=>t({buffer_gating:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Dry run","ablocks"),help:(0,r.__)("Match everything, block nothing, and report what would have happened. Turn this on first on any site that already has tags on it.","ablocks"),children:(0,S.jsx)($_,{checked:e.dry_run,onChange:e=>t({dry_run:e})})})]}),(0,S.jsxs)(B_,{title:(0,r.__)("Rules","ablocks"),description:(0,r.__)("Patterns are regular expressions matched against a script URL or the contents of an inline script. A rule that fires on something it does not understand takes a site down, so leave the shipped ones alone unless you have a reason.","ablocks"),aside:(0,S.jsx)(fh,{feature:"custom_rules",reason:yh,children:(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Add rule","ablocks"),onClick:()=>t({rules:[...o,{id:"rule-"+Math.random().toString(36).slice(2,10),label:"",category:"analytics",src:"",inline:"",handles:"",enabled:!0}]})})}),children:[(0,S.jsx)(bh,{feature:"custom_rules",title:(0, | |
| 963 | +r.__)("Tracking something we have no rule for?","ablocks"),body:yh}),o.map((e,a)=>(0,S.jsxs)("div",{className:"ablocks-cc-rule",children:[(0,S.jsxs)("div",{className:"ablocks-cc-rule__head",children:[(0,S.jsx)($_,{checked:e.enabled,onChange:e=>l(a,{enabled:e})}),(0,S.jsx)("input",{className:"ablocks-cc-input ablocks-cc-rule__name",value:e.label,placeholder:(0,r.__)("Name","ablocks"),readOnly:!i,onChange:e=>l(a,{label:e.target.value})}),(0,S.jsx)(K_,{value:e.category,options:s,onChange:e=>l(a,{category:e})}),i&&(0,S.jsx)("button",{type:"button",className:"ablocks-cc-rule__remove","aria-label":(0,r.__)("Remove rule","ablocks"),onClick:()=>t({rules:o.filter((e,t)=>t!==a)}),children:"×"})]}),(0,S.jsx)(V_,{label:(0,r.__)("URL pattern","ablocks"),children:(0,S.jsx)(fh,{feature:"custom_rules",reason:yh,children:(0,S.jsx)(q_,{value:e.src,placeholder:"googletagmanager\\.com/gtm\\.js",onChange:e=>l(a,{src:e})})})}),(0,S.jsx)(V_,{label:(0,r.__)("Inline pattern","ablocks"),children:(0,S.jsx)(fh,{ | |
| 964 | +feature:"custom_rules",reason:yh,children:(0,S.jsx)(q_,{value:e.inline,placeholder:"fbq\\s*\\(",onChange:e=>l(a,{inline:e})})})}),(0,S.jsx)(V_,{label:(0,r.__)("Script handles","ablocks"),help:(0,r.__)("Comma separated. For a plugin that enqueues its tracker properly.","ablocks"),children:(0,S.jsx)(fh,{feature:"custom_rules",reason:yh,children:(0,S.jsx)(q_,{value:e.handles,onChange:e=>l(a,{handles:e})})})})]},e.id||a))]}),(0,S.jsxs)(B_,{title:(0,r.__)("Embedded content and pixels","ablocks"),description:(0, | |
| 965 | +r.__)("A YouTube embed sets its cookies while the page is still parsing, without running a line of the site’s own JavaScript — which is why blocking every script and leaving the video is not a partial job but a broken one. A blocked embed is replaced by a card offering to load it; a tracking pixel is simply not fetched, because a 1×1 image is not content anyone is missing. Only the providers listed here are ever touched, so a payment form or a captcha cannot be caught by accident.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Block embeds and pixels","ablocks"),help:(0,r.__)("Independent of the script buffer above — a site can hold scripts back and leave its videos alone, or the reverse.","ablocks"),children:(0,S.jsx)($_,{checked:e.embed_gating,onChange:e=>t({embed_gating:e})})}),e.embed_gating&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(kh,{shipped:c,overrides:e.embed_rules,refusable:s,onChange:e=>t({embed_rules:e})}),(0,S.jsx)(kh,{shipped:d,overrides:e.pixel_rules,refusable:s, | |
| 966 | +pickable:!1,onChange:e=>t({pixel_rules:e})})]})]}),(0,S.jsx)(gh,{dryRun:e.dry_run})]})}const xh=(0,r.__)("Pro keeps a server-side log of every decision — when it was made, which policy version and wording were shown, and what was allowed. That is what Art. 7(1) means by being able to demonstrate consent.","ablocks");function wh({settings:e,set:t}){const[n,s]=(0,a.useState)([]),[o,l]=(0,a.useState)(0),[c,d]=(0,a.useState)(!1),u=_h("records"),m=()=>{u&&(d(!0),(0,i.In)({action:"ablocks/cookie_consent/get_records",page:1}).then(e=>{s(e?.data?.data?.records||[]),l(e?.data?.data?.total||0)}).finally(()=>d(!1)))};return(0,a.useEffect)(m,[]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(bh,{feature:"records",title:(0,r.__)("Need to prove consent was given?","ablocks"),body:xh}),(0,S.jsxs)(B_,{title:(0,r.__)("Recording","ablocks"),description:u?(0, | |
| 967 | +r.__)("One row per decision, including changes of mind. Records are exported and erased through WordPress’ own privacy tools for logged-in visitors.","ablocks"):(0,r.__)("Nothing is stored on the server on this plan. The decision still lives in the visitor’s own cookie, and the banner still honours it — there is simply no log of it to show anyone.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Store consent records","ablocks"),children:(0,S.jsx)(fh,{feature:"records",reason:xh,children:(0,S.jsx)($_,{checked:u&&e.record_enabled,onChange:e=>t({record_enabled:e})})})}),(0,S.jsx)(V_,{label:(0,r.__)("Also store IP address","ablocks"),help:(0,r.__)("Off by default. An IP address is personal data and needs its own lawful basis — switching this on makes the record itself something you have to justify.","ablocks"),children:(0,S.jsx)(fh,{feature:"records",reason:xh,children:(0,S.jsx)($_,{checked:u&&e.record_ip,onChange:e=>t({record_ip:e})})})}),(0,S.jsx)(V_,{label:(0, | |
| 968 | +r.__)("Keep records for","ablocks"),help:(0,r.__)("Records older than this are deleted daily. A record kept forever is a record kept without a purpose.","ablocks"),children:(0,S.jsx)(fh,{feature:"records",reason:xh,children:(0,S.jsx)(J_,{value:e.record_retention_days,min:30,max:3650,suffix:(0,r.__)("DAYS","ablocks"),onChange:e=>t({record_retention_days:e})})})})]}),u&&(0,S.jsx)(B_,{title:(0,r.__)("Stored records","ablocks"),description:(0,r.sprintf)(/* translators: %s: number of stored consent records. */ /* translators: %s: number of stored consent records. */ | |
| 968 | 969 | (0,r.__)("%s recorded so far.","ablocks"),o),aside:(0,S.jsxs)("div",{className:"ablocks-cc-section__actions",children:[(0,S.jsx)(Ja,{preset:"gray",label:(0,r.__)("Refresh","ablocks"),onClick:m,isLoading:c}),(0,S.jsx)(Ja,{preset:"gray",label:(0,r.__)("Delete all","ablocks"),onClick:()=>{window.confirm((0,r.__)("Delete every stored consent record? This cannot be undone, and it removes your evidence that consent was given.","ablocks"))&&(0,i.In)({action:"ablocks/cookie_consent/delete_records"}).then(()=>{s([]),l(0)})}})]}),children:0===n.length?(0,S.jsx)("p",{className:"ablocks-cc-empty",children:(0,r.__)("No records yet.","ablocks")}):(0,S.jsxs)("table",{className:"ablocks-cc-table",children:[(0,S.jsx)("thead",{children:(0,S.jsxs)("tr",{children:[(0,S.jsx)("th",{children:(0,r.__)("When","ablocks")}),(0,S.jsx)("th",{children:(0,r.__)("Consent ID","ablocks")}),(0,S.jsx)("th",{children:(0,r.__)("Allowed","ablocks")}),(0,S.jsx)("th",{children:(0,r.__)("Decision","ablocks")}),(0,S.jsx)("th",{ |
| 969 | -children:(0,r.__)("Policy","ablocks")})]})}),(0,S.jsx)("tbody",{children:n.map(e=>(0,S.jsxs)("tr",{children:[(0,S.jsx)("td",{children:e.created_at}),(0,S.jsx)("td",{children:(0,S.jsxs)("code",{children:[e.consent_id.slice(0,12),"…"]})}),(0,S.jsx)("td",{children:e.categories||(0,S.jsx)("em",{children:(0,r.__)("none","ablocks")})}),(0,S.jsx)("td",{children:e.decision}),(0,S.jsxs)("td",{children:["v",e.policy_version]})]},e.id))})]})})]})}function wh({settings:e,set:t,defaults:a}){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(U_,{title:(0,r.__)("Consent cookie","ablocks"),description:(0,r.__)("First-party, read only by the browser. Nothing on the server branches on it while rendering a page — that is what keeps the feature compatible with page caching.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Cookie name","ablocks"),help:(0, | |
| 970 | -r.__)("The shipped name works for every site. Choose your own only if something else on the site already uses it, or your policy names a specific cookie.","ablocks"),children:(0,S.jsx)(X_,{value:"custom"===e.cookie_name_mode?"custom":"default",onChange:e=>t("custom"===e?{cookie_name_mode:e}:{cookie_name_mode:e,cookie_name:a.cookie_name}),options:[{value:"default",label:(0,r.__)("Default","ablocks")},{value:"custom",label:(0,r.__)("Custom","ablocks")}]})}),"custom"===e.cookie_name_mode&&(0,S.jsx)(B_,{label:(0,r.__)("Custom name","ablocks"),help:(0,r.__)("Renaming moves every existing decision across on the visitor’s next page view, and clears the old cookie. Only one rename is carried — change it twice before your visitors return and the older decisions are gone, and everyone is asked again.","ablocks"),children:(0,S.jsx)($_,{value:e.cookie_name,onChange:e=>t({cookie_name:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Remember for","ablocks"),help:(0, | |
| 971 | -r.__)("Applies to decisions made from now on. Cookies already in visitors’ browsers keep the expiry they were written with — to shorten consent that has already been given, use “Ask again after” below.","ablocks"),children:(0,S.jsx)(q_,{value:e.cookie_days,min:1,max:730,suffix:(0,r.__)("DAYS","ablocks"),onChange:e=>t({cookie_days:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Ask again after","ablocks"),help:(0,r.__)("0 means never re-ask on age alone. Unlike the setting above, this applies to decisions already given — set it to 90 and anyone who decided more than 90 days ago is asked again on their next visit. Several regulators expect consent to be refreshed at least every 12 months.","ablocks"),children:(0,S.jsx)(q_,{value:e.reconsent_days,min:0,max:730,suffix:(0,r.__)("DAYS","ablocks"),onChange:e=>t({reconsent_days:e})})})]}),(0,S.jsx)(U_,{title:(0,r.__)("Policy version","ablocks"),description:(0, | |
| 972 | -r.__)("Raising this invalidates every stored decision and shows the banner again. Do it when what you are asking for changes — a new tracker, a new category, materially different wording. It is manual because no heuristic can tell a typo fix from a change of substance.","ablocks"),children:(0,S.jsx)(B_,{label:(0,r.__)("Current version","ablocks"),children:(0,S.jsx)(q_,{value:e.policy_version,min:1,onChange:e=>t({policy_version:e})})})}),(0,S.jsxs)(U_,{title:(0,r.__)("Google Consent Mode v2","ablocks"),description:(0,r.__)("Prints the denied defaults as the first script in the page, then updates them from the decision. This is complementary to blocking, not a substitute — Consent Mode changes what Google’s tags do, blocking stops them loading at all.","ablocks"),children:[(0,S.jsx)(B_,{label:(0,r.__)("Enable Consent Mode","ablocks"),children:(0,S.jsx)(V_,{checked:e.consent_mode,onChange:e=>t({consent_mode:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Wait for update","ablocks"),help:(0, | |
| 973 | -r.__)("How long Google’s tags hold before acting on the defaults, giving the decision time to arrive.","ablocks"),children:(0,S.jsx)(q_,{value:e.consent_mode_wait,min:0,max:5e3,step:100,suffix:"MS",onChange:e=>t({consent_mode_wait:e})})}),(0,S.jsx)(B_,{label:(0,r.__)("Protect ad measurement","ablocks"),help:(0,r.__)("Sends ads_data_redaction and url_passthrough. Google Ads stops receiving ad identifiers while marketing is refused, and carries the click ID in the URL instead of a cookie — so a refusal costs the visitor’s privacy nothing and the site’s conversion reporting much less.","ablocks"),children:(0,S.jsx)(V_,{checked:e.consent_mode_ads,onChange:e=>t({consent_mode_ads:e})})})]}),(0,S.jsx)(U_,{title:(0,r.__)("While you build","ablocks"),description:(0,r.__)("Hiding the banner from administrators makes the site easier to work on, and makes it easy to forget the banner is broken. Turn it off before you launch.","ablocks"),children:(0,S.jsx)(B_,{label:(0, | |
| 974 | -r.__)("Hide from administrators","ablocks"),children:(0,S.jsx)(V_,{checked:e.hide_for_admins,onChange:e=>t({hide_for_admins:e})})})})]})}const Mh=e=>({"--ablocks-cc-bg":e.bg,"--ablocks-cc-text":e.text,"--ablocks-cc-muted":e.muted,"--ablocks-cc-border":e.border,"--ablocks-cc-accent":e.accent,"--ablocks-cc-accent-text":e.accent_text,"--ablocks-cc-secondary-bg":e.secondary_bg,"--ablocks-cc-secondary-text":e.secondary_text,"--ablocks-cc-save-bg":e.save_bg,"--ablocks-cc-save-text":e.save_text,"--ablocks-cc-locked-bg":e.locked_bg,"--ablocks-cc-locked-text":e.locked_text,"--ablocks-cc-radius":`${e.radius}px`,"--ablocks-cc-max-width":`${e.max_width}px`,"--ablocks-cc-prefs-max-width":`${e.prefs_max_width}px`});function Lh({banner:e}){const t=[[e.policy_url,e.policy_label],[e.cookie_policy_url,e.cookie_policy_label]].filter(([e,t])=>e&&t);return t.length?(0,S.jsx)("span",{className:"ablocks-consent__policies",children:t.map(([e,t])=>(0,S.jsx)("a",{className:"ablocks-consent__policy",href:e, | |
| 975 | -onClick:e=>e.preventDefault(),children:t},e))}):null}function jh({cookies:e}){return(0,S.jsx)("div",{className:"ablocks-consent__cookies-scroll",children:(0,S.jsxs)("table",{className:"ablocks-consent__cookies",children:[(0,S.jsx)("thead",{children:(0,S.jsxs)("tr",{children:[(0,S.jsx)("th",{scope:"col",children:(0,r.__)("Cookie","ablocks")}),(0,S.jsx)("th",{scope:"col",children:(0,r.__)("Provider","ablocks")}),(0,S.jsx)("th",{scope:"col",children:(0,r.__)("Expires","ablocks")}),(0,S.jsx)("th",{scope:"col",children:(0,r.__)("Purpose","ablocks")})]})}),(0,S.jsx)("tbody",{children:e.map((e,t)=>(0,S.jsxs)("tr",{children:[(0,S.jsx)("td",{children:(0,S.jsx)("code",{children:e.name})}),(0,S.jsx)("td",{children:e.provider}),(0,S.jsx)("td",{children:e.duration}),(0,S.jsx)("td",{children:e.purpose})]},t))})]})})}function Sh({banner:e,categories:t,onClose:n}){const[s,o]=(0,a.useState)({}),i=e.prefs_accordion,l="checkbox"===e.switch_style,c="badge"===e.locked_style;return(0,S.jsxs)(S.Fragment,{ | |
| 976 | -children:[(0,S.jsxs)("div",{className:"ablocks-consent__prefs-head",children:[(0,S.jsx)("p",{className:"ablocks-consent__prefs-title",children:e.prefs_title}),e.show_close&&(0,S.jsx)("button",{type:"button",className:"ablocks-consent__close","aria-label":(0,r.__)("Close","ablocks"),onClick:n,children:(0,S.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,S.jsx)("path",{d:"M6 6l12 12M18 6L6 18"})})})]}),(0,S.jsxs)("div",{className:"ablocks-consent__prefs-intro",children:[(0,S.jsx)("div",{dangerouslySetInnerHTML:{__html:e.prefs_intro}}),(0,S.jsx)(Lh,{banner:e})]}),(0,S.jsx)("ul",{className:"ablocks-consent__cats",children:t.map((t,a)=>{const n=e.show_cookie_table&&t.cookies?t.cookies:[],r=!!t.description||!!n.length,d=i&&r,u=!d||(s[t.slug]??(e.prefs_open_first&&0===a));return(0,S.jsxs)("li",{ | |
| 970 | +children:(0,r.__)("Policy","ablocks")})]})}),(0,S.jsx)("tbody",{children:n.map(e=>(0,S.jsxs)("tr",{children:[(0,S.jsx)("td",{children:e.created_at}),(0,S.jsx)("td",{children:(0,S.jsxs)("code",{children:[e.consent_id.slice(0,12),"…"]})}),(0,S.jsx)("td",{children:e.categories||(0,S.jsx)("em",{children:(0,r.__)("none","ablocks")})}),(0,S.jsx)("td",{children:e.decision}),(0,S.jsxs)("td",{children:["v",e.policy_version]})]},e.id))})]})})]})}function Mh({settings:e,set:t,defaults:a}){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(B_,{title:(0,r.__)("Consent cookie","ablocks"),description:(0,r.__)("First-party, read only by the browser. Nothing on the server branches on it while rendering a page — that is what keeps the feature compatible with page caching.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Cookie name","ablocks"),help:(0, | |
| 971 | +r.__)("The shipped name works for every site. Choose your own only if something else on the site already uses it, or your policy names a specific cookie.","ablocks"),children:(0,S.jsx)(Z_,{value:"custom"===e.cookie_name_mode?"custom":"default",onChange:e=>t("custom"===e?{cookie_name_mode:e}:{cookie_name_mode:e,cookie_name:a.cookie_name}),options:[{value:"default",label:(0,r.__)("Default","ablocks")},{value:"custom",label:(0,r.__)("Custom","ablocks")}]})}),"custom"===e.cookie_name_mode&&(0,S.jsx)(V_,{label:(0,r.__)("Custom name","ablocks"),help:(0,r.__)("Renaming moves every existing decision across on the visitor’s next page view, and clears the old cookie. Only one rename is carried — change it twice before your visitors return and the older decisions are gone, and everyone is asked again.","ablocks"),children:(0,S.jsx)(q_,{value:e.cookie_name,onChange:e=>t({cookie_name:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Remember for","ablocks"),help:(0, | |
| 972 | +r.__)("Applies to decisions made from now on. Cookies already in visitors’ browsers keep the expiry they were written with — to shorten consent that has already been given, use “Ask again after” below.","ablocks"),children:(0,S.jsx)(J_,{value:e.cookie_days,min:1,max:730,suffix:(0,r.__)("DAYS","ablocks"),onChange:e=>t({cookie_days:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Ask again after","ablocks"),help:(0,r.__)("0 means never re-ask on age alone. Unlike the setting above, this applies to decisions already given — set it to 90 and anyone who decided more than 90 days ago is asked again on their next visit. Several regulators expect consent to be refreshed at least every 12 months.","ablocks"),children:(0,S.jsx)(J_,{value:e.reconsent_days,min:0,max:730,suffix:(0,r.__)("DAYS","ablocks"),onChange:e=>t({reconsent_days:e})})})]}),(0,S.jsx)(B_,{title:(0,r.__)("Policy version","ablocks"),description:(0, | |
| 973 | +r.__)("Raising this invalidates every stored decision and shows the banner again. Do it when what you are asking for changes — a new tracker, a new category, materially different wording. It is manual because no heuristic can tell a typo fix from a change of substance.","ablocks"),children:(0,S.jsx)(V_,{label:(0,r.__)("Current version","ablocks"),children:(0,S.jsx)(J_,{value:e.policy_version,min:1,onChange:e=>t({policy_version:e})})})}),(0,S.jsxs)(B_,{title:(0,r.__)("Google Consent Mode v2","ablocks"),description:(0,r.__)("Prints the denied defaults as the first script in the page, then updates them from the decision. This is complementary to blocking, not a substitute — Consent Mode changes what Google’s tags do, blocking stops them loading at all.","ablocks"),children:[(0,S.jsx)(V_,{label:(0,r.__)("Enable Consent Mode","ablocks"),children:(0,S.jsx)($_,{checked:e.consent_mode,onChange:e=>t({consent_mode:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Wait for update","ablocks"),help:(0, | |
| 974 | +r.__)("How long Google’s tags hold before acting on the defaults, giving the decision time to arrive.","ablocks"),children:(0,S.jsx)(J_,{value:e.consent_mode_wait,min:0,max:5e3,step:100,suffix:"MS",onChange:e=>t({consent_mode_wait:e})})}),(0,S.jsx)(V_,{label:(0,r.__)("Protect ad measurement","ablocks"),help:(0,r.__)("Sends ads_data_redaction and url_passthrough. Google Ads stops receiving ad identifiers while marketing is refused, and carries the click ID in the URL instead of a cookie — so a refusal costs the visitor’s privacy nothing and the site’s conversion reporting much less.","ablocks"),children:(0,S.jsx)($_,{checked:e.consent_mode_ads,onChange:e=>t({consent_mode_ads:e})})})]}),(0,S.jsx)(B_,{title:(0,r.__)("While you build","ablocks"),description:(0,r.__)("Hiding the banner from administrators makes the site easier to work on, and makes it easy to forget the banner is broken. Turn it off before you launch.","ablocks"),children:(0,S.jsx)(V_,{label:(0, | |
| 975 | +r.__)("Hide from administrators","ablocks"),children:(0,S.jsx)($_,{checked:e.hide_for_admins,onChange:e=>t({hide_for_admins:e})})})})]})}const Lh=e=>({"--ablocks-cc-bg":e.bg,"--ablocks-cc-text":e.text,"--ablocks-cc-muted":e.muted,"--ablocks-cc-border":e.border,"--ablocks-cc-accent":e.accent,"--ablocks-cc-accent-text":e.accent_text,"--ablocks-cc-secondary-bg":e.secondary_bg,"--ablocks-cc-secondary-text":e.secondary_text,"--ablocks-cc-save-bg":e.save_bg,"--ablocks-cc-save-text":e.save_text,"--ablocks-cc-locked-bg":e.locked_bg,"--ablocks-cc-locked-text":e.locked_text,"--ablocks-cc-radius":`${e.radius}px`,"--ablocks-cc-max-width":`${e.max_width}px`,"--ablocks-cc-prefs-max-width":`${e.prefs_max_width}px`});function jh({banner:e}){const t=[[e.policy_url,e.policy_label],[e.cookie_policy_url,e.cookie_policy_label]].filter(([e,t])=>e&&t);return t.length?(0,S.jsx)("span",{className:"ablocks-consent__policies",children:t.map(([e,t])=>(0,S.jsx)("a",{className:"ablocks-consent__policy",href:e, | |
| 976 | +onClick:e=>e.preventDefault(),children:t},e))}):null}function Sh({cookies:e}){return(0,S.jsx)("div",{className:"ablocks-consent__cookies-scroll",children:(0,S.jsxs)("table",{className:"ablocks-consent__cookies",children:[(0,S.jsx)("thead",{children:(0,S.jsxs)("tr",{children:[(0,S.jsx)("th",{scope:"col",children:(0,r.__)("Cookie","ablocks")}),(0,S.jsx)("th",{scope:"col",children:(0,r.__)("Provider","ablocks")}),(0,S.jsx)("th",{scope:"col",children:(0,r.__)("Expires","ablocks")}),(0,S.jsx)("th",{scope:"col",children:(0,r.__)("Purpose","ablocks")})]})}),(0,S.jsx)("tbody",{children:e.map((e,t)=>(0,S.jsxs)("tr",{children:[(0,S.jsx)("td",{children:(0,S.jsx)("code",{children:e.name})}),(0,S.jsx)("td",{children:e.provider}),(0,S.jsx)("td",{children:e.duration}),(0,S.jsx)("td",{children:e.purpose})]},t))})]})})}function Yh({banner:e,categories:t,onClose:n}){const[s,o]=(0,a.useState)({}),i=e.prefs_accordion,l="checkbox"===e.switch_style,c="badge"===e.locked_style;return(0,S.jsxs)(S.Fragment,{ | |
| 977 | +children:[(0,S.jsxs)("div",{className:"ablocks-consent__prefs-head",children:[(0,S.jsx)("p",{className:"ablocks-consent__prefs-title",children:e.prefs_title}),e.show_close&&(0,S.jsx)("button",{type:"button",className:"ablocks-consent__close","aria-label":(0,r.__)("Close","ablocks"),onClick:n,children:(0,S.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,S.jsx)("path",{d:"M6 6l12 12M18 6L6 18"})})})]}),(0,S.jsxs)("div",{className:"ablocks-consent__prefs-intro",children:[(0,S.jsx)("div",{dangerouslySetInnerHTML:{__html:e.prefs_intro}}),(0,S.jsx)(jh,{banner:e})]}),(0,S.jsx)("ul",{className:"ablocks-consent__cats",children:t.map((t,a)=>{const n=e.show_cookie_table&&t.cookies?t.cookies:[],r=!!t.description||!!n.length,d=i&&r,u=!d||(s[t.slug]??(e.prefs_open_first&&0===a));return(0,S.jsxs)("li",{ | |
| 977 | 978 | className:["ablocks-consent__cat",d?"is-collapsible":"",d&&u?"is-open":""].filter(Boolean).join(" "),children:[(0,S.jsxs)("div",{className:"ablocks-consent__cat-head",children:[d?(0,S.jsxs)("button",{type:"button",className:"ablocks-consent__cat-toggle","aria-expanded":u,onClick:()=>o(e=>({...e,[t.slug]:!u})),children:[(0,S.jsx)("span",{className:"ablocks-consent__cat-arrow","aria-hidden":"true",children:(0,S.jsx)("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:(0,S.jsx)("path",{d:"M9 6l6 6-6 6"})})}),(0,S.jsx)("span",{className:"ablocks-consent__cat-label",children:t.label})]}):(0,S.jsx)("span",{className:"ablocks-consent__cat-label",children:t.label}),t.locked?(0,S.jsx)("span",{className:"ablocks-consent__cat-locked"+(c?" is-badge":""),children:e.locked_label}):(0,S.jsxs)("label",{className:"ablocks-consent__switch"+(l?" ablocks-consent__switch--checkbox":""),children:[(0, |
| 978 | -S.jsx)("input",{type:"checkbox","aria-label":t.label,readOnly:!0}),(0,S.jsx)("span",{className:l?"ablocks-consent__switch-box":"ablocks-consent__switch-track","aria-hidden":"true"})]})]}),r&&u&&(0,S.jsxs)("div",{className:"ablocks-consent__cat-panel",children:[t.description&&(0,S.jsx)("p",{className:"ablocks-consent__cat-desc",children:t.description}),!!n.length&&(0,S.jsx)(jh,{cookies:n})]})]},t.slug)})}),(0,S.jsxs)("div",{className:"ablocks-consent__prefs-actions",children:[e.show_prefs_reject&&(0,S.jsx)("button",{type:"button",className:"ablocks-consent__btn ablocks-consent__btn--secondary",children:e.reject_label}),(0,S.jsx)("button",{type:"button",className:"ablocks-consent__btn ablocks-consent__btn--save",children:e.save_label}),e.show_prefs_accept&&(0,S.jsx)("button",{type:"button",className:"ablocks-consent__btn ablocks-consent__btn--primary",children:e.prefs_accept_label})]})]})}function Yh({banner:e,categories:t}){const[n,s]=(0, | |
| 979 | -a.useState)(!1),o=t.filter(e=>e.enabled),i="modal"===e.prefs_layout,l=!n||i;return(0,S.jsxs)("div",{className:"ablocks-cc-preview",children:[(0,S.jsxs)("div",{className:"ablocks-cc-preview__head",children:[(0,S.jsx)("span",{children:(0,r.__)("Preview","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-cc-preview__toggle",children:[(0,S.jsx)("button",{type:"button",className:n?"":"is-active",onClick:()=>s(!1),children:(0,r.__)("Banner","ablocks")}),(0,S.jsx)("button",{type:"button",className:n?"is-active":"",onClick:()=>s(!0),children:(0,r.__)("Preferences","ablocks")})]})]}),(0,S.jsxs)("div",{className:"ablocks-cc-preview__stage",children:[(0,S.jsxs)("div",{className:["ablocks-consent","is-visible",`ablocks-consent--${e.layout}`,`ablocks-consent--${e.position}`,e.shadow?"has-shadow":"",n&&!i?"is-prefs-open":""].filter(Boolean).join(" "),style:Mh(e),children:[e.overlay&&(0,S.jsx)("div",{className:"ablocks-consent__overlay"}),(0,S.jsxs)("div",{ | |
| 980 | -className:"ablocks-consent__panel"+(e.show_banner_close?" has-close":""),children:[e.show_banner_close&&(0,S.jsx)("button",{type:"button",className:"ablocks-consent__close ablocks-consent__close--banner","aria-label":(0,r.__)("Close without accepting","ablocks"),children:(0,S.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,S.jsx)("path",{d:"M6 6l12 12M18 6L6 18"})})}),l&&(0,S.jsxs)("div",{className:"ablocks-consent__main",children:[(0,S.jsxs)("div",{className:"ablocks-consent__body",children:[e.title&&(0,S.jsx)("p",{className:"ablocks-consent__title",children:e.title}),(0,S.jsxs)("div",{className:"ablocks-consent__message",children:[(0,S.jsx)("p",{children:e.message}),(0,S.jsx)(Lh,{banner:e})]})]}),(0,S.jsxs)("div",{className:"ablocks-consent__actions",children:[e.show_settings&&(0,S.jsx)("button",{type:"button", | |
| 981 | -className:`ablocks-consent__btn ablocks-consent__btn--${"solid"===e.settings_style?"secondary":e.settings_style}`,onClick:()=>s(!0),children:e.settings_label}),e.show_reject&&(0,S.jsx)("button",{type:"button",className:"ablocks-consent__btn ablocks-consent__btn--secondary",children:e.reject_label}),(0,S.jsx)("button",{type:"button",className:"ablocks-consent__btn ablocks-consent__btn--primary",children:e.accept_label})]})]}),n&&!i&&(0,S.jsx)("div",{className:"ablocks-consent__prefs",children:(0,S.jsx)(Sh,{banner:e,categories:o,onClose:()=>s(!1)})})]})]}),n&&i&&(0,S.jsxs)("div",{className:["ablocks-consent","ablocks-consent-modal","ablocks-consent--center","is-visible",e.shadow?"has-shadow":""].filter(Boolean).join(" "),style:Mh(e),children:[(0,S.jsx)("div",{className:"ablocks-consent__overlay"}),(0,S.jsx)("div",{className:"ablocks-consent__panel",children:(0,S.jsx)("div",{className:"ablocks-consent__prefs",children:(0,S.jsx)(Sh,{banner:e,categories:o,onClose:()=>s(!1)})})})] | |
| 982 | -}),e.reopen&&(0,S.jsxs)("button",{type:"button",className:`ablocks-consent-reopen ablocks-consent-reopen--${e.reopen_position}`,style:Mh(e),children:[(0,S.jsx)("span",{className:"ablocks-consent-reopen__icon",children:(0,S.jsxs)("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,S.jsx)("path",{d:"M21.5 12a9.5 9.5 0 1 1-6.2-8.9 3.2 3.2 0 0 0 3.4 4.3 3.2 3.2 0 0 0 2.6 3.9c.1.2.2.5.2.7Z"}),(0,S.jsx)("circle",{cx:"9",cy:"10",r:"1",fill:"currentColor",stroke:"none"}),(0,S.jsx)("circle",{cx:"14.5",cy:"15",r:"1",fill:"currentColor",stroke:"none"}),(0,S.jsx)("circle",{cx:"8.5",cy:"15.5",r:"1",fill:"currentColor",stroke:"none"})]})}),(0,S.jsx)("span",{className:"ablocks-consent-reopen__label",children:e.reopen_label})]})]})]})}const Dh=[{key:"tag_gtm",label:(0,r.__)("Google Tag Manager","ablocks")},{key:"tag_ga4",label:(0,r.__)("Google Analytics 4","ablocks")},{key:"tag_meta_pixel",label:(0, | |
| 983 | -r.__)("Meta Pixel","ablocks")}],Th=[{name:"banner",title:(0,r.__)("Banner","ablocks")},{name:"categories",title:(0,r.__)("Categories","ablocks")},{name:"blocking",title:(0,r.__)("Script blocking","ablocks")},{name:"records",title:(0,r.__)("Records","ablocks")},{name:"advanced",title:(0,r.__)("Advanced","ablocks")}];function Ch(){const e=i.kg||{},t=e.defaults||{},n=e.tag_providers||{},[s,o]=(0,a.useState)(e.settings||null),[l,c]=(0,a.useState)("banner"),[d,u]=(0,a.useState)(!1),[m,_]=(0,a.useState)(!1),h=w();if((0,a.useEffect)(()=>{s||(0,i.In)({action:"ablocks/cookie_consent/get_settings"}).then(e=>o(e?.data?.data||null))},[]),!s)return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsx)("div",{className:"ablocks-page-content",children:(0,S.jsx)("p",{children:(0,r.__)("Loading…","ablocks")})})]});const p=e=>{o({...s,...e}),u(!0)},f=e=>{o({...s,banner:{...s.banner,...e}}),u(!0)},b=()=>{_(!0),(0,i.In)({action:"ablocks/cookie_consent/save_settings",...s}).then(e=>{ | |
| 984 | -e?.data?.success?(o(e.data.data),u(!1),h(wt({message:(0,r.__)("Settings saved.","ablocks"),isShow:!0,type:"success"}))):h(wt({message:(0,r.__)("Could not save those settings.","ablocks"),isShow:!0,type:"error"}))}).finally(()=>_(!1))},g="banner"===l||"categories"===l,y=Dh.filter(e=>""!==(s[e.key]||"").trim()).map(e=>({...e,value:s[e.key].trim(),provider:n[e.key]?.name||""})),k=s.enabled&&"optin"===s.mode&&oh(s.banner);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{render:()=>(0,S.jsx)("div",{className:"ablocks-settings-topbar",children:(0,S.jsx)(Ja,{preset:d?"purple":"gray",label:(0,r.__)("Save","ablocks"),onClick:b,isDisabled:!d,isLoading:m})})}),(0,S.jsxs)("div",{className:"ablocks-page-content ablocks-page-content--cookie-consent",children:[(0,S.jsxs)("div",{className:"ablocks-cc-head",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("h3",{className:"ablocks-heading",children:(0,r.__)("Cookie Consent","ablocks")}),(0,S.jsx)("p",{className:"ablocks-cc-head__note",children:(0, | |
| 979 | +S.jsx)("input",{type:"checkbox","aria-label":t.label,readOnly:!0}),(0,S.jsx)("span",{className:l?"ablocks-consent__switch-box":"ablocks-consent__switch-track","aria-hidden":"true"})]})]}),r&&u&&(0,S.jsxs)("div",{className:"ablocks-consent__cat-panel",children:[t.description&&(0,S.jsx)("p",{className:"ablocks-consent__cat-desc",children:t.description}),!!n.length&&(0,S.jsx)(Sh,{cookies:n})]})]},t.slug)})}),(0,S.jsxs)("div",{className:"ablocks-consent__prefs-actions",children:[e.show_prefs_reject&&(0,S.jsx)("button",{type:"button",className:"ablocks-consent__btn ablocks-consent__btn--secondary",children:e.reject_label}),(0,S.jsx)("button",{type:"button",className:"ablocks-consent__btn ablocks-consent__btn--save",children:e.save_label}),e.show_prefs_accept&&(0,S.jsx)("button",{type:"button",className:"ablocks-consent__btn ablocks-consent__btn--primary",children:e.prefs_accept_label})]})]})}function Dh({banner:e,categories:t}){const[n,s]=(0, | |
| 980 | +a.useState)(!1),o=t.filter(e=>e.enabled),i="modal"===e.prefs_layout,l=!n||i;return(0,S.jsxs)("div",{className:"ablocks-cc-preview",children:[(0,S.jsxs)("div",{className:"ablocks-cc-preview__head",children:[(0,S.jsx)("span",{children:(0,r.__)("Preview","ablocks")}),(0,S.jsxs)("div",{className:"ablocks-cc-preview__toggle",children:[(0,S.jsx)("button",{type:"button",className:n?"":"is-active",onClick:()=>s(!1),children:(0,r.__)("Banner","ablocks")}),(0,S.jsx)("button",{type:"button",className:n?"is-active":"",onClick:()=>s(!0),children:(0,r.__)("Preferences","ablocks")})]})]}),(0,S.jsxs)("div",{className:"ablocks-cc-preview__stage",children:[(0,S.jsxs)("div",{className:["ablocks-consent","is-visible",`ablocks-consent--${e.layout}`,`ablocks-consent--${e.position}`,e.shadow?"has-shadow":"",n&&!i?"is-prefs-open":""].filter(Boolean).join(" "),style:Lh(e),children:[e.overlay&&(0,S.jsx)("div",{className:"ablocks-consent__overlay"}),(0,S.jsxs)("div",{ | |
| 981 | +className:"ablocks-consent__panel"+(e.show_banner_close?" has-close":""),children:[e.show_banner_close&&(0,S.jsx)("button",{type:"button",className:"ablocks-consent__close ablocks-consent__close--banner","aria-label":(0,r.__)("Close without accepting","ablocks"),children:(0,S.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,S.jsx)("path",{d:"M6 6l12 12M18 6L6 18"})})}),l&&(0,S.jsxs)("div",{className:"ablocks-consent__main",children:[(0,S.jsxs)("div",{className:"ablocks-consent__body",children:[e.title&&(0,S.jsx)("p",{className:"ablocks-consent__title",children:e.title}),(0,S.jsxs)("div",{className:"ablocks-consent__message",children:[(0,S.jsx)("p",{children:e.message}),(0,S.jsx)(jh,{banner:e})]})]}),(0,S.jsxs)("div",{className:"ablocks-consent__actions",children:[e.show_settings&&(0,S.jsx)("button",{type:"button", | |
| 982 | +className:`ablocks-consent__btn ablocks-consent__btn--${"solid"===e.settings_style?"secondary":e.settings_style}`,onClick:()=>s(!0),children:e.settings_label}),e.show_reject&&(0,S.jsx)("button",{type:"button",className:"ablocks-consent__btn ablocks-consent__btn--secondary",children:e.reject_label}),(0,S.jsx)("button",{type:"button",className:"ablocks-consent__btn ablocks-consent__btn--primary",children:e.accept_label})]})]}),n&&!i&&(0,S.jsx)("div",{className:"ablocks-consent__prefs",children:(0,S.jsx)(Yh,{banner:e,categories:o,onClose:()=>s(!1)})})]})]}),n&&i&&(0,S.jsxs)("div",{className:["ablocks-consent","ablocks-consent-modal","ablocks-consent--center","is-visible",e.shadow?"has-shadow":""].filter(Boolean).join(" "),style:Lh(e),children:[(0,S.jsx)("div",{className:"ablocks-consent__overlay"}),(0,S.jsx)("div",{className:"ablocks-consent__panel",children:(0,S.jsx)("div",{className:"ablocks-consent__prefs",children:(0,S.jsx)(Yh,{banner:e,categories:o,onClose:()=>s(!1)})})})] | |
| 983 | +}),e.reopen&&(0,S.jsxs)("button",{type:"button",className:`ablocks-consent-reopen ablocks-consent-reopen--${e.reopen_position}`,style:Lh(e),children:[(0,S.jsx)("span",{className:"ablocks-consent-reopen__icon",children:(0,S.jsxs)("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,S.jsx)("path",{d:"M21.5 12a9.5 9.5 0 1 1-6.2-8.9 3.2 3.2 0 0 0 3.4 4.3 3.2 3.2 0 0 0 2.6 3.9c.1.2.2.5.2.7Z"}),(0,S.jsx)("circle",{cx:"9",cy:"10",r:"1",fill:"currentColor",stroke:"none"}),(0,S.jsx)("circle",{cx:"14.5",cy:"15",r:"1",fill:"currentColor",stroke:"none"}),(0,S.jsx)("circle",{cx:"8.5",cy:"15.5",r:"1",fill:"currentColor",stroke:"none"})]})}),(0,S.jsx)("span",{className:"ablocks-consent-reopen__label",children:e.reopen_label})]})]})]})}const Th=[{key:"tag_gtm",label:(0,r.__)("Google Tag Manager","ablocks")},{key:"tag_ga4",label:(0,r.__)("Google Analytics 4","ablocks")},{key:"tag_meta_pixel",label:(0, | |
| 984 | +r.__)("Meta Pixel","ablocks")}],Ch=[{name:"banner",title:(0,r.__)("Banner","ablocks")},{name:"categories",title:(0,r.__)("Categories","ablocks")},{name:"blocking",title:(0,r.__)("Script blocking","ablocks")},{name:"records",title:(0,r.__)("Records","ablocks")},{name:"advanced",title:(0,r.__)("Advanced","ablocks")}];function Nh(){const e=i.kg||{},t=e.defaults||{},n=e.tag_providers||{},[s,o]=(0,a.useState)(e.settings||null),[l,c]=(0,a.useState)("banner"),[d,u]=(0,a.useState)(!1),[m,_]=(0,a.useState)(!1),h=w();if((0,a.useEffect)(()=>{s||(0,i.In)({action:"ablocks/cookie_consent/get_settings"}).then(e=>o(e?.data?.data||null))},[]),!s)return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsx)("div",{className:"ablocks-page-content",children:(0,S.jsx)("p",{children:(0,r.__)("Loading…","ablocks")})})]});const p=e=>{o({...s,...e}),u(!0)},f=e=>{o({...s,banner:{...s.banner,...e}}),u(!0)},b=()=>{_(!0),(0,i.In)({action:"ablocks/cookie_consent/save_settings",...s}).then(e=>{ | |
| 985 | +e?.data?.success?(o(e.data.data),u(!1),h(wt({message:(0,r.__)("Settings saved.","ablocks"),isShow:!0,type:"success"}))):h(wt({message:(0,r.__)("Could not save those settings.","ablocks"),isShow:!0,type:"error"}))}).finally(()=>_(!1))},g="banner"===l||"categories"===l,y=Th.filter(e=>""!==(s[e.key]||"").trim()).map(e=>({...e,value:s[e.key].trim(),provider:n[e.key]?.name||""})),k=s.enabled&&"optin"===s.mode&&ih(s.banner);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{render:()=>(0,S.jsx)("div",{className:"ablocks-settings-topbar",children:(0,S.jsx)(Ja,{preset:d?"purple":"gray",label:(0,r.__)("Save","ablocks"),onClick:b,isDisabled:!d,isLoading:m})})}),(0,S.jsxs)("div",{className:"ablocks-page-content ablocks-page-content--cookie-consent",children:[(0,S.jsxs)("div",{className:"ablocks-cc-head",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("h3",{className:"ablocks-heading",children:(0,r.__)("Cookie Consent","ablocks")}),(0,S.jsx)("p",{className:"ablocks-cc-head__note",children:(0, | |
| 985 | 986 | r.__)("This blocks scripts before consent, records decisions, and speaks Google Consent Mode v2. Whether a given configuration satisfies GDPR, ePrivacy or a US state law is a question for you and your counsel — the feature makes a compliant setup possible, it does not certify one.","ablocks")})]}),!s.enabled&&(0,S.jsx)("span",{className:"ablocks-cc-pill ablocks-cc-pill--warn",children:(0,r.__)("Banner switched off","ablocks")})]}),y.length>0&&(0,S.jsxs)("div",{className:"ablocks-cc-alert ablocks-cc-alert--info",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("strong",{children:(0,r.__)("aBlocks no longer adds tracking tags","ablocks")}),(0,S.jsx)("p",{children:(0,r.__)("Site Kit and Meta’s own plugin place these, and keep up with ID formats this never accepted. Blocking them until consent has not changed and does not depend on the tag being added here — the Script blocking tab catches them wherever they come from.","ablocks")}),(0,S.jsx)("ul",{className:"ablocks-cc-alert__list", |
| 986 | 987 | children:y.map(e=>(0,S.jsxs)("li",{children:[(0,S.jsx)("strong",{children:e.label})," ",(0,S.jsx)("code",{children:e.value})," ",e.provider?(0,r.sprintf)(/* translators: %s: name of the plugin already placing this tag. */ /* translators: %s: name of the plugin already placing this tag. */ |
| 987 | 988 | (0,r.__)("— not being printed, because %s already places it. Safe to clear.","ablocks"),e.provider):(0,r.__)("— still printed by aBlocks. Add it in the plugin that owns it first, then clear this.","ablocks")]},e.key))})]}),(0,S.jsx)(Ja,{preset:"gray",label:(0,r.__)("Clear these","ablocks"),onClick:()=>p({tag_gtm:"",tag_ga4:"",tag_meta_pixel:""})})]}),k&&(0,S.jsxs)("div",{className:"ablocks-cc-alert",role:"alert",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("strong",{children:(0,r.__)("The banner cannot be refused","ablocks")}),(0,S.jsx)("p",{children:(0,r.__)("Reject, Preferences and the close button are all switched off, so Accept is the only thing a visitor can do — on every page, with no way past it. Scripts are being blocked correctly until they accept, which makes this the one thing standing between this setup and a working one.","ablocks")})]}),(0,S.jsx)(Ja,{preset:"purple",label:(0,r.__)("Turn on “Reject all”","ablocks"),onClick:()=>f({show_reject:!0})})]}),(0,S.jsxs)("div",{ |
| 988 | -className:"ablocks-cc-tabs",children:[Th.map(e=>(0,S.jsx)("button",{type:"button",className:"ablocks-cc-tabs__item"+(l===e.name?" is-active":""),onClick:()=>c(e.name),children:e.title},e.name)),(0,S.jsxs)("label",{className:"ablocks-cc-tabs__enable",htmlFor:"ablocks-cc-enabled",children:[(0,S.jsx)("input",{id:"ablocks-cc-enabled",type:"checkbox",checked:!!s.enabled,onChange:e=>p({enabled:e.target.checked})}),(0,r.__)("Show the banner","ablocks")]})]}),(0,S.jsxs)("div",{className:"ablocks-cc-layout"+(g?" has-preview":""),children:[(0,S.jsx)("div",{className:"ablocks-cc-main",children:(()=>{switch(l){case"categories":return(0,S.jsx)(dh,{categories:s.categories,setCategories:e=>p({categories:e})});case"blocking":return(0,S.jsx)(kh,{settings:s,set:p,categories:s.categories,embedDefaults:e.embed_defaults||{}});case"records":return(0,S.jsx)(xh,{settings:s,set:p});case"advanced":return(0,S.jsx)(wh,{settings:s,set:p,defaults:t});default:return(0,S.jsx)(ih,{banner:s.banner,set:f})}})()}),g&&(0, | |
| 989 | -S.jsx)("div",{className:"ablocks-cc-aside",children:(0,S.jsx)(Yh,{banner:s.banner,categories:s.categories})})]})]})]})}const Nh=2*Math.PI*61,Eh=({value:e,grade:t,loading:a})=>{const n=Math.max(0,Math.min(100,Number(e)||0)),s=Nh-n/100*Nh;let o="is-critical";return n>=90?o="is-good":n>=60&&(o="is-warning"),(0,S.jsxs)("div",{className:`ablocks-score-dial ${o}`,children:[(0,S.jsxs)("svg",{width:132,height:132,viewBox:"0 0 132 132",role:"img","aria-label":`${(0,r.__)("Site score","ablocks")}: ${n}`,children:[(0,S.jsx)("circle",{className:"ablocks-score-dial__track",cx:66,cy:66,r:61,strokeWidth:10,fill:"none"}),(0,S.jsx)("circle",{className:"ablocks-score-dial__value",cx:66,cy:66,r:61,strokeWidth:10,fill:"none",strokeLinecap:"round",strokeDasharray:Nh,strokeDashoffset:a?Nh:s,transform:"rotate(-90 66 66)"})]}),(0,S.jsxs)("div",{className:"ablocks-score-dial__center",children:[(0,S.jsx)("span",{className:"ablocks-score-dial__number",children:a?"—":n}),(0,S.jsx)("span",{ | |
| 990 | -className:"ablocks-score-dial__grade",children:a?(0,r.__)("scanning","ablocks"):t})]})]})};Eh.propTypes={value:Aa().number,grade:Aa().string,loading:Aa().bool};const Oh=Eh,Ah={critical:(0,r.__)("Needs attention","ablocks"),warning:(0,r.__)("Could be better","ablocks"),info:(0,r.__)("Worth knowing","ablocks"),good:(0,r.__)("All good","ablocks")},Ph={caching:(0,r.__)("Caching","ablocks"),images:(0,r.__)("Images","ablocks"),fonts:(0,r.__)("Fonts","ablocks"),assets:(0,r.__)("Assets","ablocks"),design:(0,r.__)("Design consistency","ablocks"),seo:(0,r.__)("Search & accessibility","ablocks"),server:(0,r.__)("Server & WordPress","ablocks"),general:(0,r.__)("General","ablocks")},Hh=[{id:"1x",name:(0,r.__)("Gentle","ablocks"),saving:(0,r.__)("about a quarter smaller","ablocks"),desc:(0,r.__)("No visible change. Safe for photography portfolios.","ablocks")},{id:"2x",name:(0,r.__)("Balanced","ablocks"),saving:(0,r.__)("about half the size","ablocks"),desc:(0, | |
| 991 | -r.__)("The right choice for almost every site.","ablocks")},{id:"5x",name:(0,r.__)("Aggressive","ablocks"),saving:(0,r.__)("about a third of the size","ablocks"),desc:(0,r.__)("Smallest files. Slight softening on detailed photos.","ablocks")}],Rh=[{name:"overview",title:(0,r.__)("Overview","ablocks"),component:()=>{const e=w(),[t,n]=(0,a.useState)(null),[s,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)(""),[d,u]=(0,a.useState)("issues"),m=(t,a="success")=>e(wt({message:t,isShow:!0,type:a})),_=()=>{o(!0),(0,i.In)({action:"ablocks/run_scanner"}).then(e=>n(e?.data?.data||null)).catch(()=>m((0,r.__)("The scan could not finish.","ablocks"),"error")).finally(()=>o(!1))};(0,a.useEffect)(()=>{_()},[]);const h=(e,t)=>{c(e),(0,i.In)({action:"ablocks/scanner_dismiss",id:e,dismiss:t?1:0}).then(e=>n(e?.data?.data?.report||null)).catch(()=>m((0,r.__)("Could not update that check.","ablocks"),"error")).finally(()=>c(""))},p=(0, | |
| 989 | +className:"ablocks-cc-tabs",children:[Ch.map(e=>(0,S.jsx)("button",{type:"button",className:"ablocks-cc-tabs__item"+(l===e.name?" is-active":""),onClick:()=>c(e.name),children:e.title},e.name)),(0,S.jsxs)("label",{className:"ablocks-cc-tabs__enable",htmlFor:"ablocks-cc-enabled",children:[(0,S.jsx)("input",{id:"ablocks-cc-enabled",type:"checkbox",checked:!!s.enabled,onChange:e=>p({enabled:e.target.checked})}),(0,r.__)("Show the banner","ablocks")]})]}),(0,S.jsxs)("div",{className:"ablocks-cc-layout"+(g?" has-preview":""),children:[(0,S.jsx)("div",{className:"ablocks-cc-main",children:(()=>{switch(l){case"categories":return(0,S.jsx)(uh,{categories:s.categories,setCategories:e=>p({categories:e})});case"blocking":return(0,S.jsx)(vh,{settings:s,set:p,categories:s.categories,embedDefaults:e.embed_defaults||{}});case"records":return(0,S.jsx)(wh,{settings:s,set:p});case"advanced":return(0,S.jsx)(Mh,{settings:s,set:p,defaults:t});default:return(0,S.jsx)(lh,{banner:s.banner,set:f})}})()}),g&&(0, | |
| 990 | +S.jsx)("div",{className:"ablocks-cc-aside",children:(0,S.jsx)(Dh,{banner:s.banner,categories:s.categories})})]})]})]})}const Eh=2*Math.PI*61,Oh=({value:e,grade:t,loading:a})=>{const n=Math.max(0,Math.min(100,Number(e)||0)),s=Eh-n/100*Eh;let o="is-critical";return n>=90?o="is-good":n>=60&&(o="is-warning"),(0,S.jsxs)("div",{className:`ablocks-score-dial ${o}`,children:[(0,S.jsxs)("svg",{width:132,height:132,viewBox:"0 0 132 132",role:"img","aria-label":`${(0,r.__)("Site score","ablocks")}: ${n}`,children:[(0,S.jsx)("circle",{className:"ablocks-score-dial__track",cx:66,cy:66,r:61,strokeWidth:10,fill:"none"}),(0,S.jsx)("circle",{className:"ablocks-score-dial__value",cx:66,cy:66,r:61,strokeWidth:10,fill:"none",strokeLinecap:"round",strokeDasharray:Eh,strokeDashoffset:a?Eh:s,transform:"rotate(-90 66 66)"})]}),(0,S.jsxs)("div",{className:"ablocks-score-dial__center",children:[(0,S.jsx)("span",{className:"ablocks-score-dial__number",children:a?"—":n}),(0,S.jsx)("span",{ | |
| 991 | +className:"ablocks-score-dial__grade",children:a?(0,r.__)("scanning","ablocks"):t})]})]})};Oh.propTypes={value:Aa().number,grade:Aa().string,loading:Aa().bool};const Ah=Oh,Ph={critical:(0,r.__)("Needs attention","ablocks"),warning:(0,r.__)("Could be better","ablocks"),info:(0,r.__)("Worth knowing","ablocks"),good:(0,r.__)("All good","ablocks")},Hh={caching:(0,r.__)("Caching","ablocks"),images:(0,r.__)("Images","ablocks"),fonts:(0,r.__)("Fonts","ablocks"),assets:(0,r.__)("Assets","ablocks"),design:(0,r.__)("Design consistency","ablocks"),seo:(0,r.__)("Search & accessibility","ablocks"),server:(0,r.__)("Server & WordPress","ablocks"),general:(0,r.__)("General","ablocks")},Rh=[{id:"1x",name:(0,r.__)("Gentle","ablocks"),saving:(0,r.__)("about a quarter smaller","ablocks"),desc:(0,r.__)("No visible change. Safe for photography portfolios.","ablocks")},{id:"2x",name:(0,r.__)("Balanced","ablocks"),saving:(0,r.__)("about half the size","ablocks"),desc:(0, | |
| 992 | +r.__)("The right choice for almost every site.","ablocks")},{id:"5x",name:(0,r.__)("Aggressive","ablocks"),saving:(0,r.__)("about a third of the size","ablocks"),desc:(0,r.__)("Smallest files. Slight softening on detailed photos.","ablocks")}],Ih=[{name:"overview",title:(0,r.__)("Overview","ablocks"),component:()=>{const e=w(),[t,n]=(0,a.useState)(null),[s,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)(""),[d,u]=(0,a.useState)("issues"),m=(t,a="success")=>e(wt({message:t,isShow:!0,type:a})),_=()=>{o(!0),(0,i.In)({action:"ablocks/run_scanner"}).then(e=>n(e?.data?.data||null)).catch(()=>m((0,r.__)("The scan could not finish.","ablocks"),"error")).finally(()=>o(!1))};(0,a.useEffect)(()=>{_()},[]);const h=(e,t)=>{c(e),(0,i.In)({action:"ablocks/scanner_dismiss",id:e,dismiss:t?1:0}).then(e=>n(e?.data?.data?.report||null)).catch(()=>m((0,r.__)("Could not update that check.","ablocks"),"error")).finally(()=>c(""))},p=(0, | |
| 992 | 993 | a.useMemo)(()=>t?.checks||[],[t]),f=t?.score,b=t?.history||{},g=p.filter(e=>!e.dismissed),y=p.filter(e=>e.dismissed),k=g.filter(e=>"good"!==e.status),v=g.filter(e=>"good"===e.status),x=(0,a.useMemo)(()=>{const e=[];return k.forEach(t=>{e.includes(t.category)||e.push(t.category)}),e},[k]);let M=k;"passing"===d?M=v:"all"===d?M=g:"issues"!==d&&(M=k.filter(e=>e.category===d));const L=Object.values(b),j=L.length>1?L[L.length-1]-L[0]:0;let Y="";j>0?Y=(0,r.sprintf)(/* translators: %d: points the score has risen since the first scan */ /* translators: %d: points the score has risen since the first scan */ |
| 993 | 994 | (0,r.__)("up %d since first scan","ablocks"),Math.abs(j)):j<0&&(Y=(0,r.sprintf)(/* translators: %d: points the score has fallen since the first scan */ /* translators: %d: points the score has fallen since the first scan */ |
| 994 | -(0,r.__)("down %d since first scan","ablocks"),Math.abs(j)));const D=e=>e>=90?"is-good":e>=60?"is-warning":"is-critical";return(0,S.jsxs)("div",{className:"ablocks-scanner-overview",children:[(0,S.jsxs)("div",{className:"ablocks-scan-hero",children:[(0,S.jsx)(Oh,{value:f?.score??0,grade:f?.grade??"—",loading:s&&!t}),(0,S.jsxs)("div",{className:"ablocks-scan-hero__body",children:[(0,S.jsx)("h3",{className:"ablocks-scan-hero__title",children:(0,r.__)("Site Scanner","ablocks")}),(0,S.jsx)("p",{className:"ablocks-scan-hero__text",children:(0,r.__)("Checks the things that most often make a WordPress site slow, invisible to search engines, or inconsistent — and explains what each one means and how to fix it.","ablocks")}),!!f&&(0,S.jsxs)("div",{className:"ablocks-scan-hero__meta",children:[(0,S.jsx)("span",{children:(0,r.sprintf)(/* translators: 1: issues found, 2: checks passing */ /* translators: 1: issues found, 2: checks passing */ | |
| 995 | -(0,r.__)("%1$d to look at · %2$d passing","ablocks"),k.length,v.length)}),L.length>1&&0!==j&&(0,S.jsx)("span",{className:j>0?"is-up":"is-down",children:Y})]}),(0,S.jsx)(Ja,{type:"button",preset:"purple",label:s?(0,r.__)("Scanning…","ablocks"):(0,r.__)("Scan again","ablocks"),onClick:_})]})]}),!!f?.categories&&Object.keys(f.categories).length>0&&(0,S.jsx)("div",{className:"ablocks-scan-cats",children:Object.entries(f.categories).map(([e,t])=>(0,S.jsxs)("button",{type:"button",className:"ablocks-scan-cat "+(d===e?"is-active":""),onClick:()=>u(d===e?"issues":e),children:[(0,S.jsx)("span",{className:"ablocks-scan-cat__name",children:Ph[e]||e}),(0,S.jsx)("span",{className:"ablocks-scan-cat__bar",children:(0,S.jsx)("span",{className:`ablocks-scan-cat__fill ${D(t)}`,style:{width:`${t}%`}})}),(0,S.jsx)("span",{className:"ablocks-scan-cat__value",children:t})]},e))}),(0,S.jsxs)("div",{className:"ablocks-scan-filters",children:[(0,S.jsx)("button",{type:"button", | |
| 995 | +(0,r.__)("down %d since first scan","ablocks"),Math.abs(j)));const D=e=>e>=90?"is-good":e>=60?"is-warning":"is-critical";return(0,S.jsxs)("div",{className:"ablocks-scanner-overview",children:[(0,S.jsxs)("div",{className:"ablocks-scan-hero",children:[(0,S.jsx)(Ah,{value:f?.score??0,grade:f?.grade??"—",loading:s&&!t}),(0,S.jsxs)("div",{className:"ablocks-scan-hero__body",children:[(0,S.jsx)("h3",{className:"ablocks-scan-hero__title",children:(0,r.__)("Site Scanner","ablocks")}),(0,S.jsx)("p",{className:"ablocks-scan-hero__text",children:(0,r.__)("Checks the things that most often make a WordPress site slow, invisible to search engines, or inconsistent — and explains what each one means and how to fix it.","ablocks")}),!!f&&(0,S.jsxs)("div",{className:"ablocks-scan-hero__meta",children:[(0,S.jsx)("span",{children:(0,r.sprintf)(/* translators: 1: issues found, 2: checks passing */ /* translators: 1: issues found, 2: checks passing */ | |
| 996 | +(0,r.__)("%1$d to look at · %2$d passing","ablocks"),k.length,v.length)}),L.length>1&&0!==j&&(0,S.jsx)("span",{className:j>0?"is-up":"is-down",children:Y})]}),(0,S.jsx)(Ja,{type:"button",preset:"purple",label:s?(0,r.__)("Scanning…","ablocks"):(0,r.__)("Scan again","ablocks"),onClick:_})]})]}),!!f?.categories&&Object.keys(f.categories).length>0&&(0,S.jsx)("div",{className:"ablocks-scan-cats",children:Object.entries(f.categories).map(([e,t])=>(0,S.jsxs)("button",{type:"button",className:"ablocks-scan-cat "+(d===e?"is-active":""),onClick:()=>u(d===e?"issues":e),children:[(0,S.jsx)("span",{className:"ablocks-scan-cat__name",children:Hh[e]||e}),(0,S.jsx)("span",{className:"ablocks-scan-cat__bar",children:(0,S.jsx)("span",{className:`ablocks-scan-cat__fill ${D(t)}`,style:{width:`${t}%`}})}),(0,S.jsx)("span",{className:"ablocks-scan-cat__value",children:t})]},e))}),(0,S.jsxs)("div",{className:"ablocks-scan-filters",children:[(0,S.jsx)("button",{type:"button", | |
| 996 | 997 | className:"issues"===d?"is-active":"",onClick:()=>u("issues"),children:(0,r.sprintf)(/* translators: %d: number of issues */ /* translators: %d: number of issues */ |
| 997 | -(0,r.__)("To fix (%d)","ablocks"),k.length)}),x.map(e=>(0,S.jsx)("button",{type:"button",className:d===e?"is-active":"",onClick:()=>u(e),children:Ph[e]||e},e)),(0,S.jsx)("button",{type:"button",className:"passing"===d?"is-active":"",onClick:()=>u("passing"),children:(0,r.sprintf)(/* translators: %d: number of passing checks */ /* translators: %d: number of passing checks */ | |
| 998 | -(0,r.__)("Passing (%d)","ablocks"),v.length)})]}),t&&0===M.length&&(0,S.jsx)("p",{className:"ablocks-scan-empty ablocks-scan-empty--clear",children:"issues"===d?(0,r.__)("Nothing needs attention. Every check passed.","ablocks"):(0,r.__)("Nothing here.","ablocks")}),(0,S.jsx)("div",{className:"ablocks-scan-list",children:M.map(e=>(0,S.jsxs)("div",{className:`ablocks-scan-item is-${e.status}`,children:[(0,S.jsxs)("div",{className:"ablocks-scan-item__head",children:[(0,S.jsx)("span",{className:"ablocks-scan-item__badge",children:Ah[e.status]||e.status}),(0,S.jsx)("strong",{className:"ablocks-scan-item__label",children:e.label}),(0,S.jsx)("span",{className:"ablocks-scan-item__cat",children:Ph[e.category]||e.category})]}),(0,S.jsx)("p",{className:"ablocks-scan-item__summary",children:e.summary}),!!e.why&&(0,S.jsx)("p",{className:"ablocks-scan-item__why",children:e.why}),!!e.fix&&(0,S.jsxs)("p",{className:"ablocks-scan-item__fix",children:[(0,S.jsx)("strong",{children:(0, | |
| 998 | +(0,r.__)("To fix (%d)","ablocks"),k.length)}),x.map(e=>(0,S.jsx)("button",{type:"button",className:d===e?"is-active":"",onClick:()=>u(e),children:Hh[e]||e},e)),(0,S.jsx)("button",{type:"button",className:"passing"===d?"is-active":"",onClick:()=>u("passing"),children:(0,r.sprintf)(/* translators: %d: number of passing checks */ /* translators: %d: number of passing checks */ | |
| 999 | +(0,r.__)("Passing (%d)","ablocks"),v.length)})]}),t&&0===M.length&&(0,S.jsx)("p",{className:"ablocks-scan-empty ablocks-scan-empty--clear",children:"issues"===d?(0,r.__)("Nothing needs attention. Every check passed.","ablocks"):(0,r.__)("Nothing here.","ablocks")}),(0,S.jsx)("div",{className:"ablocks-scan-list",children:M.map(e=>(0,S.jsxs)("div",{className:`ablocks-scan-item is-${e.status}`,children:[(0,S.jsxs)("div",{className:"ablocks-scan-item__head",children:[(0,S.jsx)("span",{className:"ablocks-scan-item__badge",children:Ph[e.status]||e.status}),(0,S.jsx)("strong",{className:"ablocks-scan-item__label",children:e.label}),(0,S.jsx)("span",{className:"ablocks-scan-item__cat",children:Hh[e.category]||e.category})]}),(0,S.jsx)("p",{className:"ablocks-scan-item__summary",children:e.summary}),!!e.why&&(0,S.jsx)("p",{className:"ablocks-scan-item__why",children:e.why}),!!e.fix&&(0,S.jsxs)("p",{className:"ablocks-scan-item__fix",children:[(0,S.jsx)("strong",{children:(0, | |
| 999 | 1000 | r.__)("How to fix:","ablocks")})," ",e.fix]}),(0,S.jsxs)("div",{className:"ablocks-scan-item__actions",children:[!!e.field&&(0,S.jsx)(Ja,{type:"button",preset:"purple",label:l===e.field?(0,r.__)("Applying…","ablocks"):(0,r.__)("Turn this on","ablocks"),onClick:()=>{return t=e.field,c(t),void(0,i.In)({action:"ablocks/scanner_apply_fix",field:t}).then(e=>{if(!e?.data?.success)throw new Error("rejected");n(e.data.data?.report||null),m((0,r.__)("Setting updated.","ablocks"))}).catch(()=>m((0,r.__)("That setting could not be changed.","ablocks"),"error")).finally(()=>c(""));var t}}),!!e.url&&(0,S.jsx)("a",{className:"ablocks-scan-item__link",href:e.url,children:(0,r.__)("Open the setting","ablocks")}),"good"!==e.status&&(0,S.jsx)("button",{type:"button",className:"ablocks-scan-item__ignore",onClick:()=>h(e.id,!0),disabled:l===e.id,children:(0,r.__)("Ignore this","ablocks")})]})]},e.id))}),y.length>0&&(0,S.jsxs)("div",{className:"ablocks-scan-ignored",children:[(0,S.jsx)("h4",{children:(0, |
| 1000 | 1001 | r.sprintf)(/* translators: %d: number of ignored checks */ /* translators: %d: number of ignored checks */ |
| 1001 | 1002 | (0,r.__)("Ignored (%d)","ablocks"),y.length)}),(0,S.jsx)("p",{className:"ablocks-scan-ignored__note",children:(0,r.__)("These are left out of the score. They stay listed so a decision made months ago is still visible.","ablocks")}),y.map(e=>(0,S.jsxs)("div",{className:"ablocks-scan-ignored__item",children:[(0,S.jsx)("span",{children:e.label}),(0,S.jsx)("button",{type:"button",onClick:()=>h(e.id,!1),disabled:l===e.id,children:(0,r.__)("Check again","ablocks")})]},e.id))]})]})}},{name:"images",title:(0,r.__)("Images","ablocks"),component:()=>{const e=w(),[t,n]=(0,a.useState)(null),[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(null),[_,h]=(0,a.useState)([]),[p,f]=(0,a.useState)("2x"),[b,g]=(0,a.useState)(!0),[y,k]=(0,a.useState)(!1),[v,x]=(0,a.useState)(0),[M,L]=(0,a.useState)(0),[j,Y]=(0,a.useState)([]),[D,T]=(0,a.useState)(!1),[C,N]=(0,a.useState)(null),[E,O]=(0,a.useState)(null),A=M?Math.min(100,Math.round(v/M*100)):0,P=()=>(0,i.In)({ |
| 1002 | -action:"ablocks/image_stats"}).then(e=>{const t=e?.data?.data||null;n(t),t?.level&&f(t.level),void 0!==t?.webp&&g(!!t.webp)}).catch(()=>n(null));(0,a.useEffect)(()=>{P()},[]);const H=(t,a="success")=>e(wt({message:t,isShow:!0,type:a})),R=Hh.find(e=>e.id===p)||Hh[1];let I=(0,r.__)("Not checked yet","ablocks");return D?I=(0,r.__)("Reading the library…","ablocks"):E&&(I=(0,r.sprintf)(/* translators: 1: duplicate sets, 2: extra copies, 3: disk space */ /* translators: 1: duplicate sets, 2: extra copies, 3: disk space */ | |
| 1003 | +action:"ablocks/image_stats"}).then(e=>{const t=e?.data?.data||null;n(t),t?.level&&f(t.level),void 0!==t?.webp&&g(!!t.webp)}).catch(()=>n(null));(0,a.useEffect)(()=>{P()},[]);const H=(t,a="success")=>e(wt({message:t,isShow:!0,type:a})),R=Rh.find(e=>e.id===p)||Rh[1];let I=(0,r.__)("Not checked yet","ablocks");return D?I=(0,r.__)("Reading the library…","ablocks"):E&&(I=(0,r.sprintf)(/* translators: 1: duplicate sets, 2: extra copies, 3: disk space */ /* translators: 1: duplicate sets, 2: extra copies, 3: disk space */ | |
| 1003 | 1004 | (0,r.__)("%1$d set(s) of duplicates · %2$d extra copies · %3$s reclaimable","ablocks"),E.groups,E.extra,E.size)),(0,S.jsxs)("div",{className:"ablocks-general-content",children:[(0,S.jsxs)("div",{className:"ablocks-img-hero",children:[(0,S.jsxs)("div",{className:"ablocks-img-stat",children:[(0,S.jsx)("span",{className:"ablocks-img-stat__value",children:t?.saved??"—"}),(0,S.jsx)("span",{className:"ablocks-img-stat__label",children:(0,r.__)("saved so far","ablocks")})]}),(0,S.jsxs)("div",{className:"ablocks-img-stat",children:[(0,S.jsx)("span",{className:"ablocks-img-stat__value",children:t?.optimized??0}),(0,S.jsx)("span",{className:"ablocks-img-stat__label",children:(0,r.__)("images compressed","ablocks")})]}),(0,S.jsxs)("div",{className:"ablocks-img-stat",children:[(0,S.jsx)("span",{className:"ablocks-img-stat__value",children:t?.pending??0}),(0,S.jsx)("span",{className:"ablocks-img-stat__label",children:(0,r.__)("still to do","ablocks")})]}),(0,S.jsxs)("div",{ |
| 1004 | -className:"ablocks-img-stat",children:[(0,S.jsx)("span",{className:"ablocks-img-stat__value",children:t?.originals??"0 B"}),(0,S.jsx)("span",{className:"ablocks-img-stat__label",children:(0,r.__)("originals stored","ablocks")})]})]}),(0,S.jsx)("h3",{className:"ablocks-general-content__heading ablocks-general-content__heading--sub",children:(0,r.__)("Compress images","ablocks")}),(0,S.jsx)("div",{className:"ablocks-level-picker",children:Hh.map(e=>(0,S.jsxs)("button",{type:"button",className:"ablocks-level "+(p===e.id?"is-active":""),onClick:()=>f(e.id),disabled:o,children:[(0,S.jsx)("span",{className:"ablocks-level__id",children:e.id}),(0,S.jsx)("span",{className:"ablocks-level__name",children:e.name}),(0,S.jsx)("span",{className:"ablocks-level__saving",children:e.saving}),(0,S.jsx)("span",{className:"ablocks-level__desc",children:e.desc})]},e.id))}),(0,S.jsxs)("div",{className:"ablocks-img-option",children:[(0,S.jsx)("input",{id:"ablocks-img-webp",type:"checkbox",checked:b, | |
| 1005 | +className:"ablocks-img-stat",children:[(0,S.jsx)("span",{className:"ablocks-img-stat__value",children:t?.originals??"0 B"}),(0,S.jsx)("span",{className:"ablocks-img-stat__label",children:(0,r.__)("originals stored","ablocks")})]})]}),(0,S.jsx)("h3",{className:"ablocks-general-content__heading ablocks-general-content__heading--sub",children:(0,r.__)("Compress images","ablocks")}),(0,S.jsx)("div",{className:"ablocks-level-picker",children:Rh.map(e=>(0,S.jsxs)("button",{type:"button",className:"ablocks-level "+(p===e.id?"is-active":""),onClick:()=>f(e.id),disabled:o,children:[(0,S.jsx)("span",{className:"ablocks-level__id",children:e.id}),(0,S.jsx)("span",{className:"ablocks-level__name",children:e.name}),(0,S.jsx)("span",{className:"ablocks-level__saving",children:e.saving}),(0,S.jsx)("span",{className:"ablocks-level__desc",children:e.desc})]},e.id))}),(0,S.jsxs)("div",{className:"ablocks-img-option",children:[(0,S.jsx)("input",{id:"ablocks-img-webp",type:"checkbox",checked:b, | |
| 1005 | 1006 | onChange:()=>g(e=>!e),disabled:o}),(0,S.jsxs)("span",{children:[(0,S.jsx)("label",{htmlFor:"ablocks-img-webp",children:(0,r.__)("Also create WebP copies","ablocks")}),(0,S.jsx)("em",{children:(0,r.__)("A modern format that is usually much smaller. The original file stays where it is, so nothing that links to it breaks.","ablocks")})]})]}),(0,S.jsxs)("div",{className:"ablocks-img-option "+(y?"is-danger":""),children:[(0,S.jsx)("input",{id:"ablocks-img-discard",type:"checkbox",checked:y,onChange:()=>k(e=>!e),disabled:o}),(0,S.jsxs)("span",{children:[(0,S.jsx)("label",{htmlFor:"ablocks-img-discard",children:(0,r.__)("Delete the original files afterwards","ablocks")}),(0,S.jsx)("em",{children:(0,r.__)("Frees the disk space your untouched originals take up. It also means this cannot be undone: you will not be able to restore them, or re-run at a different strength, because there is no clean copy left to work from.","ablocks")})]})]}),(0,S.jsxs)("div",{className:"ablocks-img-actions", |
| 1006 | 1007 | children:[(0,S.jsx)(Ja,{type:"button",preset:"purple",label:o?(0,r.__)("Working…","ablocks"):(0,r.sprintf)(/* translators: %s: chosen compression level */ /* translators: %s: chosen compression level */ |
| 1007 | 1008 | (0,r.__)("Compress at %s","ablocks"),R.id),onClick:async()=>{if(!o&&(!y||window.confirm((0,r.__)("Delete the original files after compressing? You will not be able to restore them or re-run at a different strength.","ablocks")))){l(!0),Y([]),x(0),L(t?.pending??0);try{let e=!1,t=0,a=0;for(;!e&&t<2e3;){t++;const s=await(0,i.In)({action:"ablocks/image_optimize_batch",level:p,webp:b?1:0,all:0}),r=s?.data?.data;e=!r||r.done,a+=r?.processed??0,x(a),r?.items?.length&&Y(e=>[...r.items,...e].slice(0,12)),r?.stats&&n(r.stats)}if(y){const e=await(0,i.In)({action:"ablocks/image_discard_originals"});n(e?.data?.data?.stats||null),k(!1),H((0,r.sprintf)(/* translators: %s: disk space reclaimed */ /* translators: %s: disk space reclaimed */ |
| 1008 | 1009 | (0,r.__)("Images compressed. Originals deleted, %s reclaimed.","ablocks"),e?.data?.data?.freed??"0 B"))}else H((0,r.__)("Images compressed.","ablocks"))}catch(e){H((0,r.__)("Could not finish compressing.","ablocks"),"error")}finally{l(!1),P()}}}}),!!t?.originals_count&&(0,S.jsx)(Ja,{type:"button",preset:"light",label:(0,r.__)("Restore originals","ablocks"),onClick:()=>{(0,i.In)({action:"ablocks/image_restore_all"}).then(e=>{n(e?.data?.data?.stats||null),H((0,r.sprintf)(/* translators: %d: number of files restored */ /* translators: %d: number of files restored */ |
| @@ -1032,9 +1033,9 @@ | ||
| 1032 | 1033 | // translators: %d: number of families served from Google. |
| 1033 | 1034 | // translators: %d: number of families served from Google. |
| 1034 | 1035 | (0,r.__)("%d served from Google","ablocks"),e.remote_families):(0,r.__)("All self-hosted","ablocks")}),(0,S.jsx)("span",{className:e.metric_fallbacks?"is-good":"",children:e.metric_fallbacks?(0,r.__)("Zero-shift fallbacks on","ablocks"):(0,r.__)("Zero-shift fallbacks off","ablocks")})]}),!e.families.length&&(0,S.jsx)("p",{className:"ablocks-font-audit__text",children:(0,r.__)("No aBlocks fonts are in use — the theme’s own fonts are doing all the work.","ablocks")}),!!e.families.length&&(0,S.jsxs)("table",{className:"ablocks-font-audit__table",children:[(0,S.jsx)("thead",{children:(0,S.jsxs)("tr",{children:[(0,S.jsx)("th",{children:(0,r.__)("Family","ablocks")}),(0,S.jsx)("th",{children:(0,r.__)("Weights","ablocks")}),(0,S.jsx)("th",{children:(0,r.__)("Source","ablocks")}),(0,S.jsx)("th",{children:(0,r.__)("Renders as","ablocks")})]})}),(0,S.jsx)("tbody",{children:e.families.map(e=>(0,S.jsxs)("tr",{children:[(0,S.jsxs)("td",{children:[e.family,e.in_global&&(0,S.jsx)("span",{ |
| 1035 | 1036 | className:"ablocks-font-audit__tag",children:(0,r.__)("global","ablocks")}),e.in_site&&(0,S.jsx)("span",{className:"ablocks-font-audit__tag",children:(0,r.__)("template","ablocks")})]}),(0,S.jsx)("td",{className:e.weights.length>4?"is-warning":"",children:e.weights.join(", ")}),(0,S.jsx)("td",{className:e.self_hosted?"is-good":"is-warning",children:e.self_hosted?(0,r.__)("Self-hosted","ablocks"):(0,r.__)("Google","ablocks")}),(0,S.jsx)("td",{children:(0,S.jsx)("code",{children:e.stack})})]},e.family))})]}),!!e.pages.length&&(0,S.jsxs)("table",{className:"ablocks-font-audit__table",children:[(0,S.jsx)("thead",{children:(0,S.jsxs)("tr",{children:[(0,S.jsx)("th",{children:(0,r.__)("Page","ablocks")}),(0,S.jsx)("th",{children:(0,r.__)("Families","ablocks")}),(0,S.jsx)("th",{children:(0,r.__)("Weights","ablocks")})]})}),(0,S.jsx)("tbody",{children:e.pages.map(e=>(0,S.jsxs)("tr",{children:[(0,S.jsx)("td",{children:e.edit_link?(0,S.jsx)("a",{href:e.edit_link,target:"_blank",rel:"noreferrer", |
| 1036 | -children:e.title||`#${e.id}`}):e.title||`#${e.id}`}),(0,S.jsx)("td",{className:e.families.length>2?"is-warning":"",children:e.families.join(", ")}),(0,S.jsx)("td",{className:e.weights>4?"is-warning":"",children:e.weights})]},e.id))})]})]})]})}}],Ih=()=>{const{search:e}=(0,s.zy)(),t=new URLSearchParams(e).get("tab"),a=Rh.find(e=>e.name===t)||Rh[0],n=a.component;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsxs)("div",{className:"ablocks-page-content ablocks-general-content ablocks-scanner",children:[(0,S.jsx)("div",{className:"ablocks-scan-tabs",children:Rh.map(e=>(0,S.jsx)(s.N_,{to:`${i.Y3}admin.php?page=ablocks-scanner&tab=${e.name}`,className:"ablocks-scan-tab "+(a.name===e.name?"is-active":""),children:e.title},e.name))}),(0,S.jsx)(n,{})]})]})},Fh=(e,t,a,s)=>{switch(e){case"ablocks":return(0,S.jsx)(gn,{});case"ablocks-tools":return(0,S.jsx)(yn,{});case"ablocks-scanner":return(0,S.jsx)(Ih,{});case"ablocks-settings":return(0,S.jsx)(yu,{});case"ablocks-addons":return(0, | |
| 1037 | -S.jsx)(h_,{});case"ablocks-free-vs-pro":return i.zX?(0,S.jsx)(gn,{}):(0,S.jsx)(fn,{});case"ablocks-theme-builder":return t||a?(0,S.jsx)(z_,{id:t}):(0,S.jsx)(N_,{});case"ablocks-cookie-consent":return(0,S.jsx)(Ch,{});case"ablocks-submissions":return t?(0,S.jsx)(Zm,{}):(0,S.jsx)(Jm,{});default:{const t=(r=e,(window.ABlocksDashboardPages||(window.ABlocksDashboardPages={}),window.ABlocksDashboardPages)[r]||null);return t?(0,S.jsxs)(n().Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsx)(t,{...s})]}):(0,S.jsx)(gn,{})}}var r};function Wh(){const e=(0,i.IT)(),t=w();return(0,S.jsxs)(n().Fragment,{children:[(0,S.jsx)(ku,{}),Fh(e.get("page"),parseInt(e.get("id")),e.get("action"),{notify:(e,a="success")=>t(wt({message:e,isShow:!0,type:a}))})]})}o(79448);let zh=[];const Uh=function(e){const t=function(e){const{thunk:t=!0,immutableCheck:a=!0,serializableCheck:n=!0,actionCreatorCheck:s=!0}=e??{};let r=new et;return t&&("boolean"==typeof t?r.push(Ge):r.push(Ke(t.extraArgument))),r | |
| 1037 | +children:e.title||`#${e.id}`}):e.title||`#${e.id}`}),(0,S.jsx)("td",{className:e.families.length>2?"is-warning":"",children:e.families.join(", ")}),(0,S.jsx)("td",{className:e.weights>4?"is-warning":"",children:e.weights})]},e.id))})]})]})]})}}],Fh=()=>{const{search:e}=(0,s.zy)(),t=new URLSearchParams(e).get("tab"),a=Ih.find(e=>e.name===t)||Ih[0],n=a.component;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsxs)("div",{className:"ablocks-page-content ablocks-general-content ablocks-scanner",children:[(0,S.jsx)("div",{className:"ablocks-scan-tabs",children:Ih.map(e=>(0,S.jsx)(s.N_,{to:`${i.Y3}admin.php?page=ablocks-scanner&tab=${e.name}`,className:"ablocks-scan-tab "+(a.name===e.name?"is-active":""),children:e.title},e.name))}),(0,S.jsx)(n,{})]})]})},Wh=(e,t,a,s)=>{switch(e){case"ablocks":return(0,S.jsx)(gn,{});case"ablocks-tools":return(0,S.jsx)(yn,{});case"ablocks-scanner":return(0,S.jsx)(Fh,{});case"ablocks-settings":return(0,S.jsx)(ku,{});case"ablocks-addons":return(0, | |
| 1038 | +S.jsx)(p_,{});case"ablocks-free-vs-pro":return i.zX?(0,S.jsx)(gn,{}):(0,S.jsx)(fn,{});case"ablocks-theme-builder":return t||a?(0,S.jsx)(U_,{id:t}):(0,S.jsx)(E_,{});case"ablocks-cookie-consent":return(0,S.jsx)(Nh,{});case"ablocks-submissions":return t?(0,S.jsx)(Qm,{}):(0,S.jsx)(Gm,{});default:{const t=(r=e,(window.ABlocksDashboardPages||(window.ABlocksDashboardPages={}),window.ABlocksDashboardPages)[r]||null);return t?(0,S.jsxs)(n().Fragment,{children:[(0,S.jsx)(Mt,{}),(0,S.jsx)(t,{...s})]}):(0,S.jsx)(gn,{})}}var r};function zh(){const e=(0,i.IT)(),t=w();return(0,S.jsxs)(n().Fragment,{children:[(0,S.jsx)(vu,{}),Wh(e.get("page"),parseInt(e.get("id")),e.get("action"),{notify:(e,a="success")=>t(wt({message:e,isShow:!0,type:a}))})]})}o(79448);let Uh=[];const Bh=function(e){const t=function(e){const{thunk:t=!0,immutableCheck:a=!0,serializableCheck:n=!0,actionCreatorCheck:s=!0}=e??{};let r=new et;return t&&("boolean"==typeof t?r.push(Ge):r.push(Ke(t.extraArgument))),r | |
| 1038 | 1039 | },{reducer:a,middleware:n,devTools:s=!0,duplicateMiddlewareCheck:r=!0,preloadedState:o,enhancers:i}=e||{};let l,c;if("function"==typeof a)l=a;else{if(!Ve(a))throw new Error(kt(1));l=function(e){const t=Object.keys(e),a={};for(let n=0;n<t.length;n++){const s=t[n];"function"==typeof e[s]&&(a[s]=e[s])}const n=Object.keys(a);let s;try{!function(e){Object.keys(e).forEach(t=>{const a=e[t];if(void 0===a(void 0,{type:Be.INIT}))throw new Error(We(12));if(void 0===a(void 0,{type:Be.PROBE_UNKNOWN_ACTION()}))throw new Error(We(13))})}(a)}catch(e){s=e}return function(e={},t){if(s)throw s;let r=!1;const o={};for(let s=0;s<n.length;s++){const i=n[s],l=a[i],c=e[i],d=l(c,t);if(void 0===d)throw t&&t.type,new Error(We(14));o[i]=d,r=r||d!==c}return r=r||n.length!==Object.keys(e).length,r?o:e}}(a)}c="function"==typeof n?n(t):t();let d=qe;s&&(d=Xe({trace:!1,..."object"==typeof s&&s}));const u=function(...e){return t=>(a,n)=>{const s=t(a,n);let r=()=>{throw new Error(We(15))};const o={getState:s.getState, |
| 1039 | -dispatch:(e,...t)=>r(e,...t)},i=e.map(e=>e(o));return r=qe(...i)(s.dispatch),{...s,dispatch:r}}}(...c),m=(e=>function(t){const{autoBatch:a=!0}=t??{};let n=new et(e);return a&&n.push(((e={type:"raf"})=>t=>(...a)=>{const n=t(...a);let s=!0,r=!1,o=!1;const i=new Set,l="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:nt(10):"callback"===e.type?e.queueNotification:nt(e.timeout),c=()=>{o=!1,r&&(r=!1,i.forEach(e=>e()))};return Object.assign({},n,{subscribe(e){const t=n.subscribe(()=>s&&e());return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return s=!e?.meta?.RTK_autoBatch,r=!s,r&&(o||(o=!0,l(c))),n.dispatch(e)}finally{s=!0}}})})("object"==typeof a?a:void 0)),n})(u);return $e(l,o,d(..."function"==typeof i?i(m):m()))}({reducer:{adminmenu:s_,settings:wn,notification:xt,blocks:Ea,submissions:zm,addons:l_,themeBuilder:j_},middleware:e=>e().concat(...zh)}),Bh=Uh;document.addEventListener("DOMContentLoaded",()=>{ | |
| 1040 | -const a=document.getElementById("ablockswrap");if(a){const n=(0,e.H)(a),r=document.getElementById("toplevel_page_ablocks");function o({children:e}){return r.innerHTML="",(0,t.createPortal)(e,r)}n.render((0,S.jsx)(b,{store:Bh,children:(0,S.jsxs)(s.Kd,{children:[(0,S.jsx)(o,{children:(0,S.jsx)(D,{})}),(0,S.jsx)(Wh,{})]})}))}})})()})(); | |
| 1040 | +dispatch:(e,...t)=>r(e,...t)},i=e.map(e=>e(o));return r=qe(...i)(s.dispatch),{...s,dispatch:r}}}(...c),m=(e=>function(t){const{autoBatch:a=!0}=t??{};let n=new et(e);return a&&n.push(((e={type:"raf"})=>t=>(...a)=>{const n=t(...a);let s=!0,r=!1,o=!1;const i=new Set,l="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:nt(10):"callback"===e.type?e.queueNotification:nt(e.timeout),c=()=>{o=!1,r&&(r=!1,i.forEach(e=>e()))};return Object.assign({},n,{subscribe(e){const t=n.subscribe(()=>s&&e());return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return s=!e?.meta?.RTK_autoBatch,r=!s,r&&(o||(o=!0,l(c))),n.dispatch(e)}finally{s=!0}}})})("object"==typeof a?a:void 0)),n})(u);return $e(l,o,d(..."function"==typeof i?i(m):m()))}({reducer:{adminmenu:r_,settings:wn,notification:xt,blocks:Ea,submissions:Um,addons:c_,themeBuilder:S_},middleware:e=>e().concat(...Uh)}),Vh=Bh;document.addEventListener("DOMContentLoaded",()=>{ | |
| 1041 | +const a=document.getElementById("ablockswrap");if(a){const n=(0,e.H)(a),r=document.getElementById("toplevel_page_ablocks");function o({children:e}){return r.innerHTML="",(0,t.createPortal)(e,r)}n.render((0,S.jsx)(b,{store:Vh,children:(0,S.jsxs)(s.Kd,{children:[(0,S.jsx)(o,{children:(0,S.jsx)(D,{})}),(0,S.jsx)(zh,{})]})}))}})})()})(); | |