Plugin Directory

Changeset 3321393


Ignore:
Timestamp:
07/02/2025 05:24:04 PM (9 months ago)
Author:
tanvirh
Message:

Fix data saving issue

Location:
dokan-kits/trunk
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • dokan-kits/trunk/build/admin/app.asset.php

    r3320185 r3321393  
    1 <?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-dom-ready', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '5c08fb777548ccdddccd');
     1<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-dom-ready', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '8f55cf472665e045a51b');
  • dokan-kits/trunk/build/admin/app.js

    r3320185 r3321393  
    1 (()=>{"use strict";var e={69:(e,t)=>{Object.prototype.toString}},t={};function a(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var s=r.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=r[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e+"../"})();const r=window.wp.components,s=window.wp.domReady;var n=a.n(s);const o=window.wp.element,i=window.React;a(69);var d,l=e=>{throw TypeError(e)},c=(e,t,a)=>(((e,t)=>{t.has(e)||l("Cannot read from private field")})(e,t),a?a.call(e):t.get(e)),u="popstate";function m(e={}){return function(e,t,a,r={}){let{window:s=document.defaultView,v5Compat:n=!1}=r,o=s.history,i="POP",d=null,l=c();function c(){return(o.state||{idx:null}).idx}function m(){i="POP";let e=c(),t=null==e?null:e-l;l=e,d&&d({action:i,location:h.location,delta:t})}function k(e){return b(e)}null==l&&(l=0,o.replaceState({...o.state,idx:l},""));let h={get action(){return i},get location(){return e(s,o)},listen(e){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(u,m),d=e,()=>{s.removeEventListener(u,m),d=null}},createHref:e=>t(s,e),createURL:k,encodeLocation(e){let t=k(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){i="PUSH";let r=f(h.location,e,t);a&&a(r,e),l=c()+1;let u=p(r,l),m=h.createHref(r);try{o.pushState(u,"",m)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;s.location.assign(m)}n&&d&&d({action:i,location:h.location,delta:1})},replace:function(e,t){i="REPLACE";let r=f(h.location,e,t);a&&a(r,e),l=c();let s=p(r,l),u=h.createHref(r);o.replaceState(s,"",u),n&&d&&d({action:i,location:h.location,delta:0})},go:e=>o.go(e)};return h}((function(e,t){let{pathname:a="/",search:r="",hash:s=""}=x(e.location.hash.substring(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),f("",{pathname:a,search:r,hash:s},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let a=e.document.querySelector("base"),r="";if(a&&a.getAttribute("href")){let t=e.location.href,a=t.indexOf("#");r=-1===a?t:t.slice(0,a)}return r+"#"+("string"==typeof t?t:g(t))}),(function(e,t){h("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}),e)}function k(e,t){if(!1===e||null==e)throw new Error(t)}function h(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function p(e,t){return{usr:e.state,key:e.key,idx:t}}function f(e,t,a=null,r){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?x(t):t,state:a,key:t&&t.key||r||Math.random().toString(36).substring(2,10)}}function g({pathname:e="/",search:t="",hash:a=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),a&&"#"!==a&&(e+="#"===a.charAt(0)?a:"#"+a),e}function x(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function b(e,t=!1){let a="http://localhost";"undefined"!=typeof window&&(a="null"!==window.location.origin?window.location.origin:window.location.href),k(a,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:g(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=a+r),new URL(r,a)}var y=class{constructor(e){var t,a,r;if(t=this,a=d,r=new Map,a.has(t)?l("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,r),e)for(let[t,a]of e)this.set(t,a)}get(e){if(c(this,d).has(e))return c(this,d).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw new Error("No value found for context")}set(e,t){c(this,d).set(e,t)}};d=new WeakMap;var w=new Set(["lazy","caseSensitive","path","id","index","children"]),v=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function j(e,t,a=[],r={}){return e.map(((e,s)=>{let n=[...a,String(s)],o="string"==typeof e.id?e.id:n.join("-");if(k(!0!==e.index||!e.children,"Cannot specify children on an index route"),k(!r[o],`Found a route id collision on id "${o}".  Route id's must be globally unique within Data Router usages`),function(e){return!0===e.index}(e)){let a={...e,...t(e),id:o};return r[o]=a,a}{let a={...e,...t(e),id:o,children:void 0};return r[o]=a,e.children&&(a.children=j(e.children,t,n,r)),a}}))}function N(e,t,a="/"){return _(e,t,a,!1)}function _(e,t,a,r){let s=F(("string"==typeof t?x(t):t).pathname||"/",a);if(null==s)return null;let n=C(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let a=e.length===t.length&&e.slice(0,-1).every(((e,a)=>e===t[a]));return a?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(n);let o=null;for(let e=0;null==o&&e<n.length;++e){let t=O(s);o=z(n[e],t,r)}return o}function C(e,t=[],a=[],r=""){let s=(e,s,n)=>{let o={relativePath:void 0===n?e.path||"":n,caseSensitive:!0===e.caseSensitive,childrenIndex:s,route:e};o.relativePath.startsWith("/")&&(k(o.relativePath.startsWith(r),`Absolute route path "${o.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let i=W([r,o.relativePath]),d=a.concat(o);e.children&&e.children.length>0&&(k(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${i}".`),C(e.children,t,d,i)),(null!=e.path||e.index)&&t.push({path:i,score:$(i,e.index),routesMeta:d})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let a of S(e.path))s(e,t,a);else s(e,t)})),t}function S(e){let t=e.split("/");if(0===t.length)return[];let[a,...r]=t,s=a.endsWith("?"),n=a.replace(/\?$/,"");if(0===r.length)return s?[n,""]:[n];let o=S(r.join("/")),i=[];return i.push(...o.map((e=>""===e?n:[n,e].join("/")))),s&&i.push(...o),i.map((t=>e.startsWith("/")&&""===t?"/":t))}var E=/^:[\w-]+$/,R=3,D=2,P=1,T=10,M=-2,L=e=>"*"===e;function $(e,t){let a=e.split("/"),r=a.length;return a.some(L)&&(r+=M),t&&(r+=D),a.filter((e=>!L(e))).reduce(((e,t)=>e+(E.test(t)?R:""===t?P:T)),r)}function z(e,t,a=!1){let{routesMeta:r}=e,s={},n="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],d=e===r.length-1,l="/"===n?t:t.slice(n.length)||"/",c=A({path:i.relativePath,caseSensitive:i.caseSensitive,end:d},l),u=i.route;if(!c&&d&&a&&!r[r.length-1].route.index&&(c=A({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},l)),!c)return null;Object.assign(s,c.params),o.push({params:s,pathname:W([n,c.pathname]),pathnameBase:q(W([n,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(n=W([n,c.pathnameBase]))}return o}function A(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=function(e,t=!1,a=!0){h("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,a)=>(r.push({paramName:t,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(r.push({paramName:"*"}),s+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?s+="\\/*$":""!==e&&"/"!==e&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),s=t.match(a);if(!s)return null;let n=s[0],o=n.replace(/(.)\/+$/,"$1"),i=s.slice(1);return{params:r.reduce(((e,{paramName:t,isOptional:a},r)=>{if("*"===t){let e=i[r]||"";o=n.slice(0,n.length-e.length).replace(/(.)\/+$/,"$1")}const s=i[r];return e[t]=a&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{}),pathname:n,pathnameBase:o,pattern:e}}function O(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return h(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function F(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&"/"!==r?null:e.slice(a)||"/"}function I(e,t,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function B(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function U(e){let t=B(e);return t.map(((e,a)=>a===t.length-1?e.pathname:e.pathnameBase))}function H(e,t,a,r=!1){let s;"string"==typeof e?s=x(e):(s={...e},k(!s.pathname||!s.pathname.includes("?"),I("?","pathname","search",s)),k(!s.pathname||!s.pathname.includes("#"),I("#","pathname","hash",s)),k(!s.search||!s.search.includes("#"),I("#","search","hash",s)));let n,o=""===e||""===s.pathname,i=o?"/":s.pathname;if(null==i)n=a;else{let e=t.length-1;if(!r&&i.startsWith("..")){let t=i.split("/");for(;".."===t[0];)t.shift(),e-=1;s.pathname=t.join("/")}n=e>=0?t[e]:"/"}let d=function(e,t="/"){let{pathname:a,search:r="",hash:s=""}="string"==typeof e?x(e):e,n=a?a.startsWith("/")?a:function(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?a.length>1&&a.pop():"."!==e&&a.push(e)})),a.length>1?a.join("/"):"/"}(a,t):t;return{pathname:n,search:V(r),hash:K(s)}}(s,n),l=i&&"/"!==i&&i.endsWith("/"),c=(o||"."===i)&&a.endsWith("/");return d.pathname.endsWith("/")||!l&&!c||(d.pathname+="/"),d}var W=e=>e.join("/").replace(/\/\/+/g,"/"),q=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),V=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",K=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",G=class{constructor(e,t,a,r=!1){this.status=e,this.statusText=t||"",this.internal=r,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Y(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var J=["POST","PUT","PATCH","DELETE"],X=new Set(J),Z=["GET",...J],Q=new Set(Z),ee=new Set([301,302,303,307,308]),te=new Set([307,308]),ae={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},re={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},se={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ne=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oe=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),ie="remix-router-transitions",de=Symbol("ResetLoaderData");function le(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,a=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement;k(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r,s,n,o=e.hydrationRouteProperties||[],i=e.mapRouteProperties||oe,d={},l=j(e.routes,i,void 0,d),c=e.basename||"/",u=e.dataStrategy||we,m={unstable_middleware:!1,...e.future},p=null,g=new Set,x=null,w=null,v=null,C=null!=e.hydrationData,S=N(l,e.history.location,c),E=!1,R=null;if(null!=S||e.patchRoutesOnNavigation)if(S&&!e.hydrationData&&at(S,l,e.history.location.pathname).active&&(S=null),S)if(S.some((e=>e.route.lazy)))s=!1;else if(S.some((e=>e.route.loader))){let t=e.hydrationData?e.hydrationData.loaderData:null,a=e.hydrationData?e.hydrationData.errors:null;if(a){let e=S.findIndex((e=>void 0!==a[e.route.id]));s=S.slice(0,e+1).every((e=>!ke(e.route,t,a)))}else s=S.every((e=>!ke(e.route,t,a)))}else s=!0;else{s=!1,S=[];let t=at(null,l,e.history.location.pathname);t.active&&t.matches&&(E=!0,S=t.matches)}else{let t=Oe(404,{pathname:e.history.location.pathname}),{matches:a,route:r}=Ae(l);s=!0,S=a,R={[r.id]:t}}let D,P,T={historyAction:e.history.action,location:e.history.location,matches:S,initialized:s,navigation:ae,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||R,fetchers:new Map,blockers:new Map},M="POP",L=!1,$=!1,z=new Map,A=null,O=!1,I=!1,B=new Set,U=new Map,H=0,W=-1,q=new Map,V=new Set,K=new Map,G=new Map,J=new Set,X=new Map,Z=null;function Q(e,t={}){T={...T,...e};let a=[],r=[];T.fetchers.forEach(((e,t)=>{"idle"===e.state&&(J.has(t)?a.push(t):r.push(t))})),J.forEach((e=>{T.fetchers.has(e)||U.has(e)||a.push(e)})),[...g].forEach((e=>e(T,{deletedFetchers:a,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync}))),a.forEach((e=>Ne(e))),r.forEach((e=>T.fetchers.delete(e)))}function ee(t,a,{flushSync:s}={}){let n,o=null!=T.actionData&&null!=T.navigation.formMethod&&Ve(T.navigation.formMethod)&&"loading"===T.navigation.state&&!0!==t.state?._isRedirect;n=a.actionData?Object.keys(a.actionData).length>0?a.actionData:null:o?T.actionData:null;let i=a.loaderData?Le(T.loaderData,a.loaderData,a.matches||[],a.errors):T.loaderData,d=T.blockers;d.size>0&&(d=new Map(d),d.forEach(((e,t)=>d.set(t,se))));let c,u=!0===L||null!=T.navigation.formMethod&&Ve(T.navigation.formMethod)&&!0!==t.state?._isRedirect;if(r&&(l=r,r=void 0),O||"POP"===M||("PUSH"===M?e.history.push(t,t.state):"REPLACE"===M&&e.history.replace(t,t.state)),"POP"===M){let e=z.get(T.location.pathname);e&&e.has(t.pathname)?c={currentLocation:T.location,nextLocation:t}:z.has(t.pathname)&&(c={currentLocation:t,nextLocation:T.location})}else if($){let e=z.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),z.set(T.location.pathname,e)),c={currentLocation:T.location,nextLocation:t}}Q({...a,actionData:n,loaderData:i,historyAction:M,location:t,initialized:!0,navigation:ae,revalidation:"idle",restoreScrollPosition:tt(t,a.matches||T.matches),preventScrollReset:u,blockers:d},{viewTransitionOpts:c,flushSync:!0===s}),M="POP",L=!1,$=!1,O=!1,I=!1,Z?.resolve(),Z=null}async function de(t,a,s){D&&D.abort(),D=null,M=t,O=!0===(s&&s.startUninterruptedRevalidation),function(e,t){if(x&&v){let a=et(e,t);x[a]=v()}}(T.location,T.matches),L=!0===(s&&s.preventScrollReset),$=!0===(s&&s.enableViewTransition);let n=r||l,u=s&&s.overrideNavigation,m=s?.initialHydration&&T.matches&&T.matches.length>0&&!E?T.matches:N(n,a,c),k=!0===(s&&s.flushSync);if(m&&T.initialized&&!I&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&(""===e.hash?""!==t.hash:e.hash===t.hash||""!==t.hash)}(T.location,a)&&!(s&&s.submission&&Ve(s.submission.formMethod)))return void ee(a,{matches:m},{flushSync:k});let h=at(m,n,a.pathname);if(h.active&&h.matches&&(m=h.matches),!m){let{error:e,notFoundMatches:t,route:r}=Qe(a.pathname);return void ee(a,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:k})}D=new AbortController;let p,f=De(e.history,a,D.signal,s&&s.submission),g=new y(e.unstable_getContext?await e.unstable_getContext():void 0);if(s&&s.pendingError)p=[ze(m).route.id,{type:"error",error:s.pendingError}];else if(s&&s.submission&&Ve(s.submission.formMethod)){let t=await async function(e,t,a,r,s,n,l,u={}){xe();let m,k=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(t,a);if(Q({navigation:k},{flushSync:!0===u.flushSync}),n){let a=await rt(r,t.pathname,e.signal);if("aborted"===a.type)return{shortCircuited:!0};if("error"===a.type){let e=ze(a.partialMatches).route.id;return{matches:a.partialMatches,pendingActionResult:[e,{type:"error",error:a.error}]}}if(!a.matches){let{notFoundMatches:e,error:a,route:r}=Qe(t.pathname);return{matches:e,pendingActionResult:[r.id,{type:"error",error:a}]}}r=a.matches}let h=Ge(r,t);if(h.route.action||h.route.lazy){let t=Ce(i,d,e,r,h,l?[]:o,s),a=await fe(e,t,s,null);if(m=a[h.route.id],!m)for(let e of r)if(a[e.route.id]){m=a[e.route.id];break}if(e.signal.aborted)return{shortCircuited:!0}}else m={type:"error",error:Oe(405,{method:e.method,pathname:t.pathname,routeId:h.route.id})};if(He(m)){let t;return t=u&&null!=u.replace?u.replace:Re(m.response.headers.get("Location"),new URL(e.url),c)===T.location.pathname+T.location.search,await he(e,m,!0,{submission:a,replace:t}),{shortCircuited:!0}}if(Ue(m)){let e=ze(r,h.route.id);return!0!==(u&&u.replace)&&(M="PUSH"),{matches:r,pendingActionResult:[e.route.id,m,h.route.id]}}return{matches:r,pendingActionResult:[h.route.id,m]}}(f,a,s.submission,m,g,h.active,s&&!0===s.initialHydration,{replace:s.replace,flushSync:k});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Ue(r)&&Y(r.error)&&404===r.error.status)return D=null,void ee(a,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}m=t.matches||m,p=t.pendingActionResult,u=Je(a,s.submission),k=!1,h.active=!1,f=De(e.history,f.url,f.signal)}let{shortCircuited:b,matches:w,loaderData:j,errors:_}=await async function(t,a,s,n,u,m,k,h,p,f,g,x){let b=m||Je(a,k),y=k||h||Ye(b),w=!O&&!f;if(u){if(w){let e=le(x);Q({navigation:b,...void 0!==e?{actionData:e}:{}},{flushSync:g})}let e=await rt(s,a.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=ze(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=Qe(a.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}s=e.matches}let v=r||l,{dsMatches:j,revalidatingFetchers:N}=me(t,n,i,d,e.history,T,s,y,a,f?[]:o,!0===f,I,B,J,K,V,v,c,null!=e.patchRoutesOnNavigation,x);if(W=++H,!e.dataStrategy&&!j.some((e=>e.shouldLoad))&&0===N.length){let e=Te();return ee(a,{matches:s,loaderData:{},errors:x&&Ue(x[1])?{[x[0]]:x[1].error}:null,...$e(x),...e?{fetchers:new Map(T.fetchers)}:{}},{flushSync:g}),{shortCircuited:!0}}if(w){let e={};if(!u){e.navigation=b;let t=le(x);void 0!==t&&(e.actionData=t)}N.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=T.fetchers.get(e.key),a=Xe(void 0,t?t.data:void 0);T.fetchers.set(e.key,a)})),new Map(T.fetchers)}(N)),Q(e,{flushSync:g})}N.forEach((e=>{_e(e.key),e.controller&&U.set(e.key,e.controller)}));let _=()=>N.forEach((e=>_e(e.key)));D&&D.signal.addEventListener("abort",_);let{loaderResults:C,fetcherResults:S}=await ge(j,N,t,n);if(t.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",_),N.forEach((e=>U.delete(e.key)));let E=Fe(C);if(E)return await he(t,E.result,!0,{replace:p}),{shortCircuited:!0};if(E=Fe(S),E)return V.add(E.key),await he(t,E.result,!0,{replace:p}),{shortCircuited:!0};let{loaderData:R,errors:P}=Me(T,s,C,x,N,S);f&&T.errors&&(P={...T.errors,...P});let M=Te(),L=Ie(W);return{matches:s,loaderData:R,errors:P,...M||L||N.length>0?{fetchers:new Map(T.fetchers)}:{}}}(f,a,m,g,h.active,u,s&&s.submission,s&&s.fetcherSubmission,s&&s.replace,s&&!0===s.initialHydration,k,p);b||(D=null,ee(a,{matches:w||m,...$e(p),loaderData:j,errors:_}))}function le(e){return e&&!Ue(e[1])?{[e[0]]:e[1].data}:T.actionData?0===Object.keys(T.actionData).length?null:T.actionData:void 0}async function he(e,r,s,{submission:n,fetcherSubmission:o,preventScrollReset:i,replace:d}={}){r.response.headers.has("X-Remix-Revalidate")&&(I=!0);let l=r.response.headers.get("Location");k(l,"Expected a Location header on the redirect Response"),l=Re(l,new URL(e.url),c);let u=f(T.location,l,{_isRedirect:!0});if(a){let e=!1;if(r.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(ne.test(l)){const a=b(l,!0);e=a.origin!==t.location.origin||null==F(a.pathname,c)}if(e)return void(d?t.location.replace(l):t.location.assign(l))}D=null;let m=!0===d||r.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:h,formAction:p,formEncType:g}=T.navigation;!n&&!o&&h&&p&&g&&(n=Ye(T.navigation));let x=n||o;if(te.has(r.response.status)&&x&&Ve(x.formMethod))await de(m,u,{submission:{...x,formAction:l},preventScrollReset:i||L,enableViewTransition:s?$:void 0});else{let e=Je(u,n);await de(m,u,{overrideNavigation:e,fetcherSubmission:o,preventScrollReset:i||L,enableViewTransition:s?$:void 0})}}async function fe(e,t,a,r){let s,n={};try{s=await async function(e,t,a,r,s,n){a.some((e=>e._lazyPromises?.middleware))&&await Promise.all(a.map((e=>e._lazyPromises?.middleware)));let o={request:t,params:a[0].params,context:s,matches:a},i=n?()=>{throw new Error("You cannot call `unstable_runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response.  You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=o;return ve(t,!1,(()=>e({...t,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}})),((e,t)=>({[t]:{type:"error",result:e}})))},d=await e({...o,fetcherKey:r,unstable_runClientMiddleware:i});try{await Promise.all(a.flatMap((e=>[e._lazyPromises?.handler,e._lazyPromises?.route])))}catch(e){}return d}(u,e,t,r,a,!1)}catch(e){return t.filter((e=>e.shouldLoad)).forEach((t=>{n[t.route.id]={type:"error",error:e}})),n}if(e.signal.aborted)return n;for(let[a,r]of Object.entries(s))if(Be(r)){let s=r.result;n[a]={type:"redirect",response:Ee(s,e,a,t,c)}}else n[a]=await Se(r);return n}async function ge(e,t,a,r){let s=fe(a,e,r,null),n=Promise.all(t.map((async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await fe(e.request,e.matches,r,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:Oe(404,{pathname:e.path})}})})));return{loaderResults:await s,fetcherResults:(await n).reduce(((e,t)=>Object.assign(e,t)),{})}}function xe(){I=!0,K.forEach(((e,t)=>{U.has(t)&&B.add(t),_e(t)}))}function be(e,t,a={}){T.fetchers.set(e,t),Q({fetchers:new Map(T.fetchers)},{flushSync:!0===(a&&a.flushSync)})}function ye(e,t,a,r={}){let s=ze(T.matches,t);Ne(e),Q({errors:{[s.route.id]:a},fetchers:new Map(T.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function je(e){return G.set(e,(G.get(e)||0)+1),J.has(e)&&J.delete(e),T.fetchers.get(e)||re}function Ne(e){let t=T.fetchers.get(e);!U.has(e)||t&&"loading"===t.state&&q.has(e)||_e(e),K.delete(e),q.delete(e),V.delete(e),J.delete(e),B.delete(e),T.fetchers.delete(e)}function _e(e){let t=U.get(e);t&&(t.abort(),U.delete(e))}function Pe(e){for(let t of e){let e=Ze(je(t).data);T.fetchers.set(t,e)}}function Te(){let e=[],t=!1;for(let a of V){let r=T.fetchers.get(a);k(r,`Expected fetcher: ${a}`),"loading"===r.state&&(V.delete(a),e.push(a),t=!0)}return Pe(e),t}function Ie(e){let t=[];for(let[a,r]of q)if(r<e){let e=T.fetchers.get(a);k(e,`Expected fetcher: ${a}`),"loading"===e.state&&(_e(a),q.delete(a),t.push(a))}return Pe(t),t.length>0}function We(e){T.blockers.delete(e),X.delete(e)}function qe(e,t){let a=T.blockers.get(e)||se;k("unblocked"===a.state&&"blocked"===t.state||"blocked"===a.state&&"blocked"===t.state||"blocked"===a.state&&"proceeding"===t.state||"blocked"===a.state&&"unblocked"===t.state||"proceeding"===a.state&&"unblocked"===t.state,`Invalid blocker state transition: ${a.state} -> ${t.state}`);let r=new Map(T.blockers);r.set(e,t),Q({blockers:r})}function Ke({currentLocation:e,nextLocation:t,historyAction:a}){if(0===X.size)return;X.size>1&&h(!1,"A router only supports one blocker at a time");let r=Array.from(X.entries()),[s,n]=r[r.length-1],o=T.blockers.get(s);return o&&"proceeding"===o.state?void 0:n({currentLocation:e,nextLocation:t,historyAction:a})?s:void 0}function Qe(e){let t=Oe(404,{pathname:e}),a=r||l,{matches:s,route:n}=Ae(a);return{notFoundMatches:s,route:n,error:t}}function et(e,t){if(w){return w(e,t.map((e=>function(e,t){let{route:a,pathname:r,params:s}=e;return{id:a.id,pathname:r,params:s,data:t[a.id],handle:a.handle}}(e,T.loaderData))))||e.key}return e.key}function tt(e,t){if(x){let a=et(e,t),r=x[a];if("number"==typeof r)return r}return null}function at(t,a,r){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:_(a,r,c,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:_(a,r,c,!0)}}return{active:!1,matches:null}}async function rt(t,a,s,n){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let o=t;for(;;){let t=null==r,u=r||l,m=d;try{await e.patchRoutesOnNavigation({signal:s,path:a,matches:o,fetcherKey:n,patch:(e,t)=>{s.aborted||pe(e,t,u,m,i)}})}catch(e){return{type:"error",error:e,partialMatches:o}}finally{t&&!s.aborted&&(l=[...l])}if(s.aborted)return{type:"aborted"};let k=N(u,a,c);if(k)return{type:"success",matches:k};let h=_(u,a,c,!0);if(!h||o.length===h.length&&o.every(((e,t)=>e.route.id===h[t].route.id)))return{type:"success",matches:null};o=h}}return n={get basename(){return c},get future(){return m},get state(){return T},get routes(){return l},get window(){return t},initialize:function(){if(p=e.history.listen((({action:t,location:a,delta:r})=>{if(P)return P(),void(P=void 0);h(0===X.size||null!=r,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let s=Ke({currentLocation:T.location,nextLocation:a,historyAction:t});if(s&&null!=r){let t=new Promise((e=>{P=e}));return e.history.go(-1*r),void qe(s,{state:"blocked",location:a,proceed(){qe(s,{state:"proceeding",proceed:void 0,reset:void 0,location:a}),t.then((()=>e.history.go(r)))},reset(){let e=new Map(T.blockers);e.set(s,se),Q({blockers:e})}})}return de(t,a)})),a){!function(e,t){try{let a=e.sessionStorage.getItem(ie);if(a){let e=JSON.parse(a);for(let[a,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(a,new Set(r||[]))}}catch(e){}}(t,z);let e=()=>function(e,t){if(t.size>0){let a={};for(let[e,r]of t)a[e]=[...r];try{e.sessionStorage.setItem(ie,JSON.stringify(a))}catch(e){h(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}(t,z);t.addEventListener("pagehide",e),A=()=>t.removeEventListener("pagehide",e)}return T.initialized||de("POP",T.location,{initialHydration:!0}),n},subscribe:function(e){return g.add(e),()=>g.delete(e)},enableScrollRestoration:function(e,t,a){if(x=e,v=t,w=a||null,!C&&T.navigation===ae){C=!0;let e=tt(T.location,T.matches);null!=e&&Q({restoreScrollPosition:e})}return()=>{x=null,v=null,w=null}},navigate:async function t(a,r){if("number"==typeof a)return void e.history.go(a);let s=ce(T.location,T.matches,c,a,r?.fromRouteId,r?.relative),{path:n,submission:o,error:i}=ue(!1,s,r),d=T.location,l=f(T.location,n,r&&r.state);l={...l,...e.history.encodeLocation(l)};let u=r&&null!=r.replace?r.replace:void 0,m="PUSH";!0===u?m="REPLACE":!1===u||null!=o&&Ve(o.formMethod)&&o.formAction===T.location.pathname+T.location.search&&(m="REPLACE");let k=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,h=!0===(r&&r.flushSync),p=Ke({currentLocation:d,nextLocation:l,historyAction:m});p?qe(p,{state:"blocked",location:l,proceed(){qe(p,{state:"proceeding",proceed:void 0,reset:void 0,location:l}),t(a,r)},reset(){let e=new Map(T.blockers);e.set(p,se),Q({blockers:e})}}):await de(m,l,{submission:o,pendingError:i,preventScrollReset:k,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:h})},fetch:async function(t,a,s,n){_e(t);let u=!0===(n&&n.flushSync),m=r||l,h=ce(T.location,T.matches,c,s,a,n?.relative),p=N(m,h,c),f=at(p,m,h);if(f.active&&f.matches&&(p=f.matches),!p)return void ye(t,a,Oe(404,{pathname:h}),{flushSync:u});let{path:g,submission:x,error:b}=ue(!0,h,n);if(b)return void ye(t,a,b,{flushSync:u});let w=Ge(p,g),v=new y(e.unstable_getContext?await e.unstable_getContext():void 0),j=!0===(n&&n.preventScrollReset);x&&Ve(x.formMethod)?await async function(t,a,s,n,u,m,h,p,f,g){function x(e){if(!e.route.action&&!e.route.lazy){let e=Oe(405,{method:g.formMethod,pathname:s,routeId:a});return ye(t,a,e,{flushSync:p}),!0}return!1}if(xe(),K.delete(t),!h&&x(n))return;let b=T.fetchers.get(t);be(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(g,b),{flushSync:p});let y=new AbortController,w=De(e.history,s,y.signal,g);if(h){let e=await rt(u,s,w.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ye(t,a,e.error,{flushSync:p});if(!e.matches)return void ye(t,a,Oe(404,{pathname:s}),{flushSync:p});if(x(n=Ge(u=e.matches,s)))return}U.set(t,y);let v=H,j=Ce(i,d,w,u,n,o,m),_=(await fe(w,j,m,t))[n.route.id];if(w.signal.aborted)return void(U.get(t)===y&&U.delete(t));if(J.has(t)){if(He(_)||Ue(_))return void be(t,Ze(void 0))}else{if(He(_))return U.delete(t),W>v?void be(t,Ze(void 0)):(V.add(t),be(t,Xe(g)),he(w,_,!1,{fetcherSubmission:g,preventScrollReset:f}));if(Ue(_))return void ye(t,a,_.error)}let C=T.navigation.location||T.location,S=De(e.history,C,y.signal),E=r||l,R="idle"!==T.navigation.state?N(E,T.navigation.location,c):T.matches;k(R,"Didn't find any matches after fetcher action");let P=++H;q.set(t,P);let L=Xe(g,_.data);T.fetchers.set(t,L);let{dsMatches:$,revalidatingFetchers:z}=me(S,m,i,d,e.history,T,R,g,C,o,!1,I,B,J,K,V,E,c,null!=e.patchRoutesOnNavigation,[n.route.id,_]);z.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,a=T.fetchers.get(t),r=Xe(void 0,a?a.data:void 0);T.fetchers.set(t,r),_e(t),e.controller&&U.set(t,e.controller)})),Q({fetchers:new Map(T.fetchers)});let A=()=>z.forEach((e=>_e(e.key)));y.signal.addEventListener("abort",A);let{loaderResults:O,fetcherResults:F}=await ge($,z,S,m);if(y.signal.aborted)return;if(y.signal.removeEventListener("abort",A),q.delete(t),U.delete(t),z.forEach((e=>U.delete(e.key))),T.fetchers.has(t)){let e=Ze(_.data);T.fetchers.set(t,e)}let G=Fe(O);if(G)return he(S,G.result,!1,{preventScrollReset:f});if(G=Fe(F),G)return V.add(G.key),he(S,G.result,!1,{preventScrollReset:f});let{loaderData:Y,errors:X}=Me(T,R,O,void 0,z,F);Ie(P),"loading"===T.navigation.state&&P>W?(k(M,"Expected pending action"),D&&D.abort(),ee(T.navigation.location,{matches:R,loaderData:Y,errors:X,fetchers:new Map(T.fetchers)})):(Q({errors:X,loaderData:Le(T.loaderData,Y,R,X),fetchers:new Map(T.fetchers)}),I=!1)}(t,a,g,w,p,v,f.active,u,j,x):(K.set(t,{routeId:a,path:g}),await async function(t,a,r,s,n,l,c,u,m,k){let h=T.fetchers.get(t);be(t,Xe(k,h?h.data:void 0),{flushSync:u});let p=new AbortController,f=De(e.history,r,p.signal);if(c){let e=await rt(n,r,f.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ye(t,a,e.error,{flushSync:u});if(!e.matches)return void ye(t,a,Oe(404,{pathname:r}),{flushSync:u});s=Ge(n=e.matches,r)}U.set(t,p);let g=H,x=Ce(i,d,f,n,s,o,l),b=(await fe(f,x,l,t))[s.route.id];if(U.get(t)===p&&U.delete(t),!f.signal.aborted){if(!J.has(t))return He(b)?W>g?void be(t,Ze(void 0)):(V.add(t),void await he(f,b,!1,{preventScrollReset:m})):void(Ue(b)?ye(t,a,b.error):be(t,Ze(b.data)));be(t,Ze(void 0))}}(t,a,g,w,p,v,f.active,u,j,x))},revalidate:function(){Z||(Z=function(){let e,t,a=new Promise(((r,s)=>{e=async e=>{r(e);try{await a}catch(e){}},t=async e=>{s(e);try{await a}catch(e){}}}));return{promise:a,resolve:e,reject:t}}()),xe(),Q({revalidation:"loading"});let e=Z.promise;return"submitting"===T.navigation.state?e:"idle"===T.navigation.state?(de(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),e):(de(M||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:!0===$}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:je,deleteFetcher:function(e){let t=(G.get(e)||0)-1;t<=0?(G.delete(e),J.add(e)):G.set(e,t),Q({fetchers:new Map(T.fetchers)})},dispose:function(){p&&p(),A&&A(),g.clear(),D&&D.abort(),T.fetchers.forEach(((e,t)=>Ne(t))),T.blockers.forEach(((e,t)=>We(t)))},getBlocker:function(e,t){let a=T.blockers.get(e)||se;return X.get(e)!==t&&X.set(e,t),a},deleteBlocker:We,patchRoutes:function(e,t){let a=null==r;pe(e,t,r||l,d,i),a&&(l=[...l],Q({}))},_internalFetchControllers:U,_internalSetRoutes:function(e){d={},r=j(e,i,void 0,d)}},n}function ce(e,t,a,r,s,n){let o,i;if(s){o=[];for(let e of t)if(o.push(e),e.route.id===s){i=e;break}}else o=t,i=t[t.length-1];let d=H(r||".",U(o),F(e.pathname,a)||e.pathname,"path"===n);if(null==r&&(d.search=e.search,d.hash=e.hash),(null==r||""===r||"."===r)&&i){let e=Ke(d.search);if(i.route.index&&!e)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!i.route.index&&e){let e=new URLSearchParams(d.search),t=e.getAll("index");e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let a=e.toString();d.search=a?`?${a}`:""}}return"/"!==a&&(d.pathname="/"===d.pathname?a:W([a,d.pathname])),g(d)}function ue(e,t,a){if(!a||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(a))return{path:t};if(a.formMethod&&(r=a.formMethod,!Q.has(r.toUpperCase())))return{path:t,error:Oe(405,{method:a.formMethod})};var r;let s,n,o=()=>({path:t,error:Oe(400,{type:"invalid-body"})}),i=(a.formMethod||"get").toUpperCase(),d=Ie(t);if(void 0!==a.body){if("text/plain"===a.formEncType){if(!Ve(i))return o();let e="string"==typeof a.body?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce(((e,[t,a])=>`${e}${t}=${a}\n`),""):String(a.body);return{path:t,submission:{formMethod:i,formAction:d,formEncType:a.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===a.formEncType){if(!Ve(i))return o();try{let e="string"==typeof a.body?JSON.parse(a.body):a.body;return{path:t,submission:{formMethod:i,formAction:d,formEncType:a.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return o()}}}if(k("function"==typeof FormData,"FormData is not available in this environment"),a.formData)s=Pe(a.formData),n=a.formData;else if(a.body instanceof FormData)s=Pe(a.body),n=a.body;else if(a.body instanceof URLSearchParams)s=a.body,n=Te(s);else if(null==a.body)s=new URLSearchParams,n=new FormData;else try{s=new URLSearchParams(a.body),n=Te(s)}catch(e){return o()}let l={formMethod:i,formAction:d,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:n,json:void 0,text:void 0};if(Ve(l.formMethod))return{path:t,submission:l};let c=x(t);return e&&c.search&&Ke(c.search)&&s.append("index",""),c.search=`?${s}`,{path:g(c),submission:l}}function me(e,t,a,r,s,n,o,i,d,l,c,u,m,k,h,p,f,g,x,b){let y,w=b?Ue(b[1])?b[1].error:b[1].data:void 0,v=s.createURL(n.location),j=s.createURL(d);if(c&&n.errors){let e=Object.keys(n.errors)[0];y=o.findIndex((t=>t.route.id===e))}else if(b&&Ue(b[1])){let e=b[0];y=o.findIndex((t=>t.route.id===e))-1}let _=b?b[1].statusCode:void 0,C=_&&_>=400,S={currentUrl:v,currentParams:n.matches[0]?.params||{},nextUrl:j,nextParams:o[0].params,...i,actionResult:w,actionStatus:_},E=o.map(((s,o)=>{let{route:i}=s,d=null;if(null!=y&&o>y?d=!1:i.lazy?d=!0:null==i.loader?d=!1:c?d=ke(i,n.loaderData,n.errors):function(e,t,a){let r=!t||a.route.id!==t.route.id,s=!e.hasOwnProperty(a.route.id);return r||s}(n.loaderData,n.matches[o],s)&&(d=!0),null!==d)return _e(a,r,e,s,l,t,d);let m=!C&&(u||v.pathname+v.search===j.pathname+j.search||v.search!==j.search||function(e,t){let a=e.route.path;return e.pathname!==t.pathname||null!=a&&a.endsWith("*")&&e.params["*"]!==t.params["*"]}(n.matches[o],s)),k={...S,defaultShouldRevalidate:m},h=he(s,k);return _e(a,r,e,s,l,t,h,k)})),R=[];return h.forEach(((e,i)=>{if(c||!o.some((t=>t.route.id===e.routeId))||k.has(i))return;let d=n.fetchers.get(i),h=d&&"idle"!==d.state&&void 0===d.data,b=N(f,e.path,g);if(!b){if(x&&h)return;return void R.push({key:i,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null})}if(p.has(i))return;let y=Ge(b,e.path),w=new AbortController,v=De(s,e.path,w.signal),j=null;if(m.has(i))m.delete(i),j=Ce(a,r,v,b,y,l,t);else if(h)u&&(j=Ce(a,r,v,b,y,l,t));else{let e={...S,defaultShouldRevalidate:!C&&u};he(y,e)&&(j=Ce(a,r,v,b,y,l,t,e))}j&&R.push({key:i,routeId:e.routeId,path:e.path,matches:j,match:y,request:v,controller:w})})),{dsMatches:E,revalidatingFetchers:R}}function ke(e,t,a){if(e.lazy)return!0;if(!e.loader)return!1;let r=null!=t&&e.id in t,s=null!=a&&void 0!==a[e.id];return!(!r&&s)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!r&&!s)}function he(e,t){if(e.route.shouldRevalidate){let a=e.route.shouldRevalidate(t);if("boolean"==typeof a)return a}return t.defaultShouldRevalidate}function pe(e,t,a,r,s){let n;if(e){let t=r[e];k(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),n=t.children}else n=a;let o=j(t.filter((e=>!n.some((t=>fe(e,t))))),s,[e||"_","patch",String(n?.length||"0")],r);n.push(...o)}function fe(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||e.children.every(((e,a)=>t.children?.some((t=>fe(e,t))))))}var ge=new WeakMap,xe=({key:e,route:t,manifest:a,mapRouteProperties:r})=>{let s=a[t.id];if(k(s,"No route found in manifest"),!s.lazy||"object"!=typeof s.lazy)return;let n=s.lazy[e];if(!n)return;let o=ge.get(s);o||(o={},ge.set(s,o));let i=o[e];if(i)return i;let d=(async()=>{let t=function(e){return w.has(e)}(e),a=void 0!==s[e]&&"hasErrorBoundary"!==e;if(t)h(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),o[e]=Promise.resolve();else if(a)h(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await n();null!=t&&(Object.assign(s,{[e]:t}),Object.assign(s,r(s)))}"object"==typeof s.lazy&&(s.lazy[e]=void 0,Object.values(s.lazy).every((e=>void 0===e))&&(s.lazy=void 0))})();return o[e]=d,d},be=new WeakMap;async function ye(e){let t=e.matches.filter((e=>e.shouldLoad)),a={};return(await Promise.all(t.map((e=>e.resolve())))).forEach(((e,r)=>{a[t[r].route.id]=e})),a}async function we(e){return e.matches.some((e=>e.route.unstable_middleware))?ve(e,!1,(()=>ye(e)),((e,t)=>({[t]:{type:"error",result:e}}))):ye(e)}async function ve(e,t,a,r){let{matches:s,request:n,params:o,context:i}=e,d={handlerResult:void 0};try{let e=s.flatMap((e=>e.route.unstable_middleware?e.route.unstable_middleware.map((t=>[e.route.id,t])):[])),r=await je({request:n,params:o,context:i},e,t,d,a);return t?r:d.handlerResult}catch(e){if(!d.middlewareError)throw e;let a=await r(d.middlewareError.error,d.middlewareError.routeId);return t||!d.handlerResult?a:Object.assign(d.handlerResult,a)}}async function je(e,t,a,r,s,n=0){let{request:o}=e;if(o.signal.aborted){if(o.signal.reason)throw o.signal.reason;throw new Error(`Request aborted without an \`AbortSignal.reason\`: ${o.method} ${o.url}`)}let i=t[n];if(!i)return r.handlerResult=await s(),r.handlerResult;let d,[l,c]=i,u=!1,m=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");u=!0;let o=await je(e,t,a,r,s,n+1);if(a)return d=o,d};try{let t=await c({request:e.request,params:e.params,context:e.context},m);return u?void 0===t?d:t:m()}catch(e){throw r.middlewareError?r.middlewareError.error!==e&&(r.middlewareError={routeId:l,error:e}):r.middlewareError={routeId:l,error:e},e}}function Ne(e,t,a,r,s){let n=xe({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),o=function(e,t,a,r,s){let n=a[e.id];if(k(n,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=be.get(n);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let a=(async()=>{k("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),a={};for(let e in t){let r=t[e];if(void 0===r)continue;let o=(s=e,v.has(s)),i=void 0!==n[e]&&"hasErrorBoundary"!==e;o?h(!o,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):i?h(!i,`Route "${n.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):a[e]=r}var s;Object.assign(n,a),Object.assign(n,{...r(n),lazy:void 0})})();return be.set(n,a),a.catch((()=>{})),{lazyRoutePromise:a,lazyHandlerPromise:a}}let o,i=Object.keys(e.lazy),d=[];for(let n of i){if(s&&s.includes(n))continue;let i=xe({key:n,route:e,manifest:a,mapRouteProperties:r});i&&(d.push(i),n===t&&(o=i))}let l=d.length>0?Promise.all(d).then((()=>{})):void 0;return l?.catch((()=>{})),o?.catch((()=>{})),{lazyRoutePromise:l,lazyHandlerPromise:o}}(r.route,Ve(a.method)?"action":"loader",t,e,s);return{middleware:n,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function _e(e,t,a,r,s,n,o,i=null){let d=!1,l=Ne(e,t,a,r,s);return{...r,_lazyPromises:l,shouldLoad:o,unstable_shouldRevalidateArgs:i,unstable_shouldCallHandler:e=>(d=!0,i?he(r,"boolean"==typeof e?{...i,defaultShouldRevalidate:e}:i):o),resolve:e=>d||o||e&&"GET"===a.method&&(r.route.lazy||r.route.loader)?async function({request:e,match:t,lazyHandlerPromise:a,lazyRoutePromise:r,handlerOverride:s,scopedContext:n}){let o,i,d=Ve(e.method),l=d?"action":"loader",c=a=>{let r,o=new Promise(((e,t)=>r=t));i=()=>r(),e.signal.addEventListener("abort",i);let d=r=>"function"!=typeof a?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${l}" [routeId: ${t.route.id}]`)):a({request:e,params:t.params,context:n},...void 0!==r?[r]:[]),c=(async()=>{try{return{type:"data",result:await(s?s((e=>d(e))):d())}}catch(e){return{type:"error",result:e}}})();return Promise.race([c,o])};try{let s=d?t.route.action:t.route.loader;if(a||r)if(s){let e,[t]=await Promise.all([c(s).catch((t=>{e=t})),a,r]);if(void 0!==e)throw e;o=t}else{await a;let s=d?t.route.action:t.route.loader;if(!s){if("action"===l){let a=new URL(e.url),r=a.pathname+a.search;throw Oe(405,{method:e.method,pathname:r,routeId:t.route.id})}return{type:"data",result:void 0}}[o]=await Promise.all([c(s),r])}else{if(!s){let t=new URL(e.url);throw Oe(404,{pathname:t.pathname+t.search})}o=await c(s)}}catch(e){return{type:"error",result:e}}finally{i&&e.signal.removeEventListener("abort",i)}return o}({request:a,match:r,lazyHandlerPromise:l?.handler,lazyRoutePromise:l?.route,handlerOverride:e,scopedContext:n}):Promise.resolve({type:"data",result:void 0})}}function Ce(e,t,a,r,s,n,o,i=null){return r.map((r=>r.route.id!==s.route.id?{...r,shouldLoad:!1,unstable_shouldRevalidateArgs:i,unstable_shouldCallHandler:()=>!1,_lazyPromises:Ne(e,t,a,r,n),resolve:()=>Promise.resolve({type:"data",result:void 0})}:_e(e,t,a,r,n,o,!0,i)))}async function Se(e){let{result:t,type:a}=e;if(qe(t)){let e;try{let a=t.headers.get("Content-Type");e=a&&/\bapplication\/json\b/.test(a)?null==t.body?null:await t.json():await t.text()}catch(e){return{type:"error",error:e}}return"error"===a?{type:"error",error:new G(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}return"error"===a?We(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new G(t.init?.status||500,void 0,t.data),statusCode:Y(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Y(t)?t.status:void 0}:We(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Ee(e,t,a,r,s){let n=e.headers.get("Location");if(k(n,"Redirects returned/thrown from loaders/actions must have a Location header"),!ne.test(n)){let o=r.slice(0,r.findIndex((e=>e.route.id===a))+1);n=ce(new URL(t.url),o,s,n),e.headers.set("Location",n)}return e}function Re(e,t,a){if(ne.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),n=null!=F(s.pathname,a);if(s.origin===t.origin&&n)return s.pathname+s.search+s.hash}return e}function De(e,t,a,r){let s=e.createURL(Ie(t)).toString(),n={signal:a};if(r&&Ve(r.formMethod)){let{formMethod:e,formEncType:t}=r;n.method=e.toUpperCase(),"application/json"===t?(n.headers=new Headers({"Content-Type":t}),n.body=JSON.stringify(r.json)):"text/plain"===t?n.body=r.text:"application/x-www-form-urlencoded"===t&&r.formData?n.body=Pe(r.formData):n.body=r.formData}return new Request(s,n)}function Pe(e){let t=new URLSearchParams;for(let[a,r]of e.entries())t.append(a,"string"==typeof r?r:r.name);return t}function Te(e){let t=new FormData;for(let[a,r]of e.entries())t.append(a,r);return t}function Me(e,t,a,r,s,n){let{loaderData:o,errors:i}=function(e,t,a,r=!1,s=!1){let n,o={},i=null,d=!1,l={},c=a&&Ue(a[1])?a[1].error:void 0;return e.forEach((a=>{if(!(a.route.id in t))return;let u=a.route.id,m=t[u];if(k(!He(m),"Cannot handle redirect results in processLoaderData"),Ue(m)){let t=m.error;if(void 0!==c&&(t=c,c=void 0),i=i||{},s)i[u]=t;else{let a=ze(e,u);null==i[a.route.id]&&(i[a.route.id]=t)}r||(o[u]=de),d||(d=!0,n=Y(m.error)?m.error.status:500),m.headers&&(l[u]=m.headers)}else o[u]=m.data,m.statusCode&&200!==m.statusCode&&!d&&(n=m.statusCode),m.headers&&(l[u]=m.headers)})),void 0!==c&&a&&(i={[a[0]]:c},a[2]&&(o[a[2]]=void 0)),{loaderData:o,errors:i,statusCode:n||200,loaderHeaders:l}}(t,a,r);return s.filter((e=>!e.matches||e.matches.some((e=>e.shouldLoad)))).forEach((t=>{let{key:a,match:r,controller:s}=t,o=n[a];if(k(o,"Did not find corresponding fetcher result"),!s||!s.signal.aborted)if(Ue(o)){let t=ze(e.matches,r?.route.id);i&&i[t.route.id]||(i={...i,[t.route.id]:o.error}),e.fetchers.delete(a)}else if(He(o))k(!1,"Unhandled fetcher revalidation redirect");else{let t=Ze(o.data);e.fetchers.set(a,t)}})),{loaderData:o,errors:i}}function Le(e,t,a,r){let s=Object.entries(t).filter((([,e])=>e!==de)).reduce(((e,[t,a])=>(e[t]=a,e)),{});for(let n of a){let a=n.route.id;if(!t.hasOwnProperty(a)&&e.hasOwnProperty(a)&&n.route.loader&&(s[a]=e[a]),r&&r.hasOwnProperty(a))break}return s}function $e(e){return e?Ue(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ze(e,t){return(t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function Ae(e){let t=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Oe(e,{pathname:t,routeId:a,method:r,type:s,message:n}={}){let o="Unknown Server Error",i="Unknown @remix-run/router error";return 400===e?(o="Bad Request",r&&t&&a?i=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${a}", so there is no way to handle the request.`:"invalid-body"===s&&(i="Unable to encode submission body")):403===e?(o="Forbidden",i=`Route "${a}" does not match URL "${t}"`):404===e?(o="Not Found",i=`No route matches URL "${t}"`):405===e&&(o="Method Not Allowed",r&&t&&a?i=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${a}", so there is no way to handle the request.`:r&&(i=`Invalid request method "${r.toUpperCase()}"`)),new G(e||500,o,new Error(i),!0)}function Fe(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[a,r]=t[e];if(He(r))return{key:a,result:r}}}function Ie(e){return g({..."string"==typeof e?x(e):e,hash:""})}function Be(e){return qe(e.result)&&ee.has(e.result.status)}function Ue(e){return"error"===e.type}function He(e){return"redirect"===(e&&e.type)}function We(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function qe(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function Ve(e){return X.has(e.toUpperCase())}function Ke(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Ge(e,t){let a="string"==typeof t?x(t).search:t.search;if(e[e.length-1].route.index&&Ke(a||""))return e[e.length-1];let r=B(e);return r[r.length-1]}function Ye(e){let{formMethod:t,formAction:a,formEncType:r,text:s,formData:n,json:o}=e;if(t&&a&&r)return null!=s?{formMethod:t,formAction:a,formEncType:r,formData:void 0,json:void 0,text:s}:null!=n?{formMethod:t,formAction:a,formEncType:r,formData:n,json:void 0,text:void 0}:void 0!==o?{formMethod:t,formAction:a,formEncType:r,formData:void 0,json:o,text:void 0}:void 0}function Je(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Xe(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Ze(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}var Qe=i.createContext(null);Qe.displayName="DataRouter";var et=i.createContext(null);et.displayName="DataRouterState";var tt=i.createContext({isTransitioning:!1});tt.displayName="ViewTransition";var at=i.createContext(new Map);at.displayName="Fetchers",i.createContext(null).displayName="Await";var rt=i.createContext(null);rt.displayName="Navigation";var st=i.createContext(null);st.displayName="Location";var nt=i.createContext({outlet:null,matches:[],isDataRoute:!1});nt.displayName="Route";var ot=i.createContext(null);function it(){return null!=i.useContext(st)}function dt(){return k(it(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(st).location}ot.displayName="RouteError";var lt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ct(e){i.useContext(rt).static||i.useLayoutEffect(e)}function ut(){let{isDataRoute:e}=i.useContext(nt);return e?function(){let{router:e}=function(e){let t=i.useContext(Qe);return k(t,bt(e)),t}("useNavigate"),t=wt("useNavigate"),a=i.useRef(!1);return ct((()=>{a.current=!0})),i.useCallback((async(r,s={})=>{h(a.current,lt),a.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...s}))}),[e,t])}():function(){k(it(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(Qe),{basename:t,navigator:a}=i.useContext(rt),{matches:r}=i.useContext(nt),{pathname:s}=dt(),n=JSON.stringify(U(r)),o=i.useRef(!1);return ct((()=>{o.current=!0})),i.useCallback(((r,i={})=>{if(h(o.current,lt),!o.current)return;if("number"==typeof r)return void a.go(r);let d=H(r,JSON.parse(n),s,"path"===i.relative);null==e&&"/"!==t&&(d.pathname="/"===d.pathname?t:W([t,d.pathname])),(i.replace?a.replace:a.push)(d,i.state,i)}),[t,a,n,s,e])}()}var mt=i.createContext(null);function kt(e,{relative:t}={}){let{matches:a}=i.useContext(nt),{pathname:r}=dt(),s=JSON.stringify(U(a));return i.useMemo((()=>H(e,JSON.parse(s),r,"path"===t)),[e,s,r,t])}function ht(e,t,a,r){k(it(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=i.useContext(rt),{matches:n}=i.useContext(nt),o=n[n.length-1],d=o?o.params:{},l=o?o.pathname:"/",c=o?o.pathnameBase:"/",u=o&&o.route;{let e=u&&u.path||"";Nt(l,!u||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let m,p=dt();if(t){let e="string"==typeof t?x(t):t;k("/"===c||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),m=e}else m=p;let f=m.pathname||"/",g=f;if("/"!==c){let e=c.replace(/^\//,"").split("/");g="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=N(e,{pathname:g});h(u||null!=b,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),h(null==b||void 0!==b[b.length-1].route.element||void 0!==b[b.length-1].route.Component||void 0!==b[b.length-1].route.lazy,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=function(e,t=[],a=null){if(null==e){if(!a)return null;if(a.errors)e=a.matches;else{if(0!==t.length||a.initialized||!(a.matches.length>0))return null;e=a.matches}}let r=e,s=a?.errors;if(null!=s){let e=r.findIndex((e=>e.route.id&&void 0!==s?.[e.route.id]));k(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,e+1))}let n=!1,o=-1;if(a)for(let e=0;e<r.length;e++){let t=r[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(o=e),t.route.id){let{loaderData:e,errors:s}=a,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!s||void 0===s[t.route.id]);if(t.route.lazy||i){n=!0,r=o>=0?r.slice(0,o+1):[r[0]];break}}}return r.reduceRight(((e,d,l)=>{let c,u=!1,m=null,k=null;a&&(c=s&&d.route.id?s[d.route.id]:void 0,m=d.route.errorElement||ft,n&&(o<0&&0===l?(Nt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,k=null):o===l&&(u=!0,k=d.route.hydrateFallbackElement||null)));let h=t.concat(r.slice(0,l+1)),p=()=>{let t;return t=c?m:u?k:d.route.Component?i.createElement(d.route.Component,null):d.route.element?d.route.element:e,i.createElement(xt,{match:d,routeContext:{outlet:e,matches:h,isDataRoute:null!=a},children:t})};return a&&(d.route.ErrorBoundary||d.route.errorElement||0===l)?i.createElement(gt,{location:a.location,revalidation:a.revalidation,component:m,error:c,children:p(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):p()}),null)}(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},d,e.params),pathname:W([c,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:W([c,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),n,a,r);return t&&y?i.createElement(st.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...m},navigationType:"POP"}},y):y}function pt(){let e=vt(),t=Y(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},n={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:n},"ErrorBoundary")," or"," ",i.createElement("code",{style:n},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),a?i.createElement("pre",{style:s},a):null,o)}var ft=i.createElement(pt,null),gt=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?i.createElement(nt.Provider,{value:this.props.routeContext},i.createElement(ot.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function xt({routeContext:e,match:t,children:a}){let r=i.useContext(Qe);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(nt.Provider,{value:e},a)}function bt(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function yt(e){let t=i.useContext(et);return k(t,bt(e)),t}function wt(e){let t=function(e){let t=i.useContext(nt);return k(t,bt(e)),t}(e),a=t.matches[t.matches.length-1];return k(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function vt(){let e=i.useContext(ot),t=yt("useRouteError"),a=wt("useRouteError");return void 0!==e?e:t.errors?.[a]}var jt={};function Nt(e,t,a){t||jt[e]||(jt[e]=!0,h(!1,a))}var _t={};function Ct(e,t){e||_t[t]||(_t[t]=!0,console.warn(t))}function St(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&h(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:i.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&h(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:i.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&h(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:i.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Et=["HydrateFallback","hydrateFallbackElement"],Rt=class{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}};function Dt({router:e,flushSync:t}){let[a,r]=i.useState(e.state),[s,n]=i.useState(),[o,d]=i.useState({isTransitioning:!1}),[l,c]=i.useState(),[u,m]=i.useState(),[k,h]=i.useState(),p=i.useRef(new Map),f=i.useCallback(((a,{deletedFetchers:s,flushSync:o,viewTransitionOpts:k})=>{a.fetchers.forEach(((e,t)=>{void 0!==e.data&&p.current.set(t,e.data)})),s.forEach((e=>p.current.delete(e))),Ct(!1===o||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable.  Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let f=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(Ct(null==k||f,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),k&&f){if(t&&o){t((()=>{u&&(l&&l.resolve(),u.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:k.currentLocation,nextLocation:k.nextLocation})}));let s=e.window.document.startViewTransition((()=>{t((()=>r(a)))}));return s.finished.finally((()=>{t((()=>{c(void 0),m(void 0),n(void 0),d({isTransitioning:!1})}))})),void t((()=>m(s)))}u?(l&&l.resolve(),u.skipTransition(),h({state:a,currentLocation:k.currentLocation,nextLocation:k.nextLocation})):(n(a),d({isTransitioning:!0,flushSync:!1,currentLocation:k.currentLocation,nextLocation:k.nextLocation}))}else t&&o?t((()=>r(a))):i.startTransition((()=>r(a)))}),[e.window,t,u,l]);i.useLayoutEffect((()=>e.subscribe(f)),[e,f]),i.useEffect((()=>{o.isTransitioning&&!o.flushSync&&c(new Rt)}),[o]),i.useEffect((()=>{if(l&&s&&e.window){let t=s,a=l.promise,o=e.window.document.startViewTransition((async()=>{i.startTransition((()=>r(t))),await a}));o.finished.finally((()=>{c(void 0),m(void 0),n(void 0),d({isTransitioning:!1})})),m(o)}}),[s,l,e.window]),i.useEffect((()=>{l&&s&&a.location.key===s.location.key&&l.resolve()}),[l,u,a.location,s]),i.useEffect((()=>{!o.isTransitioning&&k&&(n(k.state),d({isTransitioning:!0,flushSync:!1,currentLocation:k.currentLocation,nextLocation:k.nextLocation}),h(void 0))}),[o.isTransitioning,k]);let g=i.useMemo((()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,a,r)=>e.navigate(t,{state:a,preventScrollReset:r?.preventScrollReset}),replace:(t,a,r)=>e.navigate(t,{replace:!0,state:a,preventScrollReset:r?.preventScrollReset})})),[e]),x=e.basename||"/",b=i.useMemo((()=>({router:e,navigator:g,static:!1,basename:x})),[e,g,x]);return i.createElement(i.Fragment,null,i.createElement(Qe.Provider,{value:b},i.createElement(et.Provider,{value:a},i.createElement(at.Provider,{value:p.current},i.createElement(tt.Provider,{value:o},i.createElement(Mt,{basename:x,location:a.location,navigationType:a.historyAction,navigator:g},i.createElement(Pt,{routes:e.routes,future:e.future,state:a})))))),null)}var Pt=i.memo((function({routes:e,future:t,state:a}){return ht(e,void 0,a,t)}));function Tt(e){return function(e){let t=i.useContext(nt).outlet;return t?i.createElement(mt.Provider,{value:e},t):t}(e.context)}function Mt({basename:e="/",children:t=null,location:a,navigationType:r="POP",navigator:s,static:n=!1}){k(!it(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),d=i.useMemo((()=>({basename:o,navigator:s,static:n,future:{}})),[o,s,n]);"string"==typeof a&&(a=x(a));let{pathname:l="/",search:c="",hash:u="",state:m=null,key:p="default"}=a,f=i.useMemo((()=>{let e=F(l,o);return null==e?null:{location:{pathname:e,search:c,hash:u,state:m,key:p},navigationType:r}}),[o,l,c,u,m,p,r]);return h(null!=f,`<Router basename="${o}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),null==f?null:i.createElement(rt.Provider,{value:d},i.createElement(st.Provider,{children:t,value:f}))}i.Component;var Lt="get",$t="application/x-www-form-urlencoded";function zt(e){return null!=e&&"string"==typeof e.tagName}var At=null,Ot=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ft(e){return null==e||Ot.has(e)?e:(h(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$t}"`),null)}function It(e,t){if(!1===e||null==e)throw new Error(t)}function Bt(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Ut(e,t,a,r,s,n){let o=(e,t)=>!a[t]||e.route.id!==a[t].route.id,i=(e,t)=>a[t].pathname!==e.pathname||a[t].route.path?.endsWith("*")&&a[t].params["*"]!==e.params["*"];return"assets"===n?t.filter(((e,t)=>o(e,t)||i(e,t))):"data"===n?t.filter(((t,n)=>{let d=r.routes[t.route.id];if(!d||!d.hasLoader)return!1;if(o(t,n)||i(t,n))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:a[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0})):[]}function Ht(e,t,{includeHydrateFallback:a}={}){return r=e.map((e=>{let r=t.routes[e.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),a&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s})).flat(1),[...new Set(r)];var r}Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),"undefined"!=typeof window?window:"undefined"!=typeof globalThis&&globalThis,Symbol("SingleFetchRedirect");function Wt(){let e=i.useContext(Qe);return It(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function qt(){let e=i.useContext(et);return It(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}i.Component;var Vt=i.createContext(void 0);function Kt(){let e=i.useContext(Vt);return It(e,"You must render this element inside a <HydratedRouter> element"),e}function Gt(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function Yt({page:e,...t}){let{router:a}=Wt(),r=i.useMemo((()=>N(a.routes,e,a.basename)),[a.routes,e,a.basename]);return r?i.createElement(Xt,{page:e,matches:r,...t}):null}function Jt(e){let{manifest:t,routeModules:a}=Kt(),[r,s]=i.useState([]);return i.useEffect((()=>{let r=!1;return async function(e,t,a){return function(e,t){let a=new Set,r=new Set(t);return e.reduce(((e,s)=>{if(t&&(null==(n=s)||"string"!=typeof n.page)&&"script"===s.as&&s.href&&r.has(s.href))return e;var n;let o=JSON.stringify(function(e){let t={},a=Object.keys(e).sort();for(let r of a)t[r]=e[r];return t}(s));return a.has(o)||(a.add(o),e.push({key:o,link:s})),e}),[])}((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise((()=>{}))}}(r,a);return e.links?e.links():[]}return[]})))).flat(1).filter(Bt).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}(e,t,a).then((e=>{r||s(e)})),()=>{r=!0}}),[e,t,a]),r}function Xt({page:e,matches:t,...a}){let r=dt(),{manifest:s,routeModules:n}=Kt(),{basename:o}=Wt(),{loaderData:d,matches:l}=qt(),c=i.useMemo((()=>Ut(e,t,l,s,r,"data")),[e,t,l,s,r]),u=i.useMemo((()=>Ut(e,t,l,s,r,"assets")),[e,t,l,s,r]),m=i.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let a=new Set,i=!1;if(t.forEach((e=>{let t=s.routes[e.route.id];t&&t.hasLoader&&(!c.some((t=>t.route.id===e.route.id))&&e.route.id in d&&n[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:a.add(e.route.id))})),0===a.size)return[];let l=function(e,t){let a="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return"/"===a.pathname?a.pathname="_root.data":t&&"/"===F(a.pathname,t)?a.pathname=`${t.replace(/\/$/,"")}/_root.data`:a.pathname=`${a.pathname.replace(/\/$/,"")}.data`,a}(e,o);return i&&a.size>0&&l.searchParams.set("_routes",t.filter((e=>a.has(e.route.id))).map((e=>e.route.id)).join(",")),[l.pathname+l.search]}),[o,d,r,s,c,t,e,n]),k=i.useMemo((()=>Ht(u,s)),[u,s]),h=Jt(u);return i.createElement(i.Fragment,null,m.map((e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...a}))),k.map((e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...a}))),h.map((({key:e,link:t})=>i.createElement("link",{key:e,...t}))))}Vt.displayName="FrameworkContext";function Zt(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}var Qt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Qt&&(window.__reactRouterVersion="7.6.3")}catch(vr){}function ea(e,t){return le({basename:t?.basename,unstable_getContext:t?.unstable_getContext,future:t?.future,history:m({window:t?.window}),hydrationData:t?.hydrationData||ta(),routes:e,mapRouteProperties:St,hydrationRouteProperties:Et,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function ta(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:aa(e.errors)}),e}function aa(e){if(!e)return null;let t=Object.entries(e),a={};for(let[e,r]of t)if(r&&"RouteErrorResponse"===r.__type)a[e]=new G(r.status,r.statusText,r.data,!0===r.internal);else if(r&&"Error"===r.__type){if(r.__subType){let t=window[r.__subType];if("function"==typeof t)try{let s=new t(r.message);s.stack="",a[e]=s}catch(e){}}if(null==a[e]){let t=new Error(r.message);t.stack="",a[e]=t}}else a[e]=r;return a}var ra=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sa=i.forwardRef((function({onClick:e,discover:t="render",prefetch:a="none",relative:r,reloadDocument:s,replace:n,state:o,target:d,to:l,preventScrollReset:c,viewTransition:u,...m},p){let f,{basename:x}=i.useContext(rt),b="string"==typeof l&&ra.test(l),y=!1;if("string"==typeof l&&b&&(f=l,Qt))try{let e=new URL(window.location.href),t=l.startsWith("//")?new URL(e.protocol+l):new URL(l),a=F(t.pathname,x);t.origin===e.origin&&null!=a?l=a+t.search+t.hash:y=!0}catch(e){h(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let w=function(e,{relative:t}={}){k(it(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=i.useContext(rt),{hash:s,pathname:n,search:o}=kt(e,{relative:t}),d=n;return"/"!==a&&(d="/"===n?a:W([a,n])),r.createHref({pathname:d,search:o,hash:s})}(l,{relative:r}),[v,j,N]=function(e,t){let a=i.useContext(Vt),[r,s]=i.useState(!1),[n,o]=i.useState(!1),{onFocus:d,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:m}=t,k=i.useRef(null);i.useEffect((()=>{if("render"===e&&o(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{o(e.isIntersecting)}))}),{threshold:.5});return k.current&&e.observe(k.current),()=>{e.disconnect()}}}),[e]),i.useEffect((()=>{if(r){let e=setTimeout((()=>{o(!0)}),100);return()=>{clearTimeout(e)}}}),[r]);let h=()=>{s(!0)},p=()=>{s(!1),o(!1)};return a?"intent"!==e?[n,k,{}]:[n,k,{onFocus:Gt(d,h),onBlur:Gt(l,p),onMouseEnter:Gt(c,h),onMouseLeave:Gt(u,p),onTouchStart:Gt(m,h)}]:[!1,k,{}]}(a,m),_=function(e,{target:t,replace:a,state:r,preventScrollReset:s,relative:n,viewTransition:o}={}){let d=ut(),l=dt(),c=kt(e,{relative:n});return i.useCallback((i=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(i,t)){i.preventDefault();let t=void 0!==a?a:g(l)===g(c);d(e,{replace:t,state:r,preventScrollReset:s,relative:n,viewTransition:o})}}),[l,d,c,a,r,t,e,s,n,o])}(l,{replace:n,state:o,target:d,preventScrollReset:c,relative:r,viewTransition:u}),C=i.createElement("a",{...m,...N,href:f||w,onClick:y||s?e:function(t){e&&e(t),t.defaultPrevented||_(t)},ref:Zt(p,j),target:d,"data-discover":b||"render"!==t?void 0:"true"});return v&&!b?i.createElement(i.Fragment,null,C,i.createElement(Yt,{page:w})):C}));sa.displayName="Link";var na=i.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:a="",end:r=!1,style:s,to:n,viewTransition:o,children:d,...l},c){let u=kt(n,{relative:l.relative}),m=dt(),h=i.useContext(et),{navigator:p,basename:f}=i.useContext(rt),g=null!=h&&function(e,t={}){let a=i.useContext(tt);k(null!=a,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=oa("useViewTransitionState"),s=kt(e,{relative:t.relative});if(!a.isTransitioning)return!1;let n=F(a.currentLocation.pathname,r)||a.currentLocation.pathname,o=F(a.nextLocation.pathname,r)||a.nextLocation.pathname;return null!=A(s.pathname,o)||null!=A(s.pathname,n)}(u)&&!0===o,x=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,b=m.pathname,y=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;t||(b=b.toLowerCase(),y=y?y.toLowerCase():null,x=x.toLowerCase()),y&&f&&(y=F(y,f)||y);const w="/"!==x&&x.endsWith("/")?x.length-1:x.length;let v,j=b===x||!r&&b.startsWith(x)&&"/"===b.charAt(w),N=null!=y&&(y===x||!r&&y.startsWith(x)&&"/"===y.charAt(x.length)),_={isActive:j,isPending:N,isTransitioning:g},C=j?e:void 0;v="function"==typeof a?a(_):[a,j?"active":null,N?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let S="function"==typeof s?s(_):s;return i.createElement(sa,{...l,"aria-current":C,className:v,ref:c,style:S,to:n,viewTransition:o},"function"==typeof d?d(_):d)}));function oa(e){let t=i.useContext(Qe);return k(t,function(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}na.displayName="NavLink",i.forwardRef((({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:r,replace:s,state:n,method:o=Lt,action:d,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:m,...h},p)=>{let f=function(){let{router:e}=oa("useSubmit"),{basename:t}=i.useContext(rt),a=wt("useRouteId");return i.useCallback((async(r,s={})=>{let{action:n,method:o,encType:i,formData:d,body:l}=function(e,t){let a,r,s,n,o;if(zt(i=e)&&"form"===i.tagName.toLowerCase()){let o=e.getAttribute("action");r=o?F(o,t):null,a=e.getAttribute("method")||Lt,s=Ft(e.getAttribute("enctype"))||$t,n=new FormData(e)}else if(function(e){return zt(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return zt(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>');let i=e.getAttribute("formaction")||o.getAttribute("action");if(r=i?F(i,t):null,a=e.getAttribute("formmethod")||o.getAttribute("method")||Lt,s=Ft(e.getAttribute("formenctype"))||Ft(o.getAttribute("enctype"))||$t,n=new FormData(o,e),!function(){if(null===At)try{new FormData(document.createElement("form"),0),At=!1}catch(e){At=!0}return At}()){let{name:t,type:a,value:r}=e;if("image"===a){let e=t?`${t}.`:"";n.append(`${e}x`,"0"),n.append(`${e}y`,"0")}else t&&n.append(t,r)}}else{if(zt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Lt,r=null,s=$t,o=e}var i;return n&&"text/plain"===s&&(o=n,n=void 0),{action:r,method:a.toLowerCase(),encType:s,formData:n,body:o}}(r,t);if(!1===s.navigate){let t=s.fetcherKey||da();await e.fetch(t,a,s.action||n,{preventScrollReset:s.preventScrollReset,formData:d,body:l,formMethod:s.method||o,formEncType:s.encType||i,flushSync:s.flushSync})}else await e.navigate(s.action||n,{preventScrollReset:s.preventScrollReset,formData:d,body:l,formMethod:s.method||o,formEncType:s.encType||i,replace:s.replace,state:s.state,fromRouteId:a,flushSync:s.flushSync,viewTransition:s.viewTransition})}),[e,t,a])}(),x=function(e,{relative:t}={}){let{basename:a}=i.useContext(rt),r=i.useContext(nt);k(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),n={...kt(e||".",{relative:t})},o=dt();if(null==e){n.search=o.search;let e=new URLSearchParams(n.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();n.search=a?`?${a}`:""}}return e&&"."!==e||!s.route.index||(n.search=n.search?n.search.replace(/^\?/,"?index&"):"?index"),"/"!==a&&(n.pathname="/"===n.pathname?a:W([a,n.pathname])),g(n)}(d,{relative:c}),b="get"===o.toLowerCase()?"get":"post",y="string"==typeof d&&ra.test(d);return i.createElement("form",{ref:p,method:b,action:x,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute("formmethod")||o;f(r||e.currentTarget,{fetcherKey:t,method:i,navigate:a,replace:s,state:n,relative:c,preventScrollReset:u,viewTransition:m})},...h,"data-discover":y||"render"!==e?void 0:"true"})})).displayName="Form";var ia=0,da=()=>`__${String(++ia)}__`;const la=window.ReactDOM;function ca(e){return i.createElement(Dt,{flushSync:la.flushSync,...e})}const ua=window.wp.i18n,ma=e=>{const t=fa(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const a=e.split("-");return""===a[0]&&1!==a.length&&a.shift(),ka(a,t)||pa(e)},getConflictingClassGroupIds:(e,t)=>{const s=a[e]||[];return t&&r[e]?[...s,...r[e]]:s}}},ka=(e,t)=>{if(0===e.length)return t.classGroupId;const a=e[0],r=t.nextPart.get(a),s=r?ka(e.slice(1),r):void 0;if(s)return s;if(0===t.validators.length)return;const n=e.join("-");return t.validators.find((({validator:e})=>e(n)))?.classGroupId},ha=/^\[(.+)\]$/,pa=e=>{if(ha.test(e)){const t=ha.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},fa=e=>{const{theme:t,classGroups:a}=e,r={nextPart:new Map,validators:[]};for(const e in a)ga(a[e],r,e,t);return r},ga=(e,t,a,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return ba(e)?void ga(e(r),t,a,r):void t.validators.push({validator:e,classGroupId:a});Object.entries(e).forEach((([e,s])=>{ga(s,xa(t,e),a,r)}))}else(""===e?t:xa(t,e)).classGroupId=a}))},xa=(e,t)=>{let a=e;return t.split("-").forEach((e=>{a.nextPart.has(e)||a.nextPart.set(e,{nextPart:new Map,validators:[]}),a=a.nextPart.get(e)})),a},ba=e=>e.isThemeGetter,ya=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,r=new Map;const s=(s,n)=>{a.set(s,n),t++,t>e&&(t=0,r=a,a=new Map)};return{get(e){let t=a.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(s(e,t),t):void 0},set(e,t){a.has(e)?a.set(e,t):s(e,t)}}},wa=e=>{const{prefix:t,experimentalParseClassName:a}=e;let r=e=>{const t=[];let a,r=0,s=0,n=0;for(let o=0;o<e.length;o++){let i=e[o];if(0===r&&0===s){if(":"===i){t.push(e.slice(n,o)),n=o+1;continue}if("/"===i){a=o;continue}}"["===i?r++:"]"===i?r--:"("===i?s++:")"===i&&s--}const o=0===t.length?e:e.substring(n),i=va(o);return{modifiers:t,hasImportantModifier:i!==o,baseClassName:i,maybePostfixModifierPosition:a&&a>n?a-n:void 0}};if(t){const e=t+":",a=r;r=t=>t.startsWith(e)?a(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(a){const e=r;r=t=>a({className:t,parseClassName:e})}return r},va=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,ja=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map((e=>[e,!0])));return e=>{if(e.length<=1)return e;const a=[];let r=[];return e.forEach((e=>{"["===e[0]||t[e]?(a.push(...r.sort(),e),r=[]):r.push(e)})),a.push(...r.sort()),a}},Na=/\s+/;function _a(){let e,t,a=0,r="";for(;a<arguments.length;)(e=arguments[a++])&&(t=Ca(e))&&(r&&(r+=" "),r+=t);return r}const Ca=e=>{if("string"==typeof e)return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=Ca(e[r]))&&(a&&(a+=" "),a+=t);return a};function Sa(e,...t){let a,r,s,n=function(i){const d=t.reduce(((e,t)=>t(e)),e());return a=(e=>({cache:ya(e.cacheSize),parseClassName:wa(e),sortModifiers:ja(e),...ma(e)}))(d),r=a.cache.get,s=a.cache.set,n=o,o(i)};function o(e){const t=r(e);if(t)return t;const n=((e,t)=>{const{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:n}=t,o=[],i=e.trim().split(Na);let d="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{isExternal:l,modifiers:c,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:k}=a(t);if(l){d=t+(d.length>0?" "+d:d);continue}let h=!!k,p=r(h?m.substring(0,k):m);if(!p){if(!h){d=t+(d.length>0?" "+d:d);continue}if(p=r(m),!p){d=t+(d.length>0?" "+d:d);continue}h=!1}const f=n(c).join(":"),g=u?f+"!":f,x=g+p;if(o.includes(x))continue;o.push(x);const b=s(p,h);for(let e=0;e<b.length;++e){const t=b[e];o.push(g+t)}d=t+(d.length>0?" "+d:d)}return d})(e,a);return s(e,n),n}return function(){return n(_a.apply(null,arguments))}}const Ea=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Ra=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Da=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Pa=/^\d+\/\d+$/,Ta=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ma=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,La=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$a=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,za=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Aa=e=>Pa.test(e),Oa=e=>!!e&&!Number.isNaN(Number(e)),Fa=e=>!!e&&Number.isInteger(Number(e)),Ia=e=>e.endsWith("%")&&Oa(e.slice(0,-1)),Ba=e=>Ta.test(e),Ua=()=>!0,Ha=e=>Ma.test(e)&&!La.test(e),Wa=()=>!1,qa=e=>$a.test(e),Va=e=>za.test(e),Ka=e=>!Ya(e)&&!tr(e),Ga=e=>dr(e,mr,Wa),Ya=e=>Ra.test(e),Ja=e=>dr(e,kr,Ha),Xa=e=>dr(e,hr,Oa),Za=e=>dr(e,cr,Wa),Qa=e=>dr(e,ur,Va),er=e=>dr(e,fr,qa),tr=e=>Da.test(e),ar=e=>lr(e,kr),rr=e=>lr(e,pr),sr=e=>lr(e,cr),nr=e=>lr(e,mr),or=e=>lr(e,ur),ir=e=>lr(e,fr,!0),dr=(e,t,a)=>{const r=Ra.exec(e);return!!r&&(r[1]?t(r[1]):a(r[2]))},lr=(e,t,a=!1)=>{const r=Da.exec(e);return!!r&&(r[1]?t(r[1]):a)},cr=e=>"position"===e||"percentage"===e,ur=e=>"image"===e||"url"===e,mr=e=>"length"===e||"size"===e||"bg-size"===e,kr=e=>"length"===e,hr=e=>"number"===e,pr=e=>"family-name"===e,fr=e=>"shadow"===e,gr=Sa((Symbol.toStringTag,()=>{const e=Ea("color"),t=Ea("font"),a=Ea("text"),r=Ea("font-weight"),s=Ea("tracking"),n=Ea("leading"),o=Ea("breakpoint"),i=Ea("container"),d=Ea("spacing"),l=Ea("radius"),c=Ea("shadow"),u=Ea("inset-shadow"),m=Ea("text-shadow"),k=Ea("drop-shadow"),h=Ea("blur"),p=Ea("perspective"),f=Ea("aspect"),g=Ea("ease"),x=Ea("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",tr,Ya],y=()=>[tr,Ya,d],w=()=>[Aa,"full","auto",...y()],v=()=>[Fa,"none","subgrid",tr,Ya],j=()=>["auto",{span:["full",Fa,tr,Ya]},Fa,tr,Ya],N=()=>[Fa,"auto",tr,Ya],_=()=>["auto","min","max","fr",tr,Ya],C=()=>["auto",...y()],S=()=>[Aa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],E=()=>[e,tr,Ya],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",sr,Za,{position:[tr,Ya]}],D=()=>["auto","cover","contain",nr,Ga,{size:[tr,Ya]}],P=()=>[Ia,ar,Ja],T=()=>["","none","full",l,tr,Ya],M=()=>["",Oa,ar,Ja],L=()=>[Oa,Ia,sr,Za],$=()=>["","none",h,tr,Ya],z=()=>["none",Oa,tr,Ya],A=()=>["none",Oa,tr,Ya],O=()=>[Oa,tr,Ya],F=()=>[Aa,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ba],breakpoint:[Ba],color:[Ua],container:[Ba],"drop-shadow":[Ba],ease:["in","out","in-out"],font:[Ka],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ba],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ba],shadow:[Ba],spacing:["px",Oa],text:[Ba],"text-shadow":[Ba],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Aa,Ya,tr,f]}],container:["container"],columns:[{columns:[Oa,Ya,tr,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[Fa,"auto",tr,Ya]}],basis:[{basis:[Aa,"full","auto",i,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oa,Aa,"auto","initial","none",Ya]}],grow:[{grow:["",Oa,tr,Ya]}],shrink:[{shrink:["",Oa,tr,Ya]}],order:[{order:[Fa,"first","last","none",tr,Ya]}],"grid-cols":[{"grid-cols":v()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":v()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":_()}],"auto-rows":[{"auto-rows":_()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],w:[{w:[i,"screen",...S()]}],"min-w":[{"min-w":[i,"screen","none",...S()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[o]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",a,ar,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tr,Xa]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ia,Ya]}],"font-family":[{font:[rr,Ya,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,tr,Ya]}],"line-clamp":[{"line-clamp":[Oa,"none",tr,Xa]}],leading:[{leading:[n,...y()]}],"list-image":[{"list-image":["none",tr,Ya]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",tr,Ya]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Oa,"from-font","auto",tr,Ja]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Oa,"auto",tr,Ya]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tr,Ya]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tr,Ya]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fa,tr,Ya],radial:["",tr,Ya],conic:[Fa,tr,Ya]},or,Qa]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Oa,tr,Ya]}],"outline-w":[{outline:["",Oa,ar,Ja]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",c,ir,er]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",u,ir,er]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Oa,Ja]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",m,ir,er]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Oa,tr,Ya]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oa]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[tr,Ya]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Oa]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",tr,Ya]}],filter:[{filter:["","none",tr,Ya]}],blur:[{blur:$()}],brightness:[{brightness:[Oa,tr,Ya]}],contrast:[{contrast:[Oa,tr,Ya]}],"drop-shadow":[{"drop-shadow":["","none",k,ir,er]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Oa,tr,Ya]}],"hue-rotate":[{"hue-rotate":[Oa,tr,Ya]}],invert:[{invert:["",Oa,tr,Ya]}],saturate:[{saturate:[Oa,tr,Ya]}],sepia:[{sepia:["",Oa,tr,Ya]}],"backdrop-filter":[{"backdrop-filter":["","none",tr,Ya]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[Oa,tr,Ya]}],"backdrop-contrast":[{"backdrop-contrast":[Oa,tr,Ya]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oa,tr,Ya]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oa,tr,Ya]}],"backdrop-invert":[{"backdrop-invert":["",Oa,tr,Ya]}],"backdrop-opacity":[{"backdrop-opacity":[Oa,tr,Ya]}],"backdrop-saturate":[{"backdrop-saturate":[Oa,tr,Ya]}],"backdrop-sepia":[{"backdrop-sepia":["",Oa,tr,Ya]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",tr,Ya]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oa,"initial",tr,Ya]}],ease:[{ease:["linear","initial",g,tr,Ya]}],delay:[{delay:[Oa,tr,Ya]}],animate:[{animate:["none",x,tr,Ya]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,tr,Ya]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:A()}],"scale-x":[{"scale-x":A()}],"scale-y":[{"scale-y":A()}],"scale-z":[{"scale-z":A()}],"scale-3d":["scale-3d"],skew:[{skew:O()}],"skew-x":[{"skew-x":O()}],"skew-y":[{"skew-y":O()}],transform:[{transform:[tr,Ya,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tr,Ya]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tr,Ya]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Oa,ar,Ja,Xa]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})),xr=(...e)=>gr(e),br=window.ReactJSXRuntime,yr=({className:e})=>{const t=vt(),a=t?.status||null,s=t?.message||(0,ua.__)("An unexpected error occurred. Please try again or return to the dashboard.","dokan-kits");return(0,br.jsxs)("div",{className:xr("dokan-kits-error-boundary dk-min-h-[500px] dk-flex dk-flex-col dk-items-center dk-justify-center dk-p-wp-8 dk-text-center dk-bg-white dk-shadow-lg dk-rounded-lg dk-max-w-5xl dk-mx-auto dk-my-wp-8 dk-border dk-border-gray-100",e),children:[(0,br.jsx)("div",{className:"dk-flex dk-justify-center dk-items-center dk-mb-wp-6",children:(0,br.jsx)("div",{className:"dk-relative dk-flex dk-items-center dk-justify-center dk-h-32 dk-w-32 dk-rounded-full dk-bg-gradient-to-br dk-from-red-50 dk-via-red-100 dk-to-red-50 dk-border-4 dk-border-red-200 dk-shadow-md",children:(0,br.jsx)("span",{className:`dashicons dashicons-${(()=>{let e="warning";return 404===a?e="no-alt":403===a?e="lock":a>=500&&(e="dismiss"),e})()} dk-text-center dk-flex dk-items-center dk-justify-center dk-w-full dk-h-full dk-text-6xl dk-text-red-600 dk-animate-pulse`,style:{lineHeight:"1",fontSize:"3.75rem",top:"1px",position:"relative"},"aria-hidden":"true"})})}),(0,br.jsx)("h1",{className:"dk-text-3xl dk-font-bold dk-text-gray-900 dk-mb-wp-3",children:a?(0,ua.__)(`Error ${a}`,"dokan-kits"):(0,ua.__)("Oops! Something went wrong","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-lg dk-text-gray-600 dk-mb-wp-6 dk-max-w-2xl",children:404===a?(0,ua.__)("The page you were looking for does not exist or has been moved.","dokan-kits"):(0,ua.__)("We encountered an error while trying to process your request.","dokan-kits")}),(0,br.jsx)("div",{className:"dk-max-w-2xl dk-w-full dk-text-left dk-mb-wp-8",children:(0,br.jsx)("div",{className:"dk-p-wp-5 dk-bg-red-50 dk-rounded-lg dk-border dk-border-red-200 dk-shadow-sm",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-start",children:[(0,br.jsx)("span",{className:"dashicons dashicons-info dk-mr-wp-3 dk-text-xl dk-text-red-600 dk-mt-wp-1"}),(0,br.jsxs)("div",{children:[(0,br.jsx)("h2",{className:"dk-font-semibold dk-mb-wp-2 dk-text-red-800 dk-flex dk-items-center",children:(0,ua.__)("Error Details","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-red-700",children:s})]})]})})}),(0,br.jsx)("div",{className:"dk-max-w-2xl dk-w-full dk-text-left dk-mb-wp-8",children:(0,br.jsx)("div",{className:"dk-p-wp-5 dk-bg-blue-50 dk-rounded-lg dk-border dk-border-blue-200 dk-shadow-sm",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-start",children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-tools dk-mr-wp-3 dk-text-xl dk-text-blue-600 dk-mt-wp-1"}),(0,br.jsxs)("div",{children:[(0,br.jsx)("h2",{className:"dk-font-semibold dk-mb-wp-2 dk-text-blue-800 dk-flex dk-items-center",children:(0,ua.__)("Troubleshooting Steps","dokan-kits")}),(0,br.jsx)("ul",{className:"dk-list-disc dk-pl-wp-5 dk-space-y-wp-1 dk-text-blue-700",children:(()=>{const e=[(0,ua.__)("Refresh the page and try again.","dokan-kits"),(0,ua.__)("Clear your browser cache and cookies.","dokan-kits"),(0,ua.__)("Try accessing the page in a private/incognito window.","dokan-kits")];return 404===a?e.push((0,ua.__)("Check if the URL is correct.","dokan-kits")):403===a?e.push((0,ua.__)("Verify you have the necessary permissions.","dokan-kits")):a>=500&&e.push((0,ua.__)("Contact your server administrator to check server logs.","dokan-kits")),e})().map(((e,t)=>(0,br.jsx)("li",{children:e},t)))})]})]})})}),(0,br.jsxs)("div",{className:"dk-flex dk-flex-wrap dk-items-center dk-justify-center dk-gap-wp-4 dk-mb-wp-8",children:[(0,br.jsxs)(sa,{to:"/",className:"dk-admin-button dk-bg-primary-600 hover:dk-bg-primary-700 dk-text-white dk-flex dk-items-center dk-px-wp-6 dk-py-wp-3 dk-gap-wp-2 dk-rounded dk-transition dk-duration-200",children:[(0,br.jsx)("span",{className:"dashicons dashicons-dashboard"}),(0,ua.__)("Back to Dashboard","dokan-kits")]}),(0,br.jsxs)(r.Button,{variant:"secondary",onClick:()=>window.location.reload(),className:"dk-admin-button dk-admin-button-secondary dk-flex dk-items-center dk-gap-wp-2 dk-px-wp-6 dk-py-wp-3",children:[(0,br.jsx)("span",{className:"dashicons dashicons-image-rotate"}),(0,ua.__)("Reload Page","dokan-kits")]})]}),(0,br.jsx)("div",{className:"dk-mt-wp-4 dk-max-w-2xl dk-w-full",children:(0,br.jsx)("div",{className:"dk-p-wp-5 dk-bg-yellow-50 dk-rounded-lg dk-border dk-border-yellow-200 dk-shadow-sm",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-start",children:[(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-mr-wp-4",children:(0,br.jsx)("span",{className:"dashicons dashicons-sos dk-text-2xl dk-text-yellow-600"})}),(0,br.jsxs)("div",{className:"dk-text-left",children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-semibold dk-text-yellow-800 dk-mb-wp-2",children:(0,ua.__)("Need Help?","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-yellow-700 dk-mb-wp-3",children:(0,ua.__)("If this problem persists, please contact our support team with the error details shown above.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-flex dk-gap-wp-4",children:[(0,br.jsxs)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-warning dk-flex dk-items-center dk-gap-wp-2",children:[(0,br.jsx)("span",{className:"dashicons dashicons-editor-help"}),(0,ua.__)("Get Support","dokan-kits")]}),(0,br.jsxs)("a",{href:"https://wordpress.org/plugins/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-secondary dk-flex dk-items-center dk-gap-wp-2",children:[(0,br.jsx)("span",{className:"dashicons dashicons-book"}),(0,ua.__)("View Documentation","dokan-kits")]})]})]})]})})}),!1]})},wr=({message:e=(0,ua.__)("Loading…","dokan-kits"),className:t})=>(0,br.jsxs)("div",{className:xr("dk-flex dk-flex-col dk-items-center dk-justify-center dk-p-wp-8 dk-min-h-[300px]",t),children:[(0,br.jsx)("div",{className:"dk-inline-block dk-animate-spin dk-h-10 dk-w-10 dk-text-primary-600 dk-mb-wp-4",children:(0,br.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,br.jsx)("circle",{className:"dk-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,br.jsx)("path",{className:"dk-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),(0,br.jsx)("p",{className:"dk-text-gray-600 dk-text-center dk-animate-pulse",children:e})]});let vr={data:""},jr=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||vr,Nr=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,_r=/\/\*[^]*?\*\/|  +/g,Cr=/\n+/g,Sr=(e,t)=>{let a="",r="",s="";for(let n in e){let o=e[n];"@"==n[0]?"i"==n[1]?a=n+" "+o+";":r+="f"==n[1]?Sr(o,n):n+"{"+Sr(o,"k"==n[1]?"":t)+"}":"object"==typeof o?r+=Sr(o,t?t.replace(/([^,])+/g,(e=>n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):n):null!=o&&(n=/^--/.test(n)?n:n.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Sr.p?Sr.p(n,o):n+":"+o+";")}return a+(t&&s?t+"{"+s+"}":s)+r},Er={},Rr=e=>{if("object"==typeof e){let t="";for(let a in e)t+=a+Rr(e[a]);return t}return e},Dr=(e,t,a,r,s)=>{let n=Rr(e),o=Er[n]||(Er[n]=(e=>{let t=0,a=11;for(;t<e.length;)a=101*a+e.charCodeAt(t++)>>>0;return"go"+a})(n));if(!Er[o]){let t=n!==e?e:(e=>{let t,a,r=[{}];for(;t=Nr.exec(e.replace(_r,""));)t[4]?r.shift():t[3]?(a=t[3].replace(Cr," ").trim(),r.unshift(r[0][a]=r[0][a]||{})):r[0][t[1]]=t[2].replace(Cr," ").trim();return r[0]})(e);Er[o]=Sr(s?{["@keyframes "+o]:t}:t,a?"":"."+o)}let i=a&&Er.g?Er.g:null;return a&&(Er.g=Er[o]),((e,t,a,r)=>{r?t.data=t.data.replace(r,e):-1===t.data.indexOf(e)&&(t.data=a?e+t.data:t.data+e)})(Er[o],t,r,i),o};function Pr(e){let t=this||{},a=e.call?e(t.p):e;return Dr(a.unshift?a.raw?((e,t,a)=>e.reduce(((e,r,s)=>{let n=t[s];if(n&&n.call){let e=n(a),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;n=t?"."+t:e&&"object"==typeof e?e.props?"":Sr(e,""):!1===e?"":e}return e+r+(null==n?"":n)}),""))(a,[].slice.call(arguments,1),t.p):a.reduce(((e,a)=>Object.assign(e,a&&a.call?a(t.p):a)),{}):a,jr(t.target),t.g,t.o,t.k)}Pr.bind({g:1});let Tr,Mr,Lr,$r=Pr.bind({k:1});function zr(e,t){let a=this||{};return function(){let r=arguments;function s(n,o){let i=Object.assign({},n),d=i.className||s.className;a.p=Object.assign({theme:Mr&&Mr()},i),a.o=/ *go\d+/.test(d),i.className=Pr.apply(a,r)+(d?" "+d:""),t&&(i.ref=o);let l=e;return e[0]&&(l=i.as||e,delete i.as),Lr&&l[0]&&Lr(i),Tr(l,i)}return t?t(s):s}}var Ar=(e,t)=>(e=>"function"==typeof e)(e)?e(t):e,Or=(()=>{let e=0;return()=>(++e).toString()})(),Fr=(()=>{let e;return()=>{if(void 0===e&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Ir=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,20)};case 1:return{...e,toasts:e.toasts.map((e=>e.id===t.toast.id?{...e,...t.toast}:e))};case 2:let{toast:a}=t;return Ir(e,{type:e.toasts.find((e=>e.id===a.id))?1:0,toast:a});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map((e=>e.id===r||void 0===r?{...e,dismissed:!0,visible:!1}:e))};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter((e=>e.id!==t.toastId))};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map((e=>({...e,pauseDuration:e.pauseDuration+s})))}}},Br=[],Ur={toasts:[],pausedAt:void 0},Hr=e=>{Ur=Ir(Ur,e),Br.forEach((e=>{e(Ur)}))},Wr={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},qr=e=>(t,a)=>{let r=((e,t="blank",a)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...a,id:(null==a?void 0:a.id)||Or()}))(t,e,a);return Hr({type:2,toast:r}),r.id},Vr=(e,t)=>qr("blank")(e,t);Vr.error=qr("error"),Vr.success=qr("success"),Vr.loading=qr("loading"),Vr.custom=qr("custom"),Vr.dismiss=e=>{Hr({type:3,toastId:e})},Vr.remove=e=>Hr({type:4,toastId:e}),Vr.promise=(e,t,a)=>{let r=Vr.loading(t.loading,{...a,...null==a?void 0:a.loading});return"function"==typeof e&&(e=e()),e.then((e=>{let s=t.success?Ar(t.success,e):void 0;return s?Vr.success(s,{id:r,...a,...null==a?void 0:a.success}):Vr.dismiss(r),e})).catch((e=>{let s=t.error?Ar(t.error,e):void 0;s?Vr.error(s,{id:r,...a,...null==a?void 0:a.error}):Vr.dismiss(r)})),e};var Kr=(e,t)=>{Hr({type:1,toast:{id:e,height:t}})},Gr=()=>{Hr({type:5,time:Date.now()})},Yr=new Map,Jr=$r`
     1(()=>{"use strict";var e={69:(e,t)=>{Object.prototype.toString}},t={};function a(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var s=r.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=r[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e+"../"})();const r=window.wp.components,s=window.wp.domReady;var n=a.n(s);const o=window.wp.element,i=window.React;a(69);var d,l=e=>{throw TypeError(e)},c=(e,t,a)=>(((e,t)=>{t.has(e)||l("Cannot read from private field")})(e,t),a?a.call(e):t.get(e)),u="popstate";function m(e={}){return function(e,t,a,r={}){let{window:s=document.defaultView,v5Compat:n=!1}=r,o=s.history,i="POP",d=null,l=c();function c(){return(o.state||{idx:null}).idx}function m(){i="POP";let e=c(),t=null==e?null:e-l;l=e,d&&d({action:i,location:h.location,delta:t})}function k(e){return b(e)}null==l&&(l=0,o.replaceState({...o.state,idx:l},""));let h={get action(){return i},get location(){return e(s,o)},listen(e){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(u,m),d=e,()=>{s.removeEventListener(u,m),d=null}},createHref:e=>t(s,e),createURL:k,encodeLocation(e){let t=k(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){i="PUSH";let r=f(h.location,e,t);a&&a(r,e),l=c()+1;let u=p(r,l),m=h.createHref(r);try{o.pushState(u,"",m)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;s.location.assign(m)}n&&d&&d({action:i,location:h.location,delta:1})},replace:function(e,t){i="REPLACE";let r=f(h.location,e,t);a&&a(r,e),l=c();let s=p(r,l),u=h.createHref(r);o.replaceState(s,"",u),n&&d&&d({action:i,location:h.location,delta:0})},go:e=>o.go(e)};return h}((function(e,t){let{pathname:a="/",search:r="",hash:s=""}=g(e.location.hash.substring(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),f("",{pathname:a,search:r,hash:s},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let a=e.document.querySelector("base"),r="";if(a&&a.getAttribute("href")){let t=e.location.href,a=t.indexOf("#");r=-1===a?t:t.slice(0,a)}return r+"#"+("string"==typeof t?t:x(t))}),(function(e,t){h("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}),e)}function k(e,t){if(!1===e||null==e)throw new Error(t)}function h(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function p(e,t){return{usr:e.state,key:e.key,idx:t}}function f(e,t,a=null,r){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?g(t):t,state:a,key:t&&t.key||r||Math.random().toString(36).substring(2,10)}}function x({pathname:e="/",search:t="",hash:a=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),a&&"#"!==a&&(e+="#"===a.charAt(0)?a:"#"+a),e}function g(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function b(e,t=!1){let a="http://localhost";"undefined"!=typeof window&&(a="null"!==window.location.origin?window.location.origin:window.location.href),k(a,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:x(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=a+r),new URL(r,a)}var y=class{constructor(e){var t,a,r;if(t=this,a=d,r=new Map,a.has(t)?l("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,r),e)for(let[t,a]of e)this.set(t,a)}get(e){if(c(this,d).has(e))return c(this,d).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw new Error("No value found for context")}set(e,t){c(this,d).set(e,t)}};d=new WeakMap;var w=new Set(["lazy","caseSensitive","path","id","index","children"]),v=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function j(e,t,a=[],r={}){return e.map(((e,s)=>{let n=[...a,String(s)],o="string"==typeof e.id?e.id:n.join("-");if(k(!0!==e.index||!e.children,"Cannot specify children on an index route"),k(!r[o],`Found a route id collision on id "${o}".  Route id's must be globally unique within Data Router usages`),function(e){return!0===e.index}(e)){let a={...e,...t(e),id:o};return r[o]=a,a}{let a={...e,...t(e),id:o,children:void 0};return r[o]=a,e.children&&(a.children=j(e.children,t,n,r)),a}}))}function N(e,t,a="/"){return _(e,t,a,!1)}function _(e,t,a,r){let s=F(("string"==typeof t?g(t):t).pathname||"/",a);if(null==s)return null;let n=C(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let a=e.length===t.length&&e.slice(0,-1).every(((e,a)=>e===t[a]));return a?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(n);let o=null;for(let e=0;null==o&&e<n.length;++e){let t=O(s);o=z(n[e],t,r)}return o}function C(e,t=[],a=[],r=""){let s=(e,s,n)=>{let o={relativePath:void 0===n?e.path||"":n,caseSensitive:!0===e.caseSensitive,childrenIndex:s,route:e};o.relativePath.startsWith("/")&&(k(o.relativePath.startsWith(r),`Absolute route path "${o.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let i=W([r,o.relativePath]),d=a.concat(o);e.children&&e.children.length>0&&(k(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${i}".`),C(e.children,t,d,i)),(null!=e.path||e.index)&&t.push({path:i,score:$(i,e.index),routesMeta:d})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let a of S(e.path))s(e,t,a);else s(e,t)})),t}function S(e){let t=e.split("/");if(0===t.length)return[];let[a,...r]=t,s=a.endsWith("?"),n=a.replace(/\?$/,"");if(0===r.length)return s?[n,""]:[n];let o=S(r.join("/")),i=[];return i.push(...o.map((e=>""===e?n:[n,e].join("/")))),s&&i.push(...o),i.map((t=>e.startsWith("/")&&""===t?"/":t))}var E=/^:[\w-]+$/,R=3,D=2,P=1,T=10,M=-2,L=e=>"*"===e;function $(e,t){let a=e.split("/"),r=a.length;return a.some(L)&&(r+=M),t&&(r+=D),a.filter((e=>!L(e))).reduce(((e,t)=>e+(E.test(t)?R:""===t?P:T)),r)}function z(e,t,a=!1){let{routesMeta:r}=e,s={},n="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],d=e===r.length-1,l="/"===n?t:t.slice(n.length)||"/",c=A({path:i.relativePath,caseSensitive:i.caseSensitive,end:d},l),u=i.route;if(!c&&d&&a&&!r[r.length-1].route.index&&(c=A({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},l)),!c)return null;Object.assign(s,c.params),o.push({params:s,pathname:W([n,c.pathname]),pathnameBase:V(W([n,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(n=W([n,c.pathnameBase]))}return o}function A(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=function(e,t=!1,a=!0){h("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,a)=>(r.push({paramName:t,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(r.push({paramName:"*"}),s+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?s+="\\/*$":""!==e&&"/"!==e&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),s=t.match(a);if(!s)return null;let n=s[0],o=n.replace(/(.)\/+$/,"$1"),i=s.slice(1);return{params:r.reduce(((e,{paramName:t,isOptional:a},r)=>{if("*"===t){let e=i[r]||"";o=n.slice(0,n.length-e.length).replace(/(.)\/+$/,"$1")}const s=i[r];return e[t]=a&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{}),pathname:n,pathnameBase:o,pattern:e}}function O(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return h(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function F(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&"/"!==r?null:e.slice(a)||"/"}function I(e,t,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function B(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function U(e){let t=B(e);return t.map(((e,a)=>a===t.length-1?e.pathname:e.pathnameBase))}function H(e,t,a,r=!1){let s;"string"==typeof e?s=g(e):(s={...e},k(!s.pathname||!s.pathname.includes("?"),I("?","pathname","search",s)),k(!s.pathname||!s.pathname.includes("#"),I("#","pathname","hash",s)),k(!s.search||!s.search.includes("#"),I("#","search","hash",s)));let n,o=""===e||""===s.pathname,i=o?"/":s.pathname;if(null==i)n=a;else{let e=t.length-1;if(!r&&i.startsWith("..")){let t=i.split("/");for(;".."===t[0];)t.shift(),e-=1;s.pathname=t.join("/")}n=e>=0?t[e]:"/"}let d=function(e,t="/"){let{pathname:a,search:r="",hash:s=""}="string"==typeof e?g(e):e,n=a?a.startsWith("/")?a:function(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?a.length>1&&a.pop():"."!==e&&a.push(e)})),a.length>1?a.join("/"):"/"}(a,t):t;return{pathname:n,search:q(r),hash:K(s)}}(s,n),l=i&&"/"!==i&&i.endsWith("/"),c=(o||"."===i)&&a.endsWith("/");return d.pathname.endsWith("/")||!l&&!c||(d.pathname+="/"),d}var W=e=>e.join("/").replace(/\/\/+/g,"/"),V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),q=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",K=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",G=class{constructor(e,t,a,r=!1){this.status=e,this.statusText=t||"",this.internal=r,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Y(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var J=["POST","PUT","PATCH","DELETE"],X=new Set(J),Z=["GET",...J],Q=new Set(Z),ee=new Set([301,302,303,307,308]),te=new Set([307,308]),ae={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},re={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},se={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ne=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oe=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),ie="remix-router-transitions",de=Symbol("ResetLoaderData");function le(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,a=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement;k(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r,s,n,o=e.hydrationRouteProperties||[],i=e.mapRouteProperties||oe,d={},l=j(e.routes,i,void 0,d),c=e.basename||"/",u=e.dataStrategy||we,m={unstable_middleware:!1,...e.future},p=null,x=new Set,g=null,w=null,v=null,C=null!=e.hydrationData,S=N(l,e.history.location,c),E=!1,R=null;if(null!=S||e.patchRoutesOnNavigation)if(S&&!e.hydrationData&&at(S,l,e.history.location.pathname).active&&(S=null),S)if(S.some((e=>e.route.lazy)))s=!1;else if(S.some((e=>e.route.loader))){let t=e.hydrationData?e.hydrationData.loaderData:null,a=e.hydrationData?e.hydrationData.errors:null;if(a){let e=S.findIndex((e=>void 0!==a[e.route.id]));s=S.slice(0,e+1).every((e=>!ke(e.route,t,a)))}else s=S.every((e=>!ke(e.route,t,a)))}else s=!0;else{s=!1,S=[];let t=at(null,l,e.history.location.pathname);t.active&&t.matches&&(E=!0,S=t.matches)}else{let t=Oe(404,{pathname:e.history.location.pathname}),{matches:a,route:r}=Ae(l);s=!0,S=a,R={[r.id]:t}}let D,P,T={historyAction:e.history.action,location:e.history.location,matches:S,initialized:s,navigation:ae,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||R,fetchers:new Map,blockers:new Map},M="POP",L=!1,$=!1,z=new Map,A=null,O=!1,I=!1,B=new Set,U=new Map,H=0,W=-1,V=new Map,q=new Set,K=new Map,G=new Map,J=new Set,X=new Map,Z=null;function Q(e,t={}){T={...T,...e};let a=[],r=[];T.fetchers.forEach(((e,t)=>{"idle"===e.state&&(J.has(t)?a.push(t):r.push(t))})),J.forEach((e=>{T.fetchers.has(e)||U.has(e)||a.push(e)})),[...x].forEach((e=>e(T,{deletedFetchers:a,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync}))),a.forEach((e=>Ne(e))),r.forEach((e=>T.fetchers.delete(e)))}function ee(t,a,{flushSync:s}={}){let n,o=null!=T.actionData&&null!=T.navigation.formMethod&&qe(T.navigation.formMethod)&&"loading"===T.navigation.state&&!0!==t.state?._isRedirect;n=a.actionData?Object.keys(a.actionData).length>0?a.actionData:null:o?T.actionData:null;let i=a.loaderData?Le(T.loaderData,a.loaderData,a.matches||[],a.errors):T.loaderData,d=T.blockers;d.size>0&&(d=new Map(d),d.forEach(((e,t)=>d.set(t,se))));let c,u=!0===L||null!=T.navigation.formMethod&&qe(T.navigation.formMethod)&&!0!==t.state?._isRedirect;if(r&&(l=r,r=void 0),O||"POP"===M||("PUSH"===M?e.history.push(t,t.state):"REPLACE"===M&&e.history.replace(t,t.state)),"POP"===M){let e=z.get(T.location.pathname);e&&e.has(t.pathname)?c={currentLocation:T.location,nextLocation:t}:z.has(t.pathname)&&(c={currentLocation:t,nextLocation:T.location})}else if($){let e=z.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),z.set(T.location.pathname,e)),c={currentLocation:T.location,nextLocation:t}}Q({...a,actionData:n,loaderData:i,historyAction:M,location:t,initialized:!0,navigation:ae,revalidation:"idle",restoreScrollPosition:tt(t,a.matches||T.matches),preventScrollReset:u,blockers:d},{viewTransitionOpts:c,flushSync:!0===s}),M="POP",L=!1,$=!1,O=!1,I=!1,Z?.resolve(),Z=null}async function de(t,a,s){D&&D.abort(),D=null,M=t,O=!0===(s&&s.startUninterruptedRevalidation),function(e,t){if(g&&v){let a=et(e,t);g[a]=v()}}(T.location,T.matches),L=!0===(s&&s.preventScrollReset),$=!0===(s&&s.enableViewTransition);let n=r||l,u=s&&s.overrideNavigation,m=s?.initialHydration&&T.matches&&T.matches.length>0&&!E?T.matches:N(n,a,c),k=!0===(s&&s.flushSync);if(m&&T.initialized&&!I&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&(""===e.hash?""!==t.hash:e.hash===t.hash||""!==t.hash)}(T.location,a)&&!(s&&s.submission&&qe(s.submission.formMethod)))return void ee(a,{matches:m},{flushSync:k});let h=at(m,n,a.pathname);if(h.active&&h.matches&&(m=h.matches),!m){let{error:e,notFoundMatches:t,route:r}=Qe(a.pathname);return void ee(a,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:k})}D=new AbortController;let p,f=De(e.history,a,D.signal,s&&s.submission),x=new y(e.unstable_getContext?await e.unstable_getContext():void 0);if(s&&s.pendingError)p=[ze(m).route.id,{type:"error",error:s.pendingError}];else if(s&&s.submission&&qe(s.submission.formMethod)){let t=await async function(e,t,a,r,s,n,l,u={}){ge();let m,k=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(t,a);if(Q({navigation:k},{flushSync:!0===u.flushSync}),n){let a=await rt(r,t.pathname,e.signal);if("aborted"===a.type)return{shortCircuited:!0};if("error"===a.type){let e=ze(a.partialMatches).route.id;return{matches:a.partialMatches,pendingActionResult:[e,{type:"error",error:a.error}]}}if(!a.matches){let{notFoundMatches:e,error:a,route:r}=Qe(t.pathname);return{matches:e,pendingActionResult:[r.id,{type:"error",error:a}]}}r=a.matches}let h=Ge(r,t);if(h.route.action||h.route.lazy){let t=Ce(i,d,e,r,h,l?[]:o,s),a=await fe(e,t,s,null);if(m=a[h.route.id],!m)for(let e of r)if(a[e.route.id]){m=a[e.route.id];break}if(e.signal.aborted)return{shortCircuited:!0}}else m={type:"error",error:Oe(405,{method:e.method,pathname:t.pathname,routeId:h.route.id})};if(He(m)){let t;return t=u&&null!=u.replace?u.replace:Re(m.response.headers.get("Location"),new URL(e.url),c)===T.location.pathname+T.location.search,await he(e,m,!0,{submission:a,replace:t}),{shortCircuited:!0}}if(Ue(m)){let e=ze(r,h.route.id);return!0!==(u&&u.replace)&&(M="PUSH"),{matches:r,pendingActionResult:[e.route.id,m,h.route.id]}}return{matches:r,pendingActionResult:[h.route.id,m]}}(f,a,s.submission,m,x,h.active,s&&!0===s.initialHydration,{replace:s.replace,flushSync:k});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Ue(r)&&Y(r.error)&&404===r.error.status)return D=null,void ee(a,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}m=t.matches||m,p=t.pendingActionResult,u=Je(a,s.submission),k=!1,h.active=!1,f=De(e.history,f.url,f.signal)}let{shortCircuited:b,matches:w,loaderData:j,errors:_}=await async function(t,a,s,n,u,m,k,h,p,f,x,g){let b=m||Je(a,k),y=k||h||Ye(b),w=!O&&!f;if(u){if(w){let e=le(g);Q({navigation:b,...void 0!==e?{actionData:e}:{}},{flushSync:x})}let e=await rt(s,a.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=ze(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=Qe(a.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}s=e.matches}let v=r||l,{dsMatches:j,revalidatingFetchers:N}=me(t,n,i,d,e.history,T,s,y,a,f?[]:o,!0===f,I,B,J,K,q,v,c,null!=e.patchRoutesOnNavigation,g);if(W=++H,!e.dataStrategy&&!j.some((e=>e.shouldLoad))&&0===N.length){let e=Te();return ee(a,{matches:s,loaderData:{},errors:g&&Ue(g[1])?{[g[0]]:g[1].error}:null,...$e(g),...e?{fetchers:new Map(T.fetchers)}:{}},{flushSync:x}),{shortCircuited:!0}}if(w){let e={};if(!u){e.navigation=b;let t=le(g);void 0!==t&&(e.actionData=t)}N.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=T.fetchers.get(e.key),a=Xe(void 0,t?t.data:void 0);T.fetchers.set(e.key,a)})),new Map(T.fetchers)}(N)),Q(e,{flushSync:x})}N.forEach((e=>{_e(e.key),e.controller&&U.set(e.key,e.controller)}));let _=()=>N.forEach((e=>_e(e.key)));D&&D.signal.addEventListener("abort",_);let{loaderResults:C,fetcherResults:S}=await xe(j,N,t,n);if(t.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",_),N.forEach((e=>U.delete(e.key)));let E=Fe(C);if(E)return await he(t,E.result,!0,{replace:p}),{shortCircuited:!0};if(E=Fe(S),E)return q.add(E.key),await he(t,E.result,!0,{replace:p}),{shortCircuited:!0};let{loaderData:R,errors:P}=Me(T,s,C,g,N,S);f&&T.errors&&(P={...T.errors,...P});let M=Te(),L=Ie(W);return{matches:s,loaderData:R,errors:P,...M||L||N.length>0?{fetchers:new Map(T.fetchers)}:{}}}(f,a,m,x,h.active,u,s&&s.submission,s&&s.fetcherSubmission,s&&s.replace,s&&!0===s.initialHydration,k,p);b||(D=null,ee(a,{matches:w||m,...$e(p),loaderData:j,errors:_}))}function le(e){return e&&!Ue(e[1])?{[e[0]]:e[1].data}:T.actionData?0===Object.keys(T.actionData).length?null:T.actionData:void 0}async function he(e,r,s,{submission:n,fetcherSubmission:o,preventScrollReset:i,replace:d}={}){r.response.headers.has("X-Remix-Revalidate")&&(I=!0);let l=r.response.headers.get("Location");k(l,"Expected a Location header on the redirect Response"),l=Re(l,new URL(e.url),c);let u=f(T.location,l,{_isRedirect:!0});if(a){let e=!1;if(r.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(ne.test(l)){const a=b(l,!0);e=a.origin!==t.location.origin||null==F(a.pathname,c)}if(e)return void(d?t.location.replace(l):t.location.assign(l))}D=null;let m=!0===d||r.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:h,formAction:p,formEncType:x}=T.navigation;!n&&!o&&h&&p&&x&&(n=Ye(T.navigation));let g=n||o;if(te.has(r.response.status)&&g&&qe(g.formMethod))await de(m,u,{submission:{...g,formAction:l},preventScrollReset:i||L,enableViewTransition:s?$:void 0});else{let e=Je(u,n);await de(m,u,{overrideNavigation:e,fetcherSubmission:o,preventScrollReset:i||L,enableViewTransition:s?$:void 0})}}async function fe(e,t,a,r){let s,n={};try{s=await async function(e,t,a,r,s,n){a.some((e=>e._lazyPromises?.middleware))&&await Promise.all(a.map((e=>e._lazyPromises?.middleware)));let o={request:t,params:a[0].params,context:s,matches:a},i=n?()=>{throw new Error("You cannot call `unstable_runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response.  You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=o;return ve(t,!1,(()=>e({...t,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}})),((e,t)=>({[t]:{type:"error",result:e}})))},d=await e({...o,fetcherKey:r,unstable_runClientMiddleware:i});try{await Promise.all(a.flatMap((e=>[e._lazyPromises?.handler,e._lazyPromises?.route])))}catch(e){}return d}(u,e,t,r,a,!1)}catch(e){return t.filter((e=>e.shouldLoad)).forEach((t=>{n[t.route.id]={type:"error",error:e}})),n}if(e.signal.aborted)return n;for(let[a,r]of Object.entries(s))if(Be(r)){let s=r.result;n[a]={type:"redirect",response:Ee(s,e,a,t,c)}}else n[a]=await Se(r);return n}async function xe(e,t,a,r){let s=fe(a,e,r,null),n=Promise.all(t.map((async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await fe(e.request,e.matches,r,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:Oe(404,{pathname:e.path})}})})));return{loaderResults:await s,fetcherResults:(await n).reduce(((e,t)=>Object.assign(e,t)),{})}}function ge(){I=!0,K.forEach(((e,t)=>{U.has(t)&&B.add(t),_e(t)}))}function be(e,t,a={}){T.fetchers.set(e,t),Q({fetchers:new Map(T.fetchers)},{flushSync:!0===(a&&a.flushSync)})}function ye(e,t,a,r={}){let s=ze(T.matches,t);Ne(e),Q({errors:{[s.route.id]:a},fetchers:new Map(T.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function je(e){return G.set(e,(G.get(e)||0)+1),J.has(e)&&J.delete(e),T.fetchers.get(e)||re}function Ne(e){let t=T.fetchers.get(e);!U.has(e)||t&&"loading"===t.state&&V.has(e)||_e(e),K.delete(e),V.delete(e),q.delete(e),J.delete(e),B.delete(e),T.fetchers.delete(e)}function _e(e){let t=U.get(e);t&&(t.abort(),U.delete(e))}function Pe(e){for(let t of e){let e=Ze(je(t).data);T.fetchers.set(t,e)}}function Te(){let e=[],t=!1;for(let a of q){let r=T.fetchers.get(a);k(r,`Expected fetcher: ${a}`),"loading"===r.state&&(q.delete(a),e.push(a),t=!0)}return Pe(e),t}function Ie(e){let t=[];for(let[a,r]of V)if(r<e){let e=T.fetchers.get(a);k(e,`Expected fetcher: ${a}`),"loading"===e.state&&(_e(a),V.delete(a),t.push(a))}return Pe(t),t.length>0}function We(e){T.blockers.delete(e),X.delete(e)}function Ve(e,t){let a=T.blockers.get(e)||se;k("unblocked"===a.state&&"blocked"===t.state||"blocked"===a.state&&"blocked"===t.state||"blocked"===a.state&&"proceeding"===t.state||"blocked"===a.state&&"unblocked"===t.state||"proceeding"===a.state&&"unblocked"===t.state,`Invalid blocker state transition: ${a.state} -> ${t.state}`);let r=new Map(T.blockers);r.set(e,t),Q({blockers:r})}function Ke({currentLocation:e,nextLocation:t,historyAction:a}){if(0===X.size)return;X.size>1&&h(!1,"A router only supports one blocker at a time");let r=Array.from(X.entries()),[s,n]=r[r.length-1],o=T.blockers.get(s);return o&&"proceeding"===o.state?void 0:n({currentLocation:e,nextLocation:t,historyAction:a})?s:void 0}function Qe(e){let t=Oe(404,{pathname:e}),a=r||l,{matches:s,route:n}=Ae(a);return{notFoundMatches:s,route:n,error:t}}function et(e,t){if(w){return w(e,t.map((e=>function(e,t){let{route:a,pathname:r,params:s}=e;return{id:a.id,pathname:r,params:s,data:t[a.id],handle:a.handle}}(e,T.loaderData))))||e.key}return e.key}function tt(e,t){if(g){let a=et(e,t),r=g[a];if("number"==typeof r)return r}return null}function at(t,a,r){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:_(a,r,c,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:_(a,r,c,!0)}}return{active:!1,matches:null}}async function rt(t,a,s,n){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let o=t;for(;;){let t=null==r,u=r||l,m=d;try{await e.patchRoutesOnNavigation({signal:s,path:a,matches:o,fetcherKey:n,patch:(e,t)=>{s.aborted||pe(e,t,u,m,i)}})}catch(e){return{type:"error",error:e,partialMatches:o}}finally{t&&!s.aborted&&(l=[...l])}if(s.aborted)return{type:"aborted"};let k=N(u,a,c);if(k)return{type:"success",matches:k};let h=_(u,a,c,!0);if(!h||o.length===h.length&&o.every(((e,t)=>e.route.id===h[t].route.id)))return{type:"success",matches:null};o=h}}return n={get basename(){return c},get future(){return m},get state(){return T},get routes(){return l},get window(){return t},initialize:function(){if(p=e.history.listen((({action:t,location:a,delta:r})=>{if(P)return P(),void(P=void 0);h(0===X.size||null!=r,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let s=Ke({currentLocation:T.location,nextLocation:a,historyAction:t});if(s&&null!=r){let t=new Promise((e=>{P=e}));return e.history.go(-1*r),void Ve(s,{state:"blocked",location:a,proceed(){Ve(s,{state:"proceeding",proceed:void 0,reset:void 0,location:a}),t.then((()=>e.history.go(r)))},reset(){let e=new Map(T.blockers);e.set(s,se),Q({blockers:e})}})}return de(t,a)})),a){!function(e,t){try{let a=e.sessionStorage.getItem(ie);if(a){let e=JSON.parse(a);for(let[a,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(a,new Set(r||[]))}}catch(e){}}(t,z);let e=()=>function(e,t){if(t.size>0){let a={};for(let[e,r]of t)a[e]=[...r];try{e.sessionStorage.setItem(ie,JSON.stringify(a))}catch(e){h(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}(t,z);t.addEventListener("pagehide",e),A=()=>t.removeEventListener("pagehide",e)}return T.initialized||de("POP",T.location,{initialHydration:!0}),n},subscribe:function(e){return x.add(e),()=>x.delete(e)},enableScrollRestoration:function(e,t,a){if(g=e,v=t,w=a||null,!C&&T.navigation===ae){C=!0;let e=tt(T.location,T.matches);null!=e&&Q({restoreScrollPosition:e})}return()=>{g=null,v=null,w=null}},navigate:async function t(a,r){if("number"==typeof a)return void e.history.go(a);let s=ce(T.location,T.matches,c,a,r?.fromRouteId,r?.relative),{path:n,submission:o,error:i}=ue(!1,s,r),d=T.location,l=f(T.location,n,r&&r.state);l={...l,...e.history.encodeLocation(l)};let u=r&&null!=r.replace?r.replace:void 0,m="PUSH";!0===u?m="REPLACE":!1===u||null!=o&&qe(o.formMethod)&&o.formAction===T.location.pathname+T.location.search&&(m="REPLACE");let k=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,h=!0===(r&&r.flushSync),p=Ke({currentLocation:d,nextLocation:l,historyAction:m});p?Ve(p,{state:"blocked",location:l,proceed(){Ve(p,{state:"proceeding",proceed:void 0,reset:void 0,location:l}),t(a,r)},reset(){let e=new Map(T.blockers);e.set(p,se),Q({blockers:e})}}):await de(m,l,{submission:o,pendingError:i,preventScrollReset:k,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:h})},fetch:async function(t,a,s,n){_e(t);let u=!0===(n&&n.flushSync),m=r||l,h=ce(T.location,T.matches,c,s,a,n?.relative),p=N(m,h,c),f=at(p,m,h);if(f.active&&f.matches&&(p=f.matches),!p)return void ye(t,a,Oe(404,{pathname:h}),{flushSync:u});let{path:x,submission:g,error:b}=ue(!0,h,n);if(b)return void ye(t,a,b,{flushSync:u});let w=Ge(p,x),v=new y(e.unstable_getContext?await e.unstable_getContext():void 0),j=!0===(n&&n.preventScrollReset);g&&qe(g.formMethod)?await async function(t,a,s,n,u,m,h,p,f,x){function g(e){if(!e.route.action&&!e.route.lazy){let e=Oe(405,{method:x.formMethod,pathname:s,routeId:a});return ye(t,a,e,{flushSync:p}),!0}return!1}if(ge(),K.delete(t),!h&&g(n))return;let b=T.fetchers.get(t);be(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(x,b),{flushSync:p});let y=new AbortController,w=De(e.history,s,y.signal,x);if(h){let e=await rt(u,s,w.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ye(t,a,e.error,{flushSync:p});if(!e.matches)return void ye(t,a,Oe(404,{pathname:s}),{flushSync:p});if(g(n=Ge(u=e.matches,s)))return}U.set(t,y);let v=H,j=Ce(i,d,w,u,n,o,m),_=(await fe(w,j,m,t))[n.route.id];if(w.signal.aborted)return void(U.get(t)===y&&U.delete(t));if(J.has(t)){if(He(_)||Ue(_))return void be(t,Ze(void 0))}else{if(He(_))return U.delete(t),W>v?void be(t,Ze(void 0)):(q.add(t),be(t,Xe(x)),he(w,_,!1,{fetcherSubmission:x,preventScrollReset:f}));if(Ue(_))return void ye(t,a,_.error)}let C=T.navigation.location||T.location,S=De(e.history,C,y.signal),E=r||l,R="idle"!==T.navigation.state?N(E,T.navigation.location,c):T.matches;k(R,"Didn't find any matches after fetcher action");let P=++H;V.set(t,P);let L=Xe(x,_.data);T.fetchers.set(t,L);let{dsMatches:$,revalidatingFetchers:z}=me(S,m,i,d,e.history,T,R,x,C,o,!1,I,B,J,K,q,E,c,null!=e.patchRoutesOnNavigation,[n.route.id,_]);z.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,a=T.fetchers.get(t),r=Xe(void 0,a?a.data:void 0);T.fetchers.set(t,r),_e(t),e.controller&&U.set(t,e.controller)})),Q({fetchers:new Map(T.fetchers)});let A=()=>z.forEach((e=>_e(e.key)));y.signal.addEventListener("abort",A);let{loaderResults:O,fetcherResults:F}=await xe($,z,S,m);if(y.signal.aborted)return;if(y.signal.removeEventListener("abort",A),V.delete(t),U.delete(t),z.forEach((e=>U.delete(e.key))),T.fetchers.has(t)){let e=Ze(_.data);T.fetchers.set(t,e)}let G=Fe(O);if(G)return he(S,G.result,!1,{preventScrollReset:f});if(G=Fe(F),G)return q.add(G.key),he(S,G.result,!1,{preventScrollReset:f});let{loaderData:Y,errors:X}=Me(T,R,O,void 0,z,F);Ie(P),"loading"===T.navigation.state&&P>W?(k(M,"Expected pending action"),D&&D.abort(),ee(T.navigation.location,{matches:R,loaderData:Y,errors:X,fetchers:new Map(T.fetchers)})):(Q({errors:X,loaderData:Le(T.loaderData,Y,R,X),fetchers:new Map(T.fetchers)}),I=!1)}(t,a,x,w,p,v,f.active,u,j,g):(K.set(t,{routeId:a,path:x}),await async function(t,a,r,s,n,l,c,u,m,k){let h=T.fetchers.get(t);be(t,Xe(k,h?h.data:void 0),{flushSync:u});let p=new AbortController,f=De(e.history,r,p.signal);if(c){let e=await rt(n,r,f.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ye(t,a,e.error,{flushSync:u});if(!e.matches)return void ye(t,a,Oe(404,{pathname:r}),{flushSync:u});s=Ge(n=e.matches,r)}U.set(t,p);let x=H,g=Ce(i,d,f,n,s,o,l),b=(await fe(f,g,l,t))[s.route.id];if(U.get(t)===p&&U.delete(t),!f.signal.aborted){if(!J.has(t))return He(b)?W>x?void be(t,Ze(void 0)):(q.add(t),void await he(f,b,!1,{preventScrollReset:m})):void(Ue(b)?ye(t,a,b.error):be(t,Ze(b.data)));be(t,Ze(void 0))}}(t,a,x,w,p,v,f.active,u,j,g))},revalidate:function(){Z||(Z=function(){let e,t,a=new Promise(((r,s)=>{e=async e=>{r(e);try{await a}catch(e){}},t=async e=>{s(e);try{await a}catch(e){}}}));return{promise:a,resolve:e,reject:t}}()),ge(),Q({revalidation:"loading"});let e=Z.promise;return"submitting"===T.navigation.state?e:"idle"===T.navigation.state?(de(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),e):(de(M||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:!0===$}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:je,deleteFetcher:function(e){let t=(G.get(e)||0)-1;t<=0?(G.delete(e),J.add(e)):G.set(e,t),Q({fetchers:new Map(T.fetchers)})},dispose:function(){p&&p(),A&&A(),x.clear(),D&&D.abort(),T.fetchers.forEach(((e,t)=>Ne(t))),T.blockers.forEach(((e,t)=>We(t)))},getBlocker:function(e,t){let a=T.blockers.get(e)||se;return X.get(e)!==t&&X.set(e,t),a},deleteBlocker:We,patchRoutes:function(e,t){let a=null==r;pe(e,t,r||l,d,i),a&&(l=[...l],Q({}))},_internalFetchControllers:U,_internalSetRoutes:function(e){d={},r=j(e,i,void 0,d)}},n}function ce(e,t,a,r,s,n){let o,i;if(s){o=[];for(let e of t)if(o.push(e),e.route.id===s){i=e;break}}else o=t,i=t[t.length-1];let d=H(r||".",U(o),F(e.pathname,a)||e.pathname,"path"===n);if(null==r&&(d.search=e.search,d.hash=e.hash),(null==r||""===r||"."===r)&&i){let e=Ke(d.search);if(i.route.index&&!e)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!i.route.index&&e){let e=new URLSearchParams(d.search),t=e.getAll("index");e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let a=e.toString();d.search=a?`?${a}`:""}}return"/"!==a&&(d.pathname="/"===d.pathname?a:W([a,d.pathname])),x(d)}function ue(e,t,a){if(!a||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(a))return{path:t};if(a.formMethod&&(r=a.formMethod,!Q.has(r.toUpperCase())))return{path:t,error:Oe(405,{method:a.formMethod})};var r;let s,n,o=()=>({path:t,error:Oe(400,{type:"invalid-body"})}),i=(a.formMethod||"get").toUpperCase(),d=Ie(t);if(void 0!==a.body){if("text/plain"===a.formEncType){if(!qe(i))return o();let e="string"==typeof a.body?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce(((e,[t,a])=>`${e}${t}=${a}\n`),""):String(a.body);return{path:t,submission:{formMethod:i,formAction:d,formEncType:a.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===a.formEncType){if(!qe(i))return o();try{let e="string"==typeof a.body?JSON.parse(a.body):a.body;return{path:t,submission:{formMethod:i,formAction:d,formEncType:a.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return o()}}}if(k("function"==typeof FormData,"FormData is not available in this environment"),a.formData)s=Pe(a.formData),n=a.formData;else if(a.body instanceof FormData)s=Pe(a.body),n=a.body;else if(a.body instanceof URLSearchParams)s=a.body,n=Te(s);else if(null==a.body)s=new URLSearchParams,n=new FormData;else try{s=new URLSearchParams(a.body),n=Te(s)}catch(e){return o()}let l={formMethod:i,formAction:d,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:n,json:void 0,text:void 0};if(qe(l.formMethod))return{path:t,submission:l};let c=g(t);return e&&c.search&&Ke(c.search)&&s.append("index",""),c.search=`?${s}`,{path:x(c),submission:l}}function me(e,t,a,r,s,n,o,i,d,l,c,u,m,k,h,p,f,x,g,b){let y,w=b?Ue(b[1])?b[1].error:b[1].data:void 0,v=s.createURL(n.location),j=s.createURL(d);if(c&&n.errors){let e=Object.keys(n.errors)[0];y=o.findIndex((t=>t.route.id===e))}else if(b&&Ue(b[1])){let e=b[0];y=o.findIndex((t=>t.route.id===e))-1}let _=b?b[1].statusCode:void 0,C=_&&_>=400,S={currentUrl:v,currentParams:n.matches[0]?.params||{},nextUrl:j,nextParams:o[0].params,...i,actionResult:w,actionStatus:_},E=o.map(((s,o)=>{let{route:i}=s,d=null;if(null!=y&&o>y?d=!1:i.lazy?d=!0:null==i.loader?d=!1:c?d=ke(i,n.loaderData,n.errors):function(e,t,a){let r=!t||a.route.id!==t.route.id,s=!e.hasOwnProperty(a.route.id);return r||s}(n.loaderData,n.matches[o],s)&&(d=!0),null!==d)return _e(a,r,e,s,l,t,d);let m=!C&&(u||v.pathname+v.search===j.pathname+j.search||v.search!==j.search||function(e,t){let a=e.route.path;return e.pathname!==t.pathname||null!=a&&a.endsWith("*")&&e.params["*"]!==t.params["*"]}(n.matches[o],s)),k={...S,defaultShouldRevalidate:m},h=he(s,k);return _e(a,r,e,s,l,t,h,k)})),R=[];return h.forEach(((e,i)=>{if(c||!o.some((t=>t.route.id===e.routeId))||k.has(i))return;let d=n.fetchers.get(i),h=d&&"idle"!==d.state&&void 0===d.data,b=N(f,e.path,x);if(!b){if(g&&h)return;return void R.push({key:i,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null})}if(p.has(i))return;let y=Ge(b,e.path),w=new AbortController,v=De(s,e.path,w.signal),j=null;if(m.has(i))m.delete(i),j=Ce(a,r,v,b,y,l,t);else if(h)u&&(j=Ce(a,r,v,b,y,l,t));else{let e={...S,defaultShouldRevalidate:!C&&u};he(y,e)&&(j=Ce(a,r,v,b,y,l,t,e))}j&&R.push({key:i,routeId:e.routeId,path:e.path,matches:j,match:y,request:v,controller:w})})),{dsMatches:E,revalidatingFetchers:R}}function ke(e,t,a){if(e.lazy)return!0;if(!e.loader)return!1;let r=null!=t&&e.id in t,s=null!=a&&void 0!==a[e.id];return!(!r&&s)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!r&&!s)}function he(e,t){if(e.route.shouldRevalidate){let a=e.route.shouldRevalidate(t);if("boolean"==typeof a)return a}return t.defaultShouldRevalidate}function pe(e,t,a,r,s){let n;if(e){let t=r[e];k(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),n=t.children}else n=a;let o=j(t.filter((e=>!n.some((t=>fe(e,t))))),s,[e||"_","patch",String(n?.length||"0")],r);n.push(...o)}function fe(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||e.children.every(((e,a)=>t.children?.some((t=>fe(e,t))))))}var xe=new WeakMap,ge=({key:e,route:t,manifest:a,mapRouteProperties:r})=>{let s=a[t.id];if(k(s,"No route found in manifest"),!s.lazy||"object"!=typeof s.lazy)return;let n=s.lazy[e];if(!n)return;let o=xe.get(s);o||(o={},xe.set(s,o));let i=o[e];if(i)return i;let d=(async()=>{let t=function(e){return w.has(e)}(e),a=void 0!==s[e]&&"hasErrorBoundary"!==e;if(t)h(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),o[e]=Promise.resolve();else if(a)h(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await n();null!=t&&(Object.assign(s,{[e]:t}),Object.assign(s,r(s)))}"object"==typeof s.lazy&&(s.lazy[e]=void 0,Object.values(s.lazy).every((e=>void 0===e))&&(s.lazy=void 0))})();return o[e]=d,d},be=new WeakMap;async function ye(e){let t=e.matches.filter((e=>e.shouldLoad)),a={};return(await Promise.all(t.map((e=>e.resolve())))).forEach(((e,r)=>{a[t[r].route.id]=e})),a}async function we(e){return e.matches.some((e=>e.route.unstable_middleware))?ve(e,!1,(()=>ye(e)),((e,t)=>({[t]:{type:"error",result:e}}))):ye(e)}async function ve(e,t,a,r){let{matches:s,request:n,params:o,context:i}=e,d={handlerResult:void 0};try{let e=s.flatMap((e=>e.route.unstable_middleware?e.route.unstable_middleware.map((t=>[e.route.id,t])):[])),r=await je({request:n,params:o,context:i},e,t,d,a);return t?r:d.handlerResult}catch(e){if(!d.middlewareError)throw e;let a=await r(d.middlewareError.error,d.middlewareError.routeId);return t||!d.handlerResult?a:Object.assign(d.handlerResult,a)}}async function je(e,t,a,r,s,n=0){let{request:o}=e;if(o.signal.aborted){if(o.signal.reason)throw o.signal.reason;throw new Error(`Request aborted without an \`AbortSignal.reason\`: ${o.method} ${o.url}`)}let i=t[n];if(!i)return r.handlerResult=await s(),r.handlerResult;let d,[l,c]=i,u=!1,m=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");u=!0;let o=await je(e,t,a,r,s,n+1);if(a)return d=o,d};try{let t=await c({request:e.request,params:e.params,context:e.context},m);return u?void 0===t?d:t:m()}catch(e){throw r.middlewareError?r.middlewareError.error!==e&&(r.middlewareError={routeId:l,error:e}):r.middlewareError={routeId:l,error:e},e}}function Ne(e,t,a,r,s){let n=ge({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),o=function(e,t,a,r,s){let n=a[e.id];if(k(n,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=be.get(n);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let a=(async()=>{k("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),a={};for(let e in t){let r=t[e];if(void 0===r)continue;let o=(s=e,v.has(s)),i=void 0!==n[e]&&"hasErrorBoundary"!==e;o?h(!o,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):i?h(!i,`Route "${n.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):a[e]=r}var s;Object.assign(n,a),Object.assign(n,{...r(n),lazy:void 0})})();return be.set(n,a),a.catch((()=>{})),{lazyRoutePromise:a,lazyHandlerPromise:a}}let o,i=Object.keys(e.lazy),d=[];for(let n of i){if(s&&s.includes(n))continue;let i=ge({key:n,route:e,manifest:a,mapRouteProperties:r});i&&(d.push(i),n===t&&(o=i))}let l=d.length>0?Promise.all(d).then((()=>{})):void 0;return l?.catch((()=>{})),o?.catch((()=>{})),{lazyRoutePromise:l,lazyHandlerPromise:o}}(r.route,qe(a.method)?"action":"loader",t,e,s);return{middleware:n,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function _e(e,t,a,r,s,n,o,i=null){let d=!1,l=Ne(e,t,a,r,s);return{...r,_lazyPromises:l,shouldLoad:o,unstable_shouldRevalidateArgs:i,unstable_shouldCallHandler:e=>(d=!0,i?he(r,"boolean"==typeof e?{...i,defaultShouldRevalidate:e}:i):o),resolve:e=>d||o||e&&"GET"===a.method&&(r.route.lazy||r.route.loader)?async function({request:e,match:t,lazyHandlerPromise:a,lazyRoutePromise:r,handlerOverride:s,scopedContext:n}){let o,i,d=qe(e.method),l=d?"action":"loader",c=a=>{let r,o=new Promise(((e,t)=>r=t));i=()=>r(),e.signal.addEventListener("abort",i);let d=r=>"function"!=typeof a?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${l}" [routeId: ${t.route.id}]`)):a({request:e,params:t.params,context:n},...void 0!==r?[r]:[]),c=(async()=>{try{return{type:"data",result:await(s?s((e=>d(e))):d())}}catch(e){return{type:"error",result:e}}})();return Promise.race([c,o])};try{let s=d?t.route.action:t.route.loader;if(a||r)if(s){let e,[t]=await Promise.all([c(s).catch((t=>{e=t})),a,r]);if(void 0!==e)throw e;o=t}else{await a;let s=d?t.route.action:t.route.loader;if(!s){if("action"===l){let a=new URL(e.url),r=a.pathname+a.search;throw Oe(405,{method:e.method,pathname:r,routeId:t.route.id})}return{type:"data",result:void 0}}[o]=await Promise.all([c(s),r])}else{if(!s){let t=new URL(e.url);throw Oe(404,{pathname:t.pathname+t.search})}o=await c(s)}}catch(e){return{type:"error",result:e}}finally{i&&e.signal.removeEventListener("abort",i)}return o}({request:a,match:r,lazyHandlerPromise:l?.handler,lazyRoutePromise:l?.route,handlerOverride:e,scopedContext:n}):Promise.resolve({type:"data",result:void 0})}}function Ce(e,t,a,r,s,n,o,i=null){return r.map((r=>r.route.id!==s.route.id?{...r,shouldLoad:!1,unstable_shouldRevalidateArgs:i,unstable_shouldCallHandler:()=>!1,_lazyPromises:Ne(e,t,a,r,n),resolve:()=>Promise.resolve({type:"data",result:void 0})}:_e(e,t,a,r,n,o,!0,i)))}async function Se(e){let{result:t,type:a}=e;if(Ve(t)){let e;try{let a=t.headers.get("Content-Type");e=a&&/\bapplication\/json\b/.test(a)?null==t.body?null:await t.json():await t.text()}catch(e){return{type:"error",error:e}}return"error"===a?{type:"error",error:new G(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}return"error"===a?We(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new G(t.init?.status||500,void 0,t.data),statusCode:Y(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Y(t)?t.status:void 0}:We(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Ee(e,t,a,r,s){let n=e.headers.get("Location");if(k(n,"Redirects returned/thrown from loaders/actions must have a Location header"),!ne.test(n)){let o=r.slice(0,r.findIndex((e=>e.route.id===a))+1);n=ce(new URL(t.url),o,s,n),e.headers.set("Location",n)}return e}function Re(e,t,a){if(ne.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),n=null!=F(s.pathname,a);if(s.origin===t.origin&&n)return s.pathname+s.search+s.hash}return e}function De(e,t,a,r){let s=e.createURL(Ie(t)).toString(),n={signal:a};if(r&&qe(r.formMethod)){let{formMethod:e,formEncType:t}=r;n.method=e.toUpperCase(),"application/json"===t?(n.headers=new Headers({"Content-Type":t}),n.body=JSON.stringify(r.json)):"text/plain"===t?n.body=r.text:"application/x-www-form-urlencoded"===t&&r.formData?n.body=Pe(r.formData):n.body=r.formData}return new Request(s,n)}function Pe(e){let t=new URLSearchParams;for(let[a,r]of e.entries())t.append(a,"string"==typeof r?r:r.name);return t}function Te(e){let t=new FormData;for(let[a,r]of e.entries())t.append(a,r);return t}function Me(e,t,a,r,s,n){let{loaderData:o,errors:i}=function(e,t,a,r=!1,s=!1){let n,o={},i=null,d=!1,l={},c=a&&Ue(a[1])?a[1].error:void 0;return e.forEach((a=>{if(!(a.route.id in t))return;let u=a.route.id,m=t[u];if(k(!He(m),"Cannot handle redirect results in processLoaderData"),Ue(m)){let t=m.error;if(void 0!==c&&(t=c,c=void 0),i=i||{},s)i[u]=t;else{let a=ze(e,u);null==i[a.route.id]&&(i[a.route.id]=t)}r||(o[u]=de),d||(d=!0,n=Y(m.error)?m.error.status:500),m.headers&&(l[u]=m.headers)}else o[u]=m.data,m.statusCode&&200!==m.statusCode&&!d&&(n=m.statusCode),m.headers&&(l[u]=m.headers)})),void 0!==c&&a&&(i={[a[0]]:c},a[2]&&(o[a[2]]=void 0)),{loaderData:o,errors:i,statusCode:n||200,loaderHeaders:l}}(t,a,r);return s.filter((e=>!e.matches||e.matches.some((e=>e.shouldLoad)))).forEach((t=>{let{key:a,match:r,controller:s}=t,o=n[a];if(k(o,"Did not find corresponding fetcher result"),!s||!s.signal.aborted)if(Ue(o)){let t=ze(e.matches,r?.route.id);i&&i[t.route.id]||(i={...i,[t.route.id]:o.error}),e.fetchers.delete(a)}else if(He(o))k(!1,"Unhandled fetcher revalidation redirect");else{let t=Ze(o.data);e.fetchers.set(a,t)}})),{loaderData:o,errors:i}}function Le(e,t,a,r){let s=Object.entries(t).filter((([,e])=>e!==de)).reduce(((e,[t,a])=>(e[t]=a,e)),{});for(let n of a){let a=n.route.id;if(!t.hasOwnProperty(a)&&e.hasOwnProperty(a)&&n.route.loader&&(s[a]=e[a]),r&&r.hasOwnProperty(a))break}return s}function $e(e){return e?Ue(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ze(e,t){return(t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function Ae(e){let t=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Oe(e,{pathname:t,routeId:a,method:r,type:s,message:n}={}){let o="Unknown Server Error",i="Unknown @remix-run/router error";return 400===e?(o="Bad Request",r&&t&&a?i=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${a}", so there is no way to handle the request.`:"invalid-body"===s&&(i="Unable to encode submission body")):403===e?(o="Forbidden",i=`Route "${a}" does not match URL "${t}"`):404===e?(o="Not Found",i=`No route matches URL "${t}"`):405===e&&(o="Method Not Allowed",r&&t&&a?i=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${a}", so there is no way to handle the request.`:r&&(i=`Invalid request method "${r.toUpperCase()}"`)),new G(e||500,o,new Error(i),!0)}function Fe(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[a,r]=t[e];if(He(r))return{key:a,result:r}}}function Ie(e){return x({..."string"==typeof e?g(e):e,hash:""})}function Be(e){return Ve(e.result)&&ee.has(e.result.status)}function Ue(e){return"error"===e.type}function He(e){return"redirect"===(e&&e.type)}function We(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function Ve(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function qe(e){return X.has(e.toUpperCase())}function Ke(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Ge(e,t){let a="string"==typeof t?g(t).search:t.search;if(e[e.length-1].route.index&&Ke(a||""))return e[e.length-1];let r=B(e);return r[r.length-1]}function Ye(e){let{formMethod:t,formAction:a,formEncType:r,text:s,formData:n,json:o}=e;if(t&&a&&r)return null!=s?{formMethod:t,formAction:a,formEncType:r,formData:void 0,json:void 0,text:s}:null!=n?{formMethod:t,formAction:a,formEncType:r,formData:n,json:void 0,text:void 0}:void 0!==o?{formMethod:t,formAction:a,formEncType:r,formData:void 0,json:o,text:void 0}:void 0}function Je(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Xe(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Ze(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}var Qe=i.createContext(null);Qe.displayName="DataRouter";var et=i.createContext(null);et.displayName="DataRouterState";var tt=i.createContext({isTransitioning:!1});tt.displayName="ViewTransition";var at=i.createContext(new Map);at.displayName="Fetchers",i.createContext(null).displayName="Await";var rt=i.createContext(null);rt.displayName="Navigation";var st=i.createContext(null);st.displayName="Location";var nt=i.createContext({outlet:null,matches:[],isDataRoute:!1});nt.displayName="Route";var ot=i.createContext(null);function it(){return null!=i.useContext(st)}function dt(){return k(it(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(st).location}ot.displayName="RouteError";var lt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ct(e){i.useContext(rt).static||i.useLayoutEffect(e)}function ut(){let{isDataRoute:e}=i.useContext(nt);return e?function(){let{router:e}=function(e){let t=i.useContext(Qe);return k(t,bt(e)),t}("useNavigate"),t=wt("useNavigate"),a=i.useRef(!1);return ct((()=>{a.current=!0})),i.useCallback((async(r,s={})=>{h(a.current,lt),a.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...s}))}),[e,t])}():function(){k(it(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(Qe),{basename:t,navigator:a}=i.useContext(rt),{matches:r}=i.useContext(nt),{pathname:s}=dt(),n=JSON.stringify(U(r)),o=i.useRef(!1);return ct((()=>{o.current=!0})),i.useCallback(((r,i={})=>{if(h(o.current,lt),!o.current)return;if("number"==typeof r)return void a.go(r);let d=H(r,JSON.parse(n),s,"path"===i.relative);null==e&&"/"!==t&&(d.pathname="/"===d.pathname?t:W([t,d.pathname])),(i.replace?a.replace:a.push)(d,i.state,i)}),[t,a,n,s,e])}()}var mt=i.createContext(null);function kt(e,{relative:t}={}){let{matches:a}=i.useContext(nt),{pathname:r}=dt(),s=JSON.stringify(U(a));return i.useMemo((()=>H(e,JSON.parse(s),r,"path"===t)),[e,s,r,t])}function ht(e,t,a,r){k(it(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=i.useContext(rt),{matches:n}=i.useContext(nt),o=n[n.length-1],d=o?o.params:{},l=o?o.pathname:"/",c=o?o.pathnameBase:"/",u=o&&o.route;{let e=u&&u.path||"";Nt(l,!u||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let m,p=dt();if(t){let e="string"==typeof t?g(t):t;k("/"===c||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),m=e}else m=p;let f=m.pathname||"/",x=f;if("/"!==c){let e=c.replace(/^\//,"").split("/");x="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=N(e,{pathname:x});h(u||null!=b,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),h(null==b||void 0!==b[b.length-1].route.element||void 0!==b[b.length-1].route.Component||void 0!==b[b.length-1].route.lazy,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=function(e,t=[],a=null){if(null==e){if(!a)return null;if(a.errors)e=a.matches;else{if(0!==t.length||a.initialized||!(a.matches.length>0))return null;e=a.matches}}let r=e,s=a?.errors;if(null!=s){let e=r.findIndex((e=>e.route.id&&void 0!==s?.[e.route.id]));k(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,e+1))}let n=!1,o=-1;if(a)for(let e=0;e<r.length;e++){let t=r[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(o=e),t.route.id){let{loaderData:e,errors:s}=a,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!s||void 0===s[t.route.id]);if(t.route.lazy||i){n=!0,r=o>=0?r.slice(0,o+1):[r[0]];break}}}return r.reduceRight(((e,d,l)=>{let c,u=!1,m=null,k=null;a&&(c=s&&d.route.id?s[d.route.id]:void 0,m=d.route.errorElement||ft,n&&(o<0&&0===l?(Nt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,k=null):o===l&&(u=!0,k=d.route.hydrateFallbackElement||null)));let h=t.concat(r.slice(0,l+1)),p=()=>{let t;return t=c?m:u?k:d.route.Component?i.createElement(d.route.Component,null):d.route.element?d.route.element:e,i.createElement(gt,{match:d,routeContext:{outlet:e,matches:h,isDataRoute:null!=a},children:t})};return a&&(d.route.ErrorBoundary||d.route.errorElement||0===l)?i.createElement(xt,{location:a.location,revalidation:a.revalidation,component:m,error:c,children:p(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):p()}),null)}(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},d,e.params),pathname:W([c,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:W([c,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),n,a,r);return t&&y?i.createElement(st.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...m},navigationType:"POP"}},y):y}function pt(){let e=vt(),t=Y(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},n={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:n},"ErrorBoundary")," or"," ",i.createElement("code",{style:n},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),a?i.createElement("pre",{style:s},a):null,o)}var ft=i.createElement(pt,null),xt=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?i.createElement(nt.Provider,{value:this.props.routeContext},i.createElement(ot.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function gt({routeContext:e,match:t,children:a}){let r=i.useContext(Qe);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(nt.Provider,{value:e},a)}function bt(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function yt(e){let t=i.useContext(et);return k(t,bt(e)),t}function wt(e){let t=function(e){let t=i.useContext(nt);return k(t,bt(e)),t}(e),a=t.matches[t.matches.length-1];return k(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function vt(){let e=i.useContext(ot),t=yt("useRouteError"),a=wt("useRouteError");return void 0!==e?e:t.errors?.[a]}var jt={};function Nt(e,t,a){t||jt[e]||(jt[e]=!0,h(!1,a))}var _t={};function Ct(e,t){e||_t[t]||(_t[t]=!0,console.warn(t))}function St(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&h(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:i.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&h(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:i.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&h(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:i.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Et=["HydrateFallback","hydrateFallbackElement"],Rt=class{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}};function Dt({router:e,flushSync:t}){let[a,r]=i.useState(e.state),[s,n]=i.useState(),[o,d]=i.useState({isTransitioning:!1}),[l,c]=i.useState(),[u,m]=i.useState(),[k,h]=i.useState(),p=i.useRef(new Map),f=i.useCallback(((a,{deletedFetchers:s,flushSync:o,viewTransitionOpts:k})=>{a.fetchers.forEach(((e,t)=>{void 0!==e.data&&p.current.set(t,e.data)})),s.forEach((e=>p.current.delete(e))),Ct(!1===o||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable.  Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let f=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(Ct(null==k||f,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),k&&f){if(t&&o){t((()=>{u&&(l&&l.resolve(),u.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:k.currentLocation,nextLocation:k.nextLocation})}));let s=e.window.document.startViewTransition((()=>{t((()=>r(a)))}));return s.finished.finally((()=>{t((()=>{c(void 0),m(void 0),n(void 0),d({isTransitioning:!1})}))})),void t((()=>m(s)))}u?(l&&l.resolve(),u.skipTransition(),h({state:a,currentLocation:k.currentLocation,nextLocation:k.nextLocation})):(n(a),d({isTransitioning:!0,flushSync:!1,currentLocation:k.currentLocation,nextLocation:k.nextLocation}))}else t&&o?t((()=>r(a))):i.startTransition((()=>r(a)))}),[e.window,t,u,l]);i.useLayoutEffect((()=>e.subscribe(f)),[e,f]),i.useEffect((()=>{o.isTransitioning&&!o.flushSync&&c(new Rt)}),[o]),i.useEffect((()=>{if(l&&s&&e.window){let t=s,a=l.promise,o=e.window.document.startViewTransition((async()=>{i.startTransition((()=>r(t))),await a}));o.finished.finally((()=>{c(void 0),m(void 0),n(void 0),d({isTransitioning:!1})})),m(o)}}),[s,l,e.window]),i.useEffect((()=>{l&&s&&a.location.key===s.location.key&&l.resolve()}),[l,u,a.location,s]),i.useEffect((()=>{!o.isTransitioning&&k&&(n(k.state),d({isTransitioning:!0,flushSync:!1,currentLocation:k.currentLocation,nextLocation:k.nextLocation}),h(void 0))}),[o.isTransitioning,k]);let x=i.useMemo((()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,a,r)=>e.navigate(t,{state:a,preventScrollReset:r?.preventScrollReset}),replace:(t,a,r)=>e.navigate(t,{replace:!0,state:a,preventScrollReset:r?.preventScrollReset})})),[e]),g=e.basename||"/",b=i.useMemo((()=>({router:e,navigator:x,static:!1,basename:g})),[e,x,g]);return i.createElement(i.Fragment,null,i.createElement(Qe.Provider,{value:b},i.createElement(et.Provider,{value:a},i.createElement(at.Provider,{value:p.current},i.createElement(tt.Provider,{value:o},i.createElement(Mt,{basename:g,location:a.location,navigationType:a.historyAction,navigator:x},i.createElement(Pt,{routes:e.routes,future:e.future,state:a})))))),null)}var Pt=i.memo((function({routes:e,future:t,state:a}){return ht(e,void 0,a,t)}));function Tt(e){return function(e){let t=i.useContext(nt).outlet;return t?i.createElement(mt.Provider,{value:e},t):t}(e.context)}function Mt({basename:e="/",children:t=null,location:a,navigationType:r="POP",navigator:s,static:n=!1}){k(!it(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),d=i.useMemo((()=>({basename:o,navigator:s,static:n,future:{}})),[o,s,n]);"string"==typeof a&&(a=g(a));let{pathname:l="/",search:c="",hash:u="",state:m=null,key:p="default"}=a,f=i.useMemo((()=>{let e=F(l,o);return null==e?null:{location:{pathname:e,search:c,hash:u,state:m,key:p},navigationType:r}}),[o,l,c,u,m,p,r]);return h(null!=f,`<Router basename="${o}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),null==f?null:i.createElement(rt.Provider,{value:d},i.createElement(st.Provider,{children:t,value:f}))}i.Component;var Lt="get",$t="application/x-www-form-urlencoded";function zt(e){return null!=e&&"string"==typeof e.tagName}var At=null,Ot=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ft(e){return null==e||Ot.has(e)?e:(h(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$t}"`),null)}function It(e,t){if(!1===e||null==e)throw new Error(t)}function Bt(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Ut(e,t,a,r,s,n){let o=(e,t)=>!a[t]||e.route.id!==a[t].route.id,i=(e,t)=>a[t].pathname!==e.pathname||a[t].route.path?.endsWith("*")&&a[t].params["*"]!==e.params["*"];return"assets"===n?t.filter(((e,t)=>o(e,t)||i(e,t))):"data"===n?t.filter(((t,n)=>{let d=r.routes[t.route.id];if(!d||!d.hasLoader)return!1;if(o(t,n)||i(t,n))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:a[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0})):[]}function Ht(e,t,{includeHydrateFallback:a}={}){return r=e.map((e=>{let r=t.routes[e.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),a&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s})).flat(1),[...new Set(r)];var r}Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),"undefined"!=typeof window?window:"undefined"!=typeof globalThis&&globalThis,Symbol("SingleFetchRedirect");function Wt(){let e=i.useContext(Qe);return It(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Vt(){let e=i.useContext(et);return It(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}i.Component;var qt=i.createContext(void 0);function Kt(){let e=i.useContext(qt);return It(e,"You must render this element inside a <HydratedRouter> element"),e}function Gt(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function Yt({page:e,...t}){let{router:a}=Wt(),r=i.useMemo((()=>N(a.routes,e,a.basename)),[a.routes,e,a.basename]);return r?i.createElement(Xt,{page:e,matches:r,...t}):null}function Jt(e){let{manifest:t,routeModules:a}=Kt(),[r,s]=i.useState([]);return i.useEffect((()=>{let r=!1;return async function(e,t,a){return function(e,t){let a=new Set,r=new Set(t);return e.reduce(((e,s)=>{if(t&&(null==(n=s)||"string"!=typeof n.page)&&"script"===s.as&&s.href&&r.has(s.href))return e;var n;let o=JSON.stringify(function(e){let t={},a=Object.keys(e).sort();for(let r of a)t[r]=e[r];return t}(s));return a.has(o)||(a.add(o),e.push({key:o,link:s})),e}),[])}((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise((()=>{}))}}(r,a);return e.links?e.links():[]}return[]})))).flat(1).filter(Bt).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}(e,t,a).then((e=>{r||s(e)})),()=>{r=!0}}),[e,t,a]),r}function Xt({page:e,matches:t,...a}){let r=dt(),{manifest:s,routeModules:n}=Kt(),{basename:o}=Wt(),{loaderData:d,matches:l}=Vt(),c=i.useMemo((()=>Ut(e,t,l,s,r,"data")),[e,t,l,s,r]),u=i.useMemo((()=>Ut(e,t,l,s,r,"assets")),[e,t,l,s,r]),m=i.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let a=new Set,i=!1;if(t.forEach((e=>{let t=s.routes[e.route.id];t&&t.hasLoader&&(!c.some((t=>t.route.id===e.route.id))&&e.route.id in d&&n[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:a.add(e.route.id))})),0===a.size)return[];let l=function(e,t){let a="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return"/"===a.pathname?a.pathname="_root.data":t&&"/"===F(a.pathname,t)?a.pathname=`${t.replace(/\/$/,"")}/_root.data`:a.pathname=`${a.pathname.replace(/\/$/,"")}.data`,a}(e,o);return i&&a.size>0&&l.searchParams.set("_routes",t.filter((e=>a.has(e.route.id))).map((e=>e.route.id)).join(",")),[l.pathname+l.search]}),[o,d,r,s,c,t,e,n]),k=i.useMemo((()=>Ht(u,s)),[u,s]),h=Jt(u);return i.createElement(i.Fragment,null,m.map((e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...a}))),k.map((e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...a}))),h.map((({key:e,link:t})=>i.createElement("link",{key:e,...t}))))}qt.displayName="FrameworkContext";function Zt(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}var Qt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Qt&&(window.__reactRouterVersion="7.6.3")}catch(vr){}function ea(e,t){return le({basename:t?.basename,unstable_getContext:t?.unstable_getContext,future:t?.future,history:m({window:t?.window}),hydrationData:t?.hydrationData||ta(),routes:e,mapRouteProperties:St,hydrationRouteProperties:Et,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function ta(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:aa(e.errors)}),e}function aa(e){if(!e)return null;let t=Object.entries(e),a={};for(let[e,r]of t)if(r&&"RouteErrorResponse"===r.__type)a[e]=new G(r.status,r.statusText,r.data,!0===r.internal);else if(r&&"Error"===r.__type){if(r.__subType){let t=window[r.__subType];if("function"==typeof t)try{let s=new t(r.message);s.stack="",a[e]=s}catch(e){}}if(null==a[e]){let t=new Error(r.message);t.stack="",a[e]=t}}else a[e]=r;return a}var ra=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sa=i.forwardRef((function({onClick:e,discover:t="render",prefetch:a="none",relative:r,reloadDocument:s,replace:n,state:o,target:d,to:l,preventScrollReset:c,viewTransition:u,...m},p){let f,{basename:g}=i.useContext(rt),b="string"==typeof l&&ra.test(l),y=!1;if("string"==typeof l&&b&&(f=l,Qt))try{let e=new URL(window.location.href),t=l.startsWith("//")?new URL(e.protocol+l):new URL(l),a=F(t.pathname,g);t.origin===e.origin&&null!=a?l=a+t.search+t.hash:y=!0}catch(e){h(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let w=function(e,{relative:t}={}){k(it(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=i.useContext(rt),{hash:s,pathname:n,search:o}=kt(e,{relative:t}),d=n;return"/"!==a&&(d="/"===n?a:W([a,n])),r.createHref({pathname:d,search:o,hash:s})}(l,{relative:r}),[v,j,N]=function(e,t){let a=i.useContext(qt),[r,s]=i.useState(!1),[n,o]=i.useState(!1),{onFocus:d,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:m}=t,k=i.useRef(null);i.useEffect((()=>{if("render"===e&&o(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{o(e.isIntersecting)}))}),{threshold:.5});return k.current&&e.observe(k.current),()=>{e.disconnect()}}}),[e]),i.useEffect((()=>{if(r){let e=setTimeout((()=>{o(!0)}),100);return()=>{clearTimeout(e)}}}),[r]);let h=()=>{s(!0)},p=()=>{s(!1),o(!1)};return a?"intent"!==e?[n,k,{}]:[n,k,{onFocus:Gt(d,h),onBlur:Gt(l,p),onMouseEnter:Gt(c,h),onMouseLeave:Gt(u,p),onTouchStart:Gt(m,h)}]:[!1,k,{}]}(a,m),_=function(e,{target:t,replace:a,state:r,preventScrollReset:s,relative:n,viewTransition:o}={}){let d=ut(),l=dt(),c=kt(e,{relative:n});return i.useCallback((i=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(i,t)){i.preventDefault();let t=void 0!==a?a:x(l)===x(c);d(e,{replace:t,state:r,preventScrollReset:s,relative:n,viewTransition:o})}}),[l,d,c,a,r,t,e,s,n,o])}(l,{replace:n,state:o,target:d,preventScrollReset:c,relative:r,viewTransition:u}),C=i.createElement("a",{...m,...N,href:f||w,onClick:y||s?e:function(t){e&&e(t),t.defaultPrevented||_(t)},ref:Zt(p,j),target:d,"data-discover":b||"render"!==t?void 0:"true"});return v&&!b?i.createElement(i.Fragment,null,C,i.createElement(Yt,{page:w})):C}));sa.displayName="Link";var na=i.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:a="",end:r=!1,style:s,to:n,viewTransition:o,children:d,...l},c){let u=kt(n,{relative:l.relative}),m=dt(),h=i.useContext(et),{navigator:p,basename:f}=i.useContext(rt),x=null!=h&&function(e,t={}){let a=i.useContext(tt);k(null!=a,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=oa("useViewTransitionState"),s=kt(e,{relative:t.relative});if(!a.isTransitioning)return!1;let n=F(a.currentLocation.pathname,r)||a.currentLocation.pathname,o=F(a.nextLocation.pathname,r)||a.nextLocation.pathname;return null!=A(s.pathname,o)||null!=A(s.pathname,n)}(u)&&!0===o,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,b=m.pathname,y=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;t||(b=b.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&f&&(y=F(y,f)||y);const w="/"!==g&&g.endsWith("/")?g.length-1:g.length;let v,j=b===g||!r&&b.startsWith(g)&&"/"===b.charAt(w),N=null!=y&&(y===g||!r&&y.startsWith(g)&&"/"===y.charAt(g.length)),_={isActive:j,isPending:N,isTransitioning:x},C=j?e:void 0;v="function"==typeof a?a(_):[a,j?"active":null,N?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let S="function"==typeof s?s(_):s;return i.createElement(sa,{...l,"aria-current":C,className:v,ref:c,style:S,to:n,viewTransition:o},"function"==typeof d?d(_):d)}));function oa(e){let t=i.useContext(Qe);return k(t,function(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}na.displayName="NavLink",i.forwardRef((({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:r,replace:s,state:n,method:o=Lt,action:d,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:m,...h},p)=>{let f=function(){let{router:e}=oa("useSubmit"),{basename:t}=i.useContext(rt),a=wt("useRouteId");return i.useCallback((async(r,s={})=>{let{action:n,method:o,encType:i,formData:d,body:l}=function(e,t){let a,r,s,n,o;if(zt(i=e)&&"form"===i.tagName.toLowerCase()){let o=e.getAttribute("action");r=o?F(o,t):null,a=e.getAttribute("method")||Lt,s=Ft(e.getAttribute("enctype"))||$t,n=new FormData(e)}else if(function(e){return zt(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return zt(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>');let i=e.getAttribute("formaction")||o.getAttribute("action");if(r=i?F(i,t):null,a=e.getAttribute("formmethod")||o.getAttribute("method")||Lt,s=Ft(e.getAttribute("formenctype"))||Ft(o.getAttribute("enctype"))||$t,n=new FormData(o,e),!function(){if(null===At)try{new FormData(document.createElement("form"),0),At=!1}catch(e){At=!0}return At}()){let{name:t,type:a,value:r}=e;if("image"===a){let e=t?`${t}.`:"";n.append(`${e}x`,"0"),n.append(`${e}y`,"0")}else t&&n.append(t,r)}}else{if(zt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Lt,r=null,s=$t,o=e}var i;return n&&"text/plain"===s&&(o=n,n=void 0),{action:r,method:a.toLowerCase(),encType:s,formData:n,body:o}}(r,t);if(!1===s.navigate){let t=s.fetcherKey||da();await e.fetch(t,a,s.action||n,{preventScrollReset:s.preventScrollReset,formData:d,body:l,formMethod:s.method||o,formEncType:s.encType||i,flushSync:s.flushSync})}else await e.navigate(s.action||n,{preventScrollReset:s.preventScrollReset,formData:d,body:l,formMethod:s.method||o,formEncType:s.encType||i,replace:s.replace,state:s.state,fromRouteId:a,flushSync:s.flushSync,viewTransition:s.viewTransition})}),[e,t,a])}(),g=function(e,{relative:t}={}){let{basename:a}=i.useContext(rt),r=i.useContext(nt);k(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),n={...kt(e||".",{relative:t})},o=dt();if(null==e){n.search=o.search;let e=new URLSearchParams(n.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();n.search=a?`?${a}`:""}}return e&&"."!==e||!s.route.index||(n.search=n.search?n.search.replace(/^\?/,"?index&"):"?index"),"/"!==a&&(n.pathname="/"===n.pathname?a:W([a,n.pathname])),x(n)}(d,{relative:c}),b="get"===o.toLowerCase()?"get":"post",y="string"==typeof d&&ra.test(d);return i.createElement("form",{ref:p,method:b,action:g,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute("formmethod")||o;f(r||e.currentTarget,{fetcherKey:t,method:i,navigate:a,replace:s,state:n,relative:c,preventScrollReset:u,viewTransition:m})},...h,"data-discover":y||"render"!==e?void 0:"true"})})).displayName="Form";var ia=0,da=()=>`__${String(++ia)}__`;const la=window.ReactDOM;function ca(e){return i.createElement(Dt,{flushSync:la.flushSync,...e})}const ua=window.wp.i18n,ma=e=>{const t=fa(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const a=e.split("-");return""===a[0]&&1!==a.length&&a.shift(),ka(a,t)||pa(e)},getConflictingClassGroupIds:(e,t)=>{const s=a[e]||[];return t&&r[e]?[...s,...r[e]]:s}}},ka=(e,t)=>{if(0===e.length)return t.classGroupId;const a=e[0],r=t.nextPart.get(a),s=r?ka(e.slice(1),r):void 0;if(s)return s;if(0===t.validators.length)return;const n=e.join("-");return t.validators.find((({validator:e})=>e(n)))?.classGroupId},ha=/^\[(.+)\]$/,pa=e=>{if(ha.test(e)){const t=ha.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},fa=e=>{const{theme:t,classGroups:a}=e,r={nextPart:new Map,validators:[]};for(const e in a)xa(a[e],r,e,t);return r},xa=(e,t,a,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return ba(e)?void xa(e(r),t,a,r):void t.validators.push({validator:e,classGroupId:a});Object.entries(e).forEach((([e,s])=>{xa(s,ga(t,e),a,r)}))}else(""===e?t:ga(t,e)).classGroupId=a}))},ga=(e,t)=>{let a=e;return t.split("-").forEach((e=>{a.nextPart.has(e)||a.nextPart.set(e,{nextPart:new Map,validators:[]}),a=a.nextPart.get(e)})),a},ba=e=>e.isThemeGetter,ya=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,r=new Map;const s=(s,n)=>{a.set(s,n),t++,t>e&&(t=0,r=a,a=new Map)};return{get(e){let t=a.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(s(e,t),t):void 0},set(e,t){a.has(e)?a.set(e,t):s(e,t)}}},wa=e=>{const{prefix:t,experimentalParseClassName:a}=e;let r=e=>{const t=[];let a,r=0,s=0,n=0;for(let o=0;o<e.length;o++){let i=e[o];if(0===r&&0===s){if(":"===i){t.push(e.slice(n,o)),n=o+1;continue}if("/"===i){a=o;continue}}"["===i?r++:"]"===i?r--:"("===i?s++:")"===i&&s--}const o=0===t.length?e:e.substring(n),i=va(o);return{modifiers:t,hasImportantModifier:i!==o,baseClassName:i,maybePostfixModifierPosition:a&&a>n?a-n:void 0}};if(t){const e=t+":",a=r;r=t=>t.startsWith(e)?a(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(a){const e=r;r=t=>a({className:t,parseClassName:e})}return r},va=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,ja=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map((e=>[e,!0])));return e=>{if(e.length<=1)return e;const a=[];let r=[];return e.forEach((e=>{"["===e[0]||t[e]?(a.push(...r.sort(),e),r=[]):r.push(e)})),a.push(...r.sort()),a}},Na=/\s+/;function _a(){let e,t,a=0,r="";for(;a<arguments.length;)(e=arguments[a++])&&(t=Ca(e))&&(r&&(r+=" "),r+=t);return r}const Ca=e=>{if("string"==typeof e)return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=Ca(e[r]))&&(a&&(a+=" "),a+=t);return a};function Sa(e,...t){let a,r,s,n=function(i){const d=t.reduce(((e,t)=>t(e)),e());return a=(e=>({cache:ya(e.cacheSize),parseClassName:wa(e),sortModifiers:ja(e),...ma(e)}))(d),r=a.cache.get,s=a.cache.set,n=o,o(i)};function o(e){const t=r(e);if(t)return t;const n=((e,t)=>{const{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:n}=t,o=[],i=e.trim().split(Na);let d="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{isExternal:l,modifiers:c,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:k}=a(t);if(l){d=t+(d.length>0?" "+d:d);continue}let h=!!k,p=r(h?m.substring(0,k):m);if(!p){if(!h){d=t+(d.length>0?" "+d:d);continue}if(p=r(m),!p){d=t+(d.length>0?" "+d:d);continue}h=!1}const f=n(c).join(":"),x=u?f+"!":f,g=x+p;if(o.includes(g))continue;o.push(g);const b=s(p,h);for(let e=0;e<b.length;++e){const t=b[e];o.push(x+t)}d=t+(d.length>0?" "+d:d)}return d})(e,a);return s(e,n),n}return function(){return n(_a.apply(null,arguments))}}const Ea=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Ra=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Da=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Pa=/^\d+\/\d+$/,Ta=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ma=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,La=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$a=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,za=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Aa=e=>Pa.test(e),Oa=e=>!!e&&!Number.isNaN(Number(e)),Fa=e=>!!e&&Number.isInteger(Number(e)),Ia=e=>e.endsWith("%")&&Oa(e.slice(0,-1)),Ba=e=>Ta.test(e),Ua=()=>!0,Ha=e=>Ma.test(e)&&!La.test(e),Wa=()=>!1,Va=e=>$a.test(e),qa=e=>za.test(e),Ka=e=>!Ya(e)&&!tr(e),Ga=e=>dr(e,mr,Wa),Ya=e=>Ra.test(e),Ja=e=>dr(e,kr,Ha),Xa=e=>dr(e,hr,Oa),Za=e=>dr(e,cr,Wa),Qa=e=>dr(e,ur,qa),er=e=>dr(e,fr,Va),tr=e=>Da.test(e),ar=e=>lr(e,kr),rr=e=>lr(e,pr),sr=e=>lr(e,cr),nr=e=>lr(e,mr),or=e=>lr(e,ur),ir=e=>lr(e,fr,!0),dr=(e,t,a)=>{const r=Ra.exec(e);return!!r&&(r[1]?t(r[1]):a(r[2]))},lr=(e,t,a=!1)=>{const r=Da.exec(e);return!!r&&(r[1]?t(r[1]):a)},cr=e=>"position"===e||"percentage"===e,ur=e=>"image"===e||"url"===e,mr=e=>"length"===e||"size"===e||"bg-size"===e,kr=e=>"length"===e,hr=e=>"number"===e,pr=e=>"family-name"===e,fr=e=>"shadow"===e,xr=Sa((Symbol.toStringTag,()=>{const e=Ea("color"),t=Ea("font"),a=Ea("text"),r=Ea("font-weight"),s=Ea("tracking"),n=Ea("leading"),o=Ea("breakpoint"),i=Ea("container"),d=Ea("spacing"),l=Ea("radius"),c=Ea("shadow"),u=Ea("inset-shadow"),m=Ea("text-shadow"),k=Ea("drop-shadow"),h=Ea("blur"),p=Ea("perspective"),f=Ea("aspect"),x=Ea("ease"),g=Ea("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",tr,Ya],y=()=>[tr,Ya,d],w=()=>[Aa,"full","auto",...y()],v=()=>[Fa,"none","subgrid",tr,Ya],j=()=>["auto",{span:["full",Fa,tr,Ya]},Fa,tr,Ya],N=()=>[Fa,"auto",tr,Ya],_=()=>["auto","min","max","fr",tr,Ya],C=()=>["auto",...y()],S=()=>[Aa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],E=()=>[e,tr,Ya],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",sr,Za,{position:[tr,Ya]}],D=()=>["auto","cover","contain",nr,Ga,{size:[tr,Ya]}],P=()=>[Ia,ar,Ja],T=()=>["","none","full",l,tr,Ya],M=()=>["",Oa,ar,Ja],L=()=>[Oa,Ia,sr,Za],$=()=>["","none",h,tr,Ya],z=()=>["none",Oa,tr,Ya],A=()=>["none",Oa,tr,Ya],O=()=>[Oa,tr,Ya],F=()=>[Aa,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ba],breakpoint:[Ba],color:[Ua],container:[Ba],"drop-shadow":[Ba],ease:["in","out","in-out"],font:[Ka],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ba],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ba],shadow:[Ba],spacing:["px",Oa],text:[Ba],"text-shadow":[Ba],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Aa,Ya,tr,f]}],container:["container"],columns:[{columns:[Oa,Ya,tr,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[Fa,"auto",tr,Ya]}],basis:[{basis:[Aa,"full","auto",i,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oa,Aa,"auto","initial","none",Ya]}],grow:[{grow:["",Oa,tr,Ya]}],shrink:[{shrink:["",Oa,tr,Ya]}],order:[{order:[Fa,"first","last","none",tr,Ya]}],"grid-cols":[{"grid-cols":v()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":v()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":_()}],"auto-rows":[{"auto-rows":_()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],w:[{w:[i,"screen",...S()]}],"min-w":[{"min-w":[i,"screen","none",...S()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[o]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",a,ar,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tr,Xa]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ia,Ya]}],"font-family":[{font:[rr,Ya,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,tr,Ya]}],"line-clamp":[{"line-clamp":[Oa,"none",tr,Xa]}],leading:[{leading:[n,...y()]}],"list-image":[{"list-image":["none",tr,Ya]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",tr,Ya]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Oa,"from-font","auto",tr,Ja]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Oa,"auto",tr,Ya]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tr,Ya]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tr,Ya]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fa,tr,Ya],radial:["",tr,Ya],conic:[Fa,tr,Ya]},or,Qa]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Oa,tr,Ya]}],"outline-w":[{outline:["",Oa,ar,Ja]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",c,ir,er]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",u,ir,er]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Oa,Ja]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",m,ir,er]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Oa,tr,Ya]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oa]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[tr,Ya]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Oa]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",tr,Ya]}],filter:[{filter:["","none",tr,Ya]}],blur:[{blur:$()}],brightness:[{brightness:[Oa,tr,Ya]}],contrast:[{contrast:[Oa,tr,Ya]}],"drop-shadow":[{"drop-shadow":["","none",k,ir,er]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Oa,tr,Ya]}],"hue-rotate":[{"hue-rotate":[Oa,tr,Ya]}],invert:[{invert:["",Oa,tr,Ya]}],saturate:[{saturate:[Oa,tr,Ya]}],sepia:[{sepia:["",Oa,tr,Ya]}],"backdrop-filter":[{"backdrop-filter":["","none",tr,Ya]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[Oa,tr,Ya]}],"backdrop-contrast":[{"backdrop-contrast":[Oa,tr,Ya]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oa,tr,Ya]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oa,tr,Ya]}],"backdrop-invert":[{"backdrop-invert":["",Oa,tr,Ya]}],"backdrop-opacity":[{"backdrop-opacity":[Oa,tr,Ya]}],"backdrop-saturate":[{"backdrop-saturate":[Oa,tr,Ya]}],"backdrop-sepia":[{"backdrop-sepia":["",Oa,tr,Ya]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",tr,Ya]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oa,"initial",tr,Ya]}],ease:[{ease:["linear","initial",x,tr,Ya]}],delay:[{delay:[Oa,tr,Ya]}],animate:[{animate:["none",g,tr,Ya]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,tr,Ya]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:A()}],"scale-x":[{"scale-x":A()}],"scale-y":[{"scale-y":A()}],"scale-z":[{"scale-z":A()}],"scale-3d":["scale-3d"],skew:[{skew:O()}],"skew-x":[{"skew-x":O()}],"skew-y":[{"skew-y":O()}],transform:[{transform:[tr,Ya,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tr,Ya]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tr,Ya]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Oa,ar,Ja,Xa]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})),gr=(...e)=>xr(e),br=window.ReactJSXRuntime,yr=({className:e})=>{const t=vt(),a=t?.status||null,s=t?.message||(0,ua.__)("An unexpected error occurred. Please try again or return to the dashboard.","dokan-kits");return(0,br.jsxs)("div",{className:gr("dokan-kits-error-boundary dk-min-h-[500px] dk-flex dk-flex-col dk-items-center dk-justify-center dk-p-wp-8 dk-text-center dk-bg-white dk-shadow-lg dk-rounded-lg dk-max-w-5xl dk-mx-auto dk-my-wp-8 dk-border dk-border-gray-100",e),children:[(0,br.jsx)("div",{className:"dk-flex dk-justify-center dk-items-center dk-mb-wp-6",children:(0,br.jsx)("div",{className:"dk-relative dk-flex dk-items-center dk-justify-center dk-h-32 dk-w-32 dk-rounded-full dk-bg-gradient-to-br dk-from-red-50 dk-via-red-100 dk-to-red-50 dk-border-4 dk-border-red-200 dk-shadow-md",children:(0,br.jsx)("span",{className:`dashicons dashicons-${(()=>{let e="warning";return 404===a?e="no-alt":403===a?e="lock":a>=500&&(e="dismiss"),e})()} dk-text-center dk-flex dk-items-center dk-justify-center dk-w-full dk-h-full dk-text-6xl dk-text-red-600 dk-animate-pulse`,style:{lineHeight:"1",fontSize:"3.75rem",top:"1px",position:"relative"},"aria-hidden":"true"})})}),(0,br.jsx)("h1",{className:"dk-text-3xl dk-font-bold dk-text-gray-900 dk-mb-wp-3",children:a?(0,ua.__)(`Error ${a}`,"dokan-kits"):(0,ua.__)("Oops! Something went wrong","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-lg dk-text-gray-600 dk-mb-wp-6 dk-max-w-2xl",children:404===a?(0,ua.__)("The page you were looking for does not exist or has been moved.","dokan-kits"):(0,ua.__)("We encountered an error while trying to process your request.","dokan-kits")}),(0,br.jsx)("div",{className:"dk-max-w-2xl dk-w-full dk-text-left dk-mb-wp-8",children:(0,br.jsx)("div",{className:"dk-p-wp-5 dk-bg-red-50 dk-rounded-lg dk-border dk-border-red-200 dk-shadow-sm",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-start",children:[(0,br.jsx)("span",{className:"dashicons dashicons-info dk-mr-wp-3 dk-text-xl dk-text-red-600 dk-mt-wp-1"}),(0,br.jsxs)("div",{children:[(0,br.jsx)("h2",{className:"dk-font-semibold dk-mb-wp-2 dk-text-red-800 dk-flex dk-items-center",children:(0,ua.__)("Error Details","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-red-700",children:s})]})]})})}),(0,br.jsx)("div",{className:"dk-max-w-2xl dk-w-full dk-text-left dk-mb-wp-8",children:(0,br.jsx)("div",{className:"dk-p-wp-5 dk-bg-blue-50 dk-rounded-lg dk-border dk-border-blue-200 dk-shadow-sm",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-start",children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-tools dk-mr-wp-3 dk-text-xl dk-text-blue-600 dk-mt-wp-1"}),(0,br.jsxs)("div",{children:[(0,br.jsx)("h2",{className:"dk-font-semibold dk-mb-wp-2 dk-text-blue-800 dk-flex dk-items-center",children:(0,ua.__)("Troubleshooting Steps","dokan-kits")}),(0,br.jsx)("ul",{className:"dk-list-disc dk-pl-wp-5 dk-space-y-wp-1 dk-text-blue-700",children:(()=>{const e=[(0,ua.__)("Refresh the page and try again.","dokan-kits"),(0,ua.__)("Clear your browser cache and cookies.","dokan-kits"),(0,ua.__)("Try accessing the page in a private/incognito window.","dokan-kits")];return 404===a?e.push((0,ua.__)("Check if the URL is correct.","dokan-kits")):403===a?e.push((0,ua.__)("Verify you have the necessary permissions.","dokan-kits")):a>=500&&e.push((0,ua.__)("Contact your server administrator to check server logs.","dokan-kits")),e})().map(((e,t)=>(0,br.jsx)("li",{children:e},t)))})]})]})})}),(0,br.jsxs)("div",{className:"dk-flex dk-flex-wrap dk-items-center dk-justify-center dk-gap-wp-4 dk-mb-wp-8",children:[(0,br.jsxs)(sa,{to:"/",className:"dk-admin-button dk-bg-primary-600 hover:dk-bg-primary-700 dk-text-white dk-flex dk-items-center dk-px-wp-6 dk-py-wp-3 dk-gap-wp-2 dk-rounded dk-transition dk-duration-200",children:[(0,br.jsx)("span",{className:"dashicons dashicons-dashboard"}),(0,ua.__)("Back to Dashboard","dokan-kits")]}),(0,br.jsxs)(r.Button,{variant:"secondary",onClick:()=>window.location.reload(),className:"dk-admin-button dk-admin-button-secondary dk-flex dk-items-center dk-gap-wp-2 dk-px-wp-6 dk-py-wp-3",children:[(0,br.jsx)("span",{className:"dashicons dashicons-image-rotate"}),(0,ua.__)("Reload Page","dokan-kits")]})]}),(0,br.jsx)("div",{className:"dk-mt-wp-4 dk-max-w-2xl dk-w-full",children:(0,br.jsx)("div",{className:"dk-p-wp-5 dk-bg-yellow-50 dk-rounded-lg dk-border dk-border-yellow-200 dk-shadow-sm",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-start",children:[(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-mr-wp-4",children:(0,br.jsx)("span",{className:"dashicons dashicons-sos dk-text-2xl dk-text-yellow-600"})}),(0,br.jsxs)("div",{className:"dk-text-left",children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-semibold dk-text-yellow-800 dk-mb-wp-2",children:(0,ua.__)("Need Help?","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-yellow-700 dk-mb-wp-3",children:(0,ua.__)("If this problem persists, please contact our support team with the error details shown above.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-flex dk-gap-wp-4",children:[(0,br.jsxs)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-warning dk-flex dk-items-center dk-gap-wp-2",children:[(0,br.jsx)("span",{className:"dashicons dashicons-editor-help"}),(0,ua.__)("Get Support","dokan-kits")]}),(0,br.jsxs)("a",{href:"https://wordpress.org/plugins/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-secondary dk-flex dk-items-center dk-gap-wp-2",children:[(0,br.jsx)("span",{className:"dashicons dashicons-book"}),(0,ua.__)("View Documentation","dokan-kits")]})]})]})]})})}),!1]})},wr=({message:e=(0,ua.__)("Loading…","dokan-kits"),className:t})=>(0,br.jsxs)("div",{className:gr("dk-flex dk-flex-col dk-items-center dk-justify-center dk-p-wp-8 dk-min-h-[300px]",t),children:[(0,br.jsx)("div",{className:"dk-inline-block dk-animate-spin dk-h-10 dk-w-10 dk-text-primary-600 dk-mb-wp-4",children:(0,br.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,br.jsx)("circle",{className:"dk-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,br.jsx)("path",{className:"dk-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),(0,br.jsx)("p",{className:"dk-text-gray-600 dk-text-center dk-animate-pulse",children:e})]});let vr={data:""},jr=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||vr,Nr=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,_r=/\/\*[^]*?\*\/|  +/g,Cr=/\n+/g,Sr=(e,t)=>{let a="",r="",s="";for(let n in e){let o=e[n];"@"==n[0]?"i"==n[1]?a=n+" "+o+";":r+="f"==n[1]?Sr(o,n):n+"{"+Sr(o,"k"==n[1]?"":t)+"}":"object"==typeof o?r+=Sr(o,t?t.replace(/([^,])+/g,(e=>n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):n):null!=o&&(n=/^--/.test(n)?n:n.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Sr.p?Sr.p(n,o):n+":"+o+";")}return a+(t&&s?t+"{"+s+"}":s)+r},Er={},Rr=e=>{if("object"==typeof e){let t="";for(let a in e)t+=a+Rr(e[a]);return t}return e},Dr=(e,t,a,r,s)=>{let n=Rr(e),o=Er[n]||(Er[n]=(e=>{let t=0,a=11;for(;t<e.length;)a=101*a+e.charCodeAt(t++)>>>0;return"go"+a})(n));if(!Er[o]){let t=n!==e?e:(e=>{let t,a,r=[{}];for(;t=Nr.exec(e.replace(_r,""));)t[4]?r.shift():t[3]?(a=t[3].replace(Cr," ").trim(),r.unshift(r[0][a]=r[0][a]||{})):r[0][t[1]]=t[2].replace(Cr," ").trim();return r[0]})(e);Er[o]=Sr(s?{["@keyframes "+o]:t}:t,a?"":"."+o)}let i=a&&Er.g?Er.g:null;return a&&(Er.g=Er[o]),((e,t,a,r)=>{r?t.data=t.data.replace(r,e):-1===t.data.indexOf(e)&&(t.data=a?e+t.data:t.data+e)})(Er[o],t,r,i),o};function Pr(e){let t=this||{},a=e.call?e(t.p):e;return Dr(a.unshift?a.raw?((e,t,a)=>e.reduce(((e,r,s)=>{let n=t[s];if(n&&n.call){let e=n(a),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;n=t?"."+t:e&&"object"==typeof e?e.props?"":Sr(e,""):!1===e?"":e}return e+r+(null==n?"":n)}),""))(a,[].slice.call(arguments,1),t.p):a.reduce(((e,a)=>Object.assign(e,a&&a.call?a(t.p):a)),{}):a,jr(t.target),t.g,t.o,t.k)}Pr.bind({g:1});let Tr,Mr,Lr,$r=Pr.bind({k:1});function zr(e,t){let a=this||{};return function(){let r=arguments;function s(n,o){let i=Object.assign({},n),d=i.className||s.className;a.p=Object.assign({theme:Mr&&Mr()},i),a.o=/ *go\d+/.test(d),i.className=Pr.apply(a,r)+(d?" "+d:""),t&&(i.ref=o);let l=e;return e[0]&&(l=i.as||e,delete i.as),Lr&&l[0]&&Lr(i),Tr(l,i)}return t?t(s):s}}var Ar=(e,t)=>(e=>"function"==typeof e)(e)?e(t):e,Or=(()=>{let e=0;return()=>(++e).toString()})(),Fr=(()=>{let e;return()=>{if(void 0===e&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Ir=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,20)};case 1:return{...e,toasts:e.toasts.map((e=>e.id===t.toast.id?{...e,...t.toast}:e))};case 2:let{toast:a}=t;return Ir(e,{type:e.toasts.find((e=>e.id===a.id))?1:0,toast:a});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map((e=>e.id===r||void 0===r?{...e,dismissed:!0,visible:!1}:e))};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter((e=>e.id!==t.toastId))};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map((e=>({...e,pauseDuration:e.pauseDuration+s})))}}},Br=[],Ur={toasts:[],pausedAt:void 0},Hr=e=>{Ur=Ir(Ur,e),Br.forEach((e=>{e(Ur)}))},Wr={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Vr=e=>(t,a)=>{let r=((e,t="blank",a)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...a,id:(null==a?void 0:a.id)||Or()}))(t,e,a);return Hr({type:2,toast:r}),r.id},qr=(e,t)=>Vr("blank")(e,t);qr.error=Vr("error"),qr.success=Vr("success"),qr.loading=Vr("loading"),qr.custom=Vr("custom"),qr.dismiss=e=>{Hr({type:3,toastId:e})},qr.remove=e=>Hr({type:4,toastId:e}),qr.promise=(e,t,a)=>{let r=qr.loading(t.loading,{...a,...null==a?void 0:a.loading});return"function"==typeof e&&(e=e()),e.then((e=>{let s=t.success?Ar(t.success,e):void 0;return s?qr.success(s,{id:r,...a,...null==a?void 0:a.success}):qr.dismiss(r),e})).catch((e=>{let s=t.error?Ar(t.error,e):void 0;s?qr.error(s,{id:r,...a,...null==a?void 0:a.error}):qr.dismiss(r)})),e};var Kr=(e,t)=>{Hr({type:1,toast:{id:e,height:t}})},Gr=()=>{Hr({type:5,time:Date.now()})},Yr=new Map,Jr=$r`
    22from {
    33  transform: scale(0) rotate(45deg);
     
    169169    pointer-events: auto;
    170170  }
    171 `,gs=({reverseOrder:e,position:t="top-center",toastOptions:a,gutter:r,children:s,containerStyle:n,containerClassName:o})=>{let{toasts:d,handlers:l}=(e=>{let{toasts:t,pausedAt:a}=((e={})=>{let[t,a]=(0,i.useState)(Ur),r=(0,i.useRef)(Ur);(0,i.useEffect)((()=>(r.current!==Ur&&a(Ur),Br.push(a),()=>{let e=Br.indexOf(a);e>-1&&Br.splice(e,1)})),[]);let s=t.toasts.map((t=>{var a,r,s;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(a=e[t.type])?void 0:a.removeDelay)||(null==e?void 0:e.removeDelay),duration:t.duration||(null==(r=e[t.type])?void 0:r.duration)||(null==e?void 0:e.duration)||Wr[t.type],style:{...e.style,...null==(s=e[t.type])?void 0:s.style,...t.style}}}));return{...t,toasts:s}})(e);(0,i.useEffect)((()=>{if(a)return;let e=Date.now(),r=t.map((t=>{if(t.duration===1/0)return;let a=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(a<0))return setTimeout((()=>Vr.dismiss(t.id)),a);t.visible&&Vr.dismiss(t.id)}));return()=>{r.forEach((e=>e&&clearTimeout(e)))}}),[t,a]);let r=(0,i.useCallback)((()=>{a&&Hr({type:6,time:Date.now()})}),[a]),s=(0,i.useCallback)(((e,a)=>{let{reverseOrder:r=!1,gutter:s=8,defaultPosition:n}=a||{},o=t.filter((t=>(t.position||n)===(e.position||n)&&t.height)),i=o.findIndex((t=>t.id===e.id)),d=o.filter(((e,t)=>t<i&&e.visible)).length;return o.filter((e=>e.visible)).slice(...r?[d+1]:[0,d]).reduce(((e,t)=>e+(t.height||0)+s),0)}),[t]);return(0,i.useEffect)((()=>{t.forEach((e=>{if(e.dismissed)((e,t=1e3)=>{if(Yr.has(e))return;let a=setTimeout((()=>{Yr.delete(e),Hr({type:4,toastId:e})}),t);Yr.set(e,a)})(e.id,e.removeDelay);else{let t=Yr.get(e.id);t&&(clearTimeout(t),Yr.delete(e.id))}}))}),[t]),{toasts:t,handlers:{updateHeight:Kr,startPause:Gr,endPause:r,calculateOffset:s}}})(a);return i.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...n},className:o,onMouseEnter:l.startPause,onMouseLeave:l.endPause},d.map((a=>{let n=a.position||t,o=((e,t)=>{let a=e.includes("top"),r=a?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Fr()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(a?1:-1)}px)`,...r,...s}})(n,l.calculateOffset(a,{reverseOrder:e,gutter:r,defaultPosition:t}));return i.createElement(ps,{id:a.id,key:a.id,onHeightUpdate:l.updateHeight,className:a.visible?fs:"",style:o},"custom"===a.type?Ar(a.message,a):s?s(a):i.createElement(hs,{toast:a,position:n}))})))},xs=Vr;const bs=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,((e,t,a)=>a?a.toUpperCase():t.toLowerCase())))(e);return t.charAt(0).toUpperCase()+t.slice(1)},ys=(...e)=>e.filter(((e,t,a)=>Boolean(e)&&""!==e.trim()&&a.indexOf(e)===t)).join(" ").trim(),ws=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var vs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const js=(0,i.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:s="",children:n,iconNode:o,...d},l)=>(0,i.createElement)("svg",{ref:l,...vs,width:t,height:t,stroke:e,strokeWidth:r?24*Number(a)/Number(t):a,className:ys("lucide",s),...!n&&!ws(d)&&{"aria-hidden":"true"},...d},[...o.map((([e,t])=>(0,i.createElement)(e,t))),...Array.isArray(n)?n:[n]]))),Ns=(e,t)=>{const a=(0,i.forwardRef)((({className:a,...r},s)=>{return(0,i.createElement)(js,{ref:s,iconNode:t,className:ys(`lucide-${n=bs(e),n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...r});var n}));return a.displayName=bs(e),a},_s=Ns("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Cs=Ns("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Ss=Ns("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Es=Ns("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Rs=Ns("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ds=({t:e,message:t,type:a,onClose:r,showCloseButton:s=!0})=>{const n={success:(0,br.jsx)(_s,{className:"dk-w-wp-5 dk-h-wp-5 dk-text-primary-600"}),error:(0,br.jsx)(Cs,{className:"dk-w-wp-5 dk-h-wp-5 dk-text-red-500"}),warning:(0,br.jsx)(Ss,{className:"dk-w-wp-5 dk-h-wp-5 dk-text-yellow-500"}),info:(0,br.jsx)(Es,{className:"dk-w-wp-5 dk-h-wp-5 dk-text-blue-500"})};return(0,br.jsxs)("div",{className:xr("dk-flex dk-items-start dk-p-wp-4 dk-rounded-md dk-border dk-shadow-wp-card dk-min-w-[320px] dk-max-w-md","dk-transform dk-transition-all dk-duration-300 dk-ease-in-out",{success:"dk-border-primary-200 dk-bg-primary-50",error:"dk-border-red-200 dk-bg-red-50",warning:"dk-border-yellow-200 dk-bg-yellow-50",info:"dk-border-blue-200 dk-bg-blue-50"}[a],e.visible?"dk-animate-in dk-slide-in-from-top-2 dk-fade-in":"dk-animate-out dk-slide-out-to-top-2 dk-fade-out"),children:[(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-mr-wp-3",children:n[a]}),(0,br.jsx)("div",{className:"dk-flex-1 dk-min-w-0",children:(0,br.jsx)("div",{className:xr("dk-text-admin-sm dk-font-medium dk-leading-5",{success:"dk-text-primary-800",error:"dk-text-red-800",warning:"dk-text-yellow-800",info:"dk-text-blue-800"}[a]),children:t})}),s&&(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-ml-wp-4",children:(0,br.jsx)("button",{type:"button",className:xr("dk-inline-flex dk-rounded-md dk-p-1.5 dk-transition-colors dk-focus:outline-none dk-focus:ring-2 dk-focus:ring-offset-2",{success:"dk-text-primary-400 hover:dk-text-primary-500 dk-focus:ring-primary-600",error:"dk-text-red-400 hover:dk-text-red-500 dk-focus:ring-red-600",warning:"dk-text-yellow-400 hover:dk-text-yellow-500 dk-focus:ring-yellow-600",info:"dk-text-blue-400 hover:dk-text-blue-500 dk-focus:ring-blue-600"}[a]),onClick:r,"aria-label":(0,ua.__)("Dismiss notification","dokan-kits"),children:(0,br.jsx)(Rs,{className:"dk-w-wp-4 dk-h-wp-4"})})})]})},Ps="success",Ts="error",Ms=(0,o.createContext)({notices:[],addNotice:()=>{},removeNotice:()=>{},clearNotices:()=>{}}),Ls=({children:e})=>{const[t,a]=(0,o.useState)([]),r=(0,o.useCallback)(((e,t="info",r={})=>{const s=`notice-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,{isDismissible:n=!0,duration:o=5e3,position:i="top-right"}=r,d={id:s,message:e,type:t,isDismissible:n,duration:o,position:i,timestamp:Date.now()};return a((a=>{const r=a.find((a=>a.message===e&&a.type===t));return r?a:[...a,d]})),s}),[]),s={notices:t,addNotice:r,removeNotice:(0,o.useCallback)((e=>{a((t=>t.filter((t=>t.id!==e))))}),[]),clearNotices:(0,o.useCallback)((()=>{a([])}),[])};return(0,br.jsx)(Ms.Provider,{value:s,children:e})},$s=()=>{const e=(0,o.useContext)(Ms);if(void 0===e)throw new Error("useNotices must be used within a NoticesProvider");return e},zs=()=>{const{notices:e,removeNotice:t}=$s(),a=(0,o.useRef)(new Set);return(0,o.useEffect)((()=>{e.forEach((e=>{if(a.current.has(e.id))return;a.current.add(e.id);let r=e.duration||5e3;"error"===e.type&&(r=e.duration||8e3),e.isDismissible||(r=1/0),xs.custom((r=>(0,br.jsx)(Ds,{t:r,message:e.message,type:e.type,onClose:()=>{xs.dismiss(r.id),t(e.id),a.current.delete(e.id)}})),{id:e.id,duration:r,position:e.position||"top-right"}),e.isDismissible&&r!==1/0&&setTimeout((()=>{t(e.id),a.current.delete(e.id)}),r)}));const r=new Set(e.map((e=>e.id)));for(const e of a.current)r.has(e)||a.current.delete(e)}),[e,t]),(0,o.useEffect)((()=>()=>{a.current.clear()}),[]),(0,br.jsx)(gs,{position:"top-right",gutter:12,containerClassName:"dk-toast-container",containerStyle:{top:"var(--wp-admin--admin-bar--height, 46px)"},toastOptions:{className:"dk-toast",duration:5e3,style:{background:"transparent",boxShadow:"none",padding:0}}})},As=a.p+"images/dokan-kits-logo.png",Os=()=>{const e=dt(),t="loading"===yt("useNavigation").navigation.state,a=window.Dokan_Kits||{};(0,o.useEffect)((()=>{const t={"/":(0,ua.__)("Dashboard","dokan-kits"),"/features":(0,ua.__)("Features","dokan-kits"),"/about":(0,ua.__)("About","dokan-kits"),"/tools":(0,ua.__)("Tools","dokan-kits"),"/tailwind-demo":(0,ua.__)("Tailwind Merge Demo","dokan-kits")}[e.pathname];if(document.title=(0,ua.sprintf)(/* translators: %s: Page title */ /* translators: %s: Page title */
    172 (0,ua.__)("%s - Dokan Kits","dokan-kits"),null!=t?t:(0,ua.__)("Dashboard","dokan-kits")),"undefined"!=typeof document){const t=document.querySelectorAll("#toplevel_page_dokan-kits .wp-submenu li");t.forEach((e=>{e.classList.remove("current")}));const a={"/":1,"/features":2,"/about":3,"/tools":4,"/tailwind-demo":5}[e.pathname];void 0!==a&&t[a]&&t[a].classList.add("current")}}),[e]);const r=({isActive:e})=>xr("dk-inline-flex dk-items-center dk-px-wp-1 dk-py-wp-4 dk-text-sm dk-font-medium dk-border-b-2 !dk-shadow-none !dk-outline-none",e?"dk-border-primary-500 dk-text-primary-600":"dk-border-transparent dk-text-gray-500 hover:dk-text-gray-700 hover:dk-border-gray-300");return(0,br.jsxs)("div",{className:"dokan-kits-app-wrapper",children:[(0,br.jsx)("div",{className:"dokan-kits-app-header dk-bg-white dk-border-b dk-border-gray-200 dk-mb-wp-6",children:(0,br.jsxs)("div",{className:"dk-container dk-mx-auto dk-px-wp-4",children:[(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-justify-between dk-pt-wp-4",children:[(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)("img",{src:As,alt:"Dokan Kits",className:"dk-h-20 dk-w-auto dk-mr-wp-3"}),(0,br.jsx)("h1",{className:"dk-text-xl dk-font-medium dk-text-gray-900",children:(0,ua.__)("Dokan Kits","dokan-kits")})]}),(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-space-x-wp-2",children:[(0,br.jsx)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/#new-topic-0",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-secondary dk-text-sm",children:(0,ua.__)("Support","dokan-kits")}),(0,br.jsx)("a",{href:"https://wordpress.org/plugins/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-secondary dk-text-sm",children:(0,ua.__)("Documentation","dokan-kits")})]})]}),(0,br.jsxs)("nav",{className:"dk-flex dk-space-x-wp-6 dk--mb-px",children:[(0,br.jsxs)(na,{to:"/",end:!0,className:r,children:[(0,br.jsx)("span",{className:"dashicons dashicons-dashboard dk-mr-wp-2"}),(0,ua.__)("Dashboard","dokan-kits")]}),(0,br.jsxs)(na,{to:"/features",className:r,children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-settings dk-mr-wp-2"}),(0,ua.__)("Features","dokan-kits")]}),(0,br.jsxs)(na,{to:"/about",className:r,children:[(0,br.jsx)("span",{className:"dashicons dashicons-info dk-mr-wp-2"}),(0,ua.__)("About","dokan-kits")]}),(0,br.jsxs)(na,{to:"/tools",className:r,children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-tools dk-mr-wp-2"}),(0,ua.__)("Tools","dokan-kits")]})]})]})}),(0,br.jsxs)("div",{className:"dokan-kits-app-content dk-container dk-mx-auto dk-px-wp-4 dk-pb-wp-8",children:[(0,br.jsx)(zs,{}),(0,br.jsx)("div",{className:"dk-route-transition",children:t?(0,br.jsx)(wr,{message:(0,ua.__)("Loading content…","dokan-kits")}):(0,br.jsx)(Tt,{})})]}),(0,br.jsx)("div",{className:"dokan-kits-app-footer dk-mt-wp-12 dk-py-wp-6 dk-border-t dk-border-gray-200 dk-text-center dk-text-sm dk-text-gray-500",children:(0,br.jsxs)("p",{children:[(0,ua.__)("Dokan Kits","dokan-kits")," ",a.version||"3.0.0"," | ",(0,ua.__)("Made with","dokan-kits")," ❤️ ",(0,ua.__)("by","dokan-kits"),(0,br.jsx)("a",{href:"https://profiles.wordpress.org/wpintegrity/",target:"_blank",rel:"noopener noreferrer",className:"dk-text-primary-600 hover:dk-text-primary-800 dk-ml-wp-1",children:"WPIntegrity"})]})})]})},Fs=()=>{const e=({className:e})=>(0,br.jsx)("div",{className:`dk-animate-pulse dk-bg-gray-200 dk-rounded ${e}`}),t=()=>(0,br.jsx)(r.Card,{className:"dk-mb-wp-6",children:(0,br.jsxs)(r.CardBody,{className:"dk-text-center dk-py-wp-8",children:[(0,br.jsx)(e,{className:"dk-mx-auto dk-h-24 dk-w-24 dk-mb-wp-4"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-10 dk-w-1/2 dk-mb-wp-3"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-5 dk-w-3/4 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-5 dk-w-2/3 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-5 dk-w-1/2 dk-mb-wp-6"}),(0,br.jsxs)("div",{className:"dk-flex dk-flex-wrap dk-justify-center dk-gap-wp-4",children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-28"}),(0,br.jsx)(e,{className:"dk-h-8 dk-w-36"}),(0,br.jsx)(e,{className:"dk-h-8 dk-w-32"})]})]})}),a=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-1/4 dk-mb-wp-4"}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6 dk-mb-wp-8",children:Array(2).fill().map(((t,a)=>(0,br.jsxs)(r.Card,{children:[(0,br.jsx)(r.CardBody,{className:"dk-p-6",children:(0,br.jsxs)("div",{className:"dk-flex dk-flex-col md:dk-flex-row dk-items-start",children:[(0,br.jsx)(e,{className:"dk-h-16 dk-w-16 dk-mb-wp-4 md:dk-mb-0 md:dk-mr-wp-5"}),(0,br.jsxs)("div",{className:"dk-flex-grow dk-w-full",children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-3/4 dk-mb-wp-3"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4"})]})]})}),(0,br.jsx)(r.CardFooter,{className:"dk-p-5 dk-bg-gray-50 dk-border-t dk-border-gray-200 dk-flex dk-justify-end",children:(0,br.jsx)(e,{className:"dk-h-10 dk-w-32"})})]},a)))})]}),s=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-1/4 dk-mb-wp-4"}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6 dk-mb-wp-8",children:Array(4).fill().map(((t,a)=>(0,br.jsxs)(r.Card,{children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsx)(e,{className:"dk-h-6 dk-w-1/2"})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4 dk-mb-wp-4"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-36"})]})]},a)))})]}),n=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-1/4 dk-mb-wp-4"}),(0,br.jsxs)(r.Card,{children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsx)(e,{className:"dk-h-6 dk-w-1/4"})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("div",{className:"dk-space-y-wp-4",children:Array(3).fill().map(((t,a)=>(0,br.jsxs)("div",{className:"dk-mb-wp-6",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-1/3 dk-mb-wp-3"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4"})]},a)))}),(0,br.jsx)("div",{className:"dk-mt-wp-4 dk-pt-wp-4 dk-border-t dk-border-gray-200",children:(0,br.jsx)(e,{className:"dk-h-6 dk-w-1/4"})})]})]})]});return(0,br.jsxs)("div",{className:"dokan-kits-about-page-skeleton dk-p-6",children:[(0,br.jsx)(t,{}),(0,br.jsx)(a,{}),(0,br.jsx)(s,{}),(0,br.jsx)(n,{})]})},Is=()=>{const[e,t]=(0,o.useState)(!0);if((0,o.useEffect)((()=>{const e=setTimeout((()=>{t(!1)}),300);return()=>clearTimeout(e)}),[]),e)return(0,br.jsx)(Fs,{});const a=[],s=[{title:(0,ua.__)("Vendor Product Video Gallery","dokan-kits"),description:(0,ua.__)("Allow vendors to upload product videos to showcase their products better in your Dokan marketplace. Support multiple video formats and customize playback options.","dokan-kits"),icon:"format-video",image:"https://wpintegrity.com/wp-content/uploads/2025/06/Dokan-Kits-Vendor-Product-Video-Gallery_big.png",status:(0,ua.__)("Live","dokan-kits"),url:"https://wpintegrity.com/dokan-kits-vendor-product-video-gallery/"},{title:(0,ua.__)("Vendor Product Image Upload Limit","dokan-kits"),description:(0,ua.__)("Control and limit product image uploads for vendors in your Dokan marketplace. Set image dimensions, file sizes, and maximum upload limits to maintain quality and performance.","dokan-kits"),icon:"format-gallery",image:"https://wpintegrity.com/wp-content/uploads/2025/06/Dokan-Kits-Vendor-Product-Image-Upload-Limit_big-1.png",status:(0,ua.__)("Live","dokan-kits"),url:"https://wpintegrity.com/dokan-kits-vendor-product-image-upload-limit/"},{title:(0,ua.__)("Vendor Product Bundles","dokan-kits"),description:(0,ua.__)("Allow vendors to add and sell bundle products from their frontend vendor dashboard.","dokan-kits"),icon:"format-gallery",image:"https://wpintegrity.com/wp-content/uploads/2025/06/dokan-product-bundle@2x-768x593-1-300x295.png",status:(0,ua.__)("Live","dokan-kits"),url:"https://wpintegrity.com/products/dokan-kits-vendor-product-bundles/"}],n=[{title:(0,ua.__)("Support","dokan-kits"),description:(0,ua.__)("Need help with Dokan Kits? Visit our support forum to get assistance from our team and community.","dokan-kits"),buttonText:(0,ua.__)("Visit Support Forum","dokan-kits"),buttonUrl:"https://wordpress.org/support/plugin/dokan-kits/",icon:"sos"},{title:(0,ua.__)("Documentation","dokan-kits"),description:(0,ua.__)("Check our documentation for detailed guides, tutorials, and reference materials.","dokan-kits"),buttonText:(0,ua.__)("View Documentation","dokan-kits"),buttonUrl:"https://wordpress.org/plugins/dokan-kits/",icon:"book"},{title:(0,ua.__)("Feature Requests","dokan-kits"),description:(0,ua.__)("Have ideas to improve Dokan Kits? Submit your feature requests and help us make the plugin better.","dokan-kits"),buttonText:(0,ua.__)("Submit Request","dokan-kits"),buttonUrl:"https://github.com/wpintegrity/feedback/issues/new",icon:"lightbulb"},{title:(0,ua.__)("Video Tutorials","dokan-kits"),description:(0,ua.__)("Learn how to use Dokan Kits effectively with our step-by-step video tutorials and guides.","dokan-kits"),buttonText:(0,ua.__)("Watch Tutorials","dokan-kits"),buttonUrl:"#",icon:"video-alt3"}],i=[{version:"3.0.2",releaseDate:"June 30, 2025",changes:[(0,ua.__)("Improved UI for ErrorBoundary: centered Dashicon error icon, modern layout","dokan-kits"),(0,ua.__)("Refactored Not Found page for consistent, professional UI","dokan-kits"),(0,ua.__)("Updated Tools page with hero/title section and card-based layout","dokan-kits"),(0,ua.__)("Ensured Tools REST controller is registered and follows best practices","dokan-kits"),(0,ua.__)("General UI/UX consistency improvements across admin pages","dokan-kits")]},{version:"3.0.1",releaseDate:"June 24, 2025",changes:[(0,ua.__)("Fixed a critical issue with setting data store","dokan-kits")]},{version:"3.0.0",releaseDate:"June 23, 2025",changes:[(0,ua.__)("Complete plugin restructuring with modern architecture","dokan-kits"),(0,ua.__)("New React-based admin interface with Tailwind CSS","dokan-kits"),(0,ua.__)("Improved REST API for features management","dokan-kits"),(0,ua.__)("Enhanced extensibility with service providers","dokan-kits"),(0,ua.__)("Added React Router for better admin navigation","dokan-kits")]}],d=()=>(0,br.jsx)(r.Card,{className:"dk-mb-wp-6",children:(0,br.jsxs)(r.CardBody,{className:"dk-text-center dk-py-wp-8",children:[(0,br.jsx)("img",{src:As,alt:"Dokan Kits",className:"dk-mx-auto dk-h-24 dk-w-auto dk-mb-wp-4"}),(0,br.jsx)("h1",{className:"dk-text-3xl dk-font-bold dk-text-gray-900 dk-mb-wp-3",children:(0,ua.__)("Welcome to Dokan Kits","dokan-kits")}),(0,br.jsx)("p",{className:"dk-max-w-2xl dk-mx-auto dk-text-lg dk-text-gray-600 dk-mb-wp-3",children:(0,ua.__)("The essential toolkit to supercharge your Dokan-powered marketplace with advanced features for vendors and administrators.","dokan-kits")}),(0,br.jsx)("p",{className:"dk-max-w-2xl dk-mx-auto dk-text-base dk-text-gray-500",children:(0,ua.__)("Enhance product management, streamline vendor operations, and improve the overall marketplace experience with our carefully crafted extensions.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-mt-wp-6 dk-flex dk-flex-wrap dk-justify-center dk-gap-wp-4",children:[(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-primary-100 dk-text-primary-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-tag dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Version","dokan-kits"),": ",Dokan_Kits?.version||"3.0.0"]}),(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-green-100 dk-text-green-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-chart-area dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Active Installations","dokan-kits"),": 500+"]}),(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-blue-100 dk-text-blue-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-calendar dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Last Updated","dokan-kits"),": ",i[0]?.releaseDate||"June 23, 2025"]})]})]})}),l=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Advanced Features","dokan-kits")}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6 dk-mb-wp-8",children:s.map(((e,t)=>(0,br.jsxs)(r.Card,{className:"dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-lg",children:[(0,br.jsx)(r.CardBody,{className:"w-full dk-p-6",children:(0,br.jsxs)("div",{className:"dk-flex dk-flex-col md:dk-flex-row dk-items-start",children:[(0,br.jsx)("img",{src:e.image,alt:e.title,className:"dk-h-16 dk-w-16 dk-rounded-lg dk-mb-wp-4 md:dk-mb-0 md:dk-mr-wp-5"}),(0,br.jsxs)("div",{className:"dk-flex-grow",children:[(0,br.jsx)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-mb-wp-3",children:e.title}),(0,br.jsx)("p",{className:"dk-text-gray-600 dk-leading-relaxed",children:e.description})]})]})}),(0,br.jsx)(r.CardFooter,{className:"dk-p-5 dk-bg-gray-50 dk-border-t dk-border-gray-200 dk-flex dk-flex-col md:dk-flex-row md:dk-justify-end md:dk-items-center",children:(0,br.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button",children:[(0,ua.__)("Explore Now","dokan-kits"),(0,br.jsx)("span",{className:"dashicons dashicons-arrow-right-alt dk-ml-wp-1 dk-text-sm"})]})})]},t)))})]}),c=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Contributors","dokan-kits")}),(0,br.jsx)(r.Card,{className:"dk-mb-wp-8",children:(0,br.jsx)(r.CardBody,{children:(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 lg:dk-grid-cols-3 dk-gap-wp-6",children:a.map(((e,t)=>(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-space-x-wp-4",children:[(0,br.jsx)("img",{src:e.avatar,alt:e.name,className:"dk-h-14 dk-w-14 dk-rounded-full"}),(0,br.jsxs)("div",{children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-medium dk-text-gray-900",children:e.name}),(0,br.jsx)("p",{className:"dk-text-sm dk-text-gray-600 dk-mb-wp-1",children:e.role}),(0,br.jsx)("a",{href:e.profile,target:"_blank",rel:"noopener noreferrer",className:"dk-text-sm dk-text-primary-600 hover:dk-text-primary-800",children:(0,ua.__)("WordPress.org Profile","dokan-kits")})]})]},t)))})})})]}),u=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Getting Help","dokan-kits")}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6 dk-mb-wp-8",children:n.map(((e,t)=>(0,br.jsxs)(r.Card,{children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-lg dk-font-medium dk-text-gray-900 dk-flex dk-items-center",children:[e.icon&&(0,br.jsx)("span",{className:`dashicons dashicons-${e.icon} dk-mr-wp-2 dk-text-primary-600`}),e.title]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:e.description}),(0,br.jsx)("a",{href:e.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button",children:e.buttonText})]})]},t)))})]}),m=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Latest Changes","dokan-kits")}),(0,br.jsxs)(r.Card,{children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsx)("h3",{className:"dk-text-lg dk-font-medium dk-text-gray-900",children:(0,ua.__)("Changelog","dokan-kits")})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("div",{className:"dk-space-y-wp-4",children:i.map(((e,t)=>(0,br.jsxs)("div",{children:[(0,br.jsxs)("h4",{className:"dk-text-md dk-font-medium dk-text-gray-900",children:[(0,ua.__)("Version","dokan-kits")," ",e.version,(0,br.jsxs)("span",{className:"dk-ml-wp-2 dk-text-sm dk-text-gray-500",children:["- ",(0,ua.__)("Released on","dokan-kits")," ",e.releaseDate]})]}),(0,br.jsx)("ul",{className:"dk-list-disc dk-list-inside dk-text-gray-600 dk-mt-wp-2 dk-space-y-wp-1",children:e.changes.map(((e,t)=>(0,br.jsx)("li",{children:e},t)))})]},t)))}),(0,br.jsx)("div",{className:"dk-mt-wp-4 dk-pt-wp-4 dk-border-t dk-border-gray-200",children:(0,br.jsxs)("a",{href:"https://wordpress.org/plugins/dokan-kits/changelog/",target:"_blank",rel:"noopener noreferrer",className:"dk-text-primary-600 hover:dk-text-primary-800 dk-inline-flex dk-items-center",children:[(0,ua.__)("View full changelog","dokan-kits"),(0,br.jsx)("span",{className:"dashicons dashicons-arrow-right-alt dk-ml-wp-1 dk-text-sm"})]})})]})]})]});return(0,br.jsxs)("div",{className:"dokan-kits-about-page",children:[(0,br.jsx)(d,{}),(0,br.jsx)(l,{}),a.length>0&&(0,br.jsx)(c,{}),(0,br.jsx)(u,{}),(0,br.jsx)(m,{})]})},Bs=window.wp.apiFetch;var Us=a.n(Bs);const Hs=()=>{const e=({className:e})=>(0,br.jsx)("div",{className:`dk-animate-pulse dk-bg-gray-200 dk-rounded ${e}`}),t=()=>(0,br.jsx)("div",{className:"dk-admin-card dk-bg-gradient-to-r dk-from-primary-50 dk-to-secondary-50 dk-border-l-4 dk-border-primary-500 dk-mb-wp-6",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-mr-wp-4",children:(0,br.jsx)(e,{className:"dk-w-16 dk-h-16 dk-rounded"})}),(0,br.jsxs)("div",{className:"dk-flex-grow",children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-64 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-max-w-2xl"})]})]})}),a=()=>(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 dk-gap-wp-6",children:(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-3 dk-gap-wp-4",children:Array(3).fill().map(((t,a)=>(0,br.jsx)("div",{className:"dk-admin-card dk-border-t-4 dk-border-primary-500 dk-bg-primary-50",children:(0,br.jsxs)("div",{className:"dk-flex dk-justify-between dk-items-center",children:[(0,br.jsxs)("div",{children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-32 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-8 dk-w-16"})]}),(0,br.jsx)("div",{className:"dk-rounded-full dk-w-12 dk-h-12 dk-flex dk-items-center dk-justify-center dk-bg-white dk-border dk-border-gray-200",children:(0,br.jsx)(e,{className:"dk-w-6 dk-h-6 dk-rounded"})})]})},a)))})}),r=()=>(0,br.jsxs)("div",{className:"dk-admin-card",children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-48 dk-border-b dk-border-gray-200 dk-pb-wp-3 dk-mb-wp-4"}),(0,br.jsxs)("div",{children:[(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-4"}),(0,br.jsx)("div",{className:"dk-space-y-wp-3",children:Array(4).fill().map(((t,a)=>(0,br.jsx)(e,{className:"dk-h-9 dk-w-full dk-rounded-md"},a)))})]})]}),s=()=>(0,br.jsxs)("div",{className:"dk-admin-card",children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-64 dk-border-b dk-border-gray-200 dk-pb-wp-3 dk-mb-wp-4"}),(0,br.jsxs)("div",{children:[(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-4"}),(0,br.jsx)("ul",{className:"dk-space-y-wp-3",children:Array(3).fill().map(((t,a)=>(0,br.jsx)("li",{children:(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)("div",{className:"dk-w-8 dk-h-8 dk-rounded-full dk-bg-primary-100 dk-flex dk-items-center dk-justify-center dk-mr-wp-2",children:(0,br.jsx)(e,{className:"dk-w-4 dk-h-4 dk-rounded"})}),(0,br.jsx)(e,{className:"dk-h-5 dk-w-32"})]})},a)))}),(0,br.jsxs)("div",{className:"dk-mt-wp-6 dk-p-wp-3 dk-bg-yellow-50 dk-rounded-md dk-border dk-border-yellow-200",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-flex dk-items-center dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-3"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-full dk-rounded-md"})]})]})]}),n=()=>(0,br.jsx)("div",{className:"dk-fixed dk-inset-0 dk-bg-black dk-bg-opacity-50 dk-flex dk-items-center dk-justify-center",style:{display:"none"},children:(0,br.jsx)("div",{className:"dk-bg-white dk-rounded-lg dk-max-w-xl dk-w-full dk-mx-4",children:(0,br.jsxs)("div",{className:"dk-p-6",children:[(0,br.jsxs)("div",{className:"dk-flex dk-justify-between dk-items-center dk-mb-4",children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-48"}),(0,br.jsx)("div",{className:"dk-w-8 dk-h-8 dk-rounded-full dk-bg-gray-100 dk-flex dk-items-center dk-justify-center",children:(0,br.jsx)(e,{className:"dk-w-4 dk-h-4 dk-rounded"})})]}),(0,br.jsxs)("div",{className:"dk-mb-6",children:[(0,br.jsx)("div",{className:"dk-flex dk-justify-center dk-mb-4",children:(0,br.jsx)(e,{className:"dk-w-16 dk-h-16 dk-rounded-full"})}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-4"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-2"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-full dk-rounded dk-mb-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4"})]}),(0,br.jsxs)("div",{className:"dk-flex dk-justify-end dk-space-x-3",children:[(0,br.jsx)(e,{className:"dk-h-10 dk-w-24 dk-rounded"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-24 dk-rounded"})]})]})})});return(0,br.jsxs)("div",{className:"dokan-kits-admin-page dk-p-6",children:[(0,br.jsx)(t,{}),(0,br.jsx)(a,{}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 lg:dk-grid-cols-3 dk-gap-wp-6 dk-mt-wp-6",children:[(0,br.jsx)(r,{}),(0,br.jsx)("div",{className:"lg:dk-col-span-2",children:(0,br.jsx)(s,{})})]}),(0,br.jsx)(n,{})]})},Ws=()=>{const[e,t]=(0,o.useState)(!0),[a,s]=(0,o.useState)(!1),[n,i]=(0,o.useState)(!1),[d,l]=(0,o.useState)(!1),[c,u]=(0,o.useState)(!1),[m,k]=(0,o.useState)(!1),[h,p]=(0,o.useState)("all"),[f,g]=(0,o.useState)(null),x=(0,o.useRef)(null),[b,y]=(0,o.useState)({setting_names:[],active_features_count:0,total_settings_count:0,dokan_version:"",url:""}),{addNotice:w}=$s();if((0,o.useEffect)((()=>{(async()=>{try{t(!0);const e=await Us()({path:"/dokan-kits/v1/dashboard"});if(!e.success)throw new Error(e.message||(0,ua.__)("Invalid response from the server","dokan-kits"));const a=e.data?.statistics||{};y({active_features_count:a.active_features?.value||0,total_settings_count:a.total_features?.value||0,dokan_version:a.dokan_version?.value||(0,ua.__)("Not Detected","dokan-kits"),url:window.location.href,setting_names:e.data?.setting_names||[]})}catch(e){w(e.message||(0,ua.__)("Failed to fetch dashboard data","dokan-kits"),"error")}finally{t(!1)}})()}),[]),e)return(0,br.jsx)(Hs,{});const v=()=>{k(!1),g(null),x.current&&(x.current.value="")},j=()=>{u(!1)};return e?(0,br.jsx)(Hs,{}):(0,br.jsxs)("div",{className:"dokan-kits-admin-page",children:[(0,br.jsx)("div",{className:"dk-admin-card dk-bg-gradient-to-r dk-from-primary-50 dk-to-secondary-50 dk-border-l-4 dk-border-primary-500 dk-mb-wp-6",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-mr-wp-4",children:(0,br.jsx)("img",{src:As,alt:"Dokan Kits",className:"dk-w-16 dk-h-16"})}),(0,br.jsxs)("div",{children:[(0,br.jsx)("h2",{className:"dk-text-xl dk-font-medium dk-text-gray-900",children:(0,ua.__)("Welcome to Dokan Kits","dokan-kits")}),(0,br.jsxs)("p",{className:"dk-mt-1 dk-text-sm dk-text-gray-600",children:[(0,ua.__)("You are running version","dokan-kits")," ",(0,br.jsx)("span",{className:"dk-font-medium",children:Dokan_Kits.version}),".",(0,ua.__)("Enhance your Dokan-powered marketplace with powerful tools and customizations.","dokan-kits")]})]})]})}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 dk-gap-wp-6",children:[(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-3 dk-gap-wp-4",children:[(0,br.jsx)("div",{className:"dk-admin-card dk-border-t-4 dk-border-primary-500 dk-bg-primary-50",children:(0,br.jsxs)("div",{className:"dk-flex dk-justify-between dk-items-center",children:[(0,br.jsxs)("div",{children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-medium",children:(0,ua.__)("Total Features","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-2xl dk-font-bold dk-mt-1",children:b.total_settings_count})]}),(0,br.jsx)("div",{className:"dk-rounded-full dk-w-12 dk-h-12 dk-flex dk-items-center dk-justify-center dk-bg-white dk-border dk-border-gray-200",children:(0,br.jsx)("span",{className:"dashicons dashicons-admin-plugins dk-text-primary-500"})})]})}),(0,br.jsx)("div",{className:"dk-admin-card dk-border-t-4 dk-border-secondary-500 dk-bg-secondary-50",children:(0,br.jsxs)("div",{className:"dk-flex dk-justify-between dk-items-center",children:[(0,br.jsxs)("div",{children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-medium",children:(0,ua.__)("Total Active Features","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-2xl dk-font-bold dk-mt-1",children:b.active_features_count})]}),(0,br.jsx)("div",{className:"dk-rounded-full dk-w-12 dk-h-12 dk-flex dk-items-center dk-justify-center dk-bg-white dk-border dk-border-gray-200",children:(0,br.jsx)("span",{className:"dashicons dashicons-admin-generic dk-text-secondary-500"})})]})}),(0,br.jsx)("div",{className:"dk-admin-card dk-border-t-4 dk-border-green-500 dk-bg-green-50",children:(0,br.jsxs)("div",{className:"dk-flex dk-justify-between dk-items-center",children:[(0,br.jsxs)("div",{children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-medium",children:(0,ua.__)("Dokan Version","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-2xl dk-font-bold dk-mt-1",children:b.dokan_version})]}),(0,br.jsx)("div",{className:"dk-rounded-full dk-w-12 dk-h-12 dk-flex dk-items-center dk-justify-center dk-bg-white dk-border dk-border-gray-200",children:(0,br.jsx)("span",{className:"dashicons dashicons-admin-tools dk-text-green-500"})})]})})]}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 lg:dk-grid-cols-3 dk-gap-wp-6",children:[(0,br.jsxs)("div",{className:"dk-admin-card",children:[(0,br.jsx)("h2",{className:"dk-text-lg dk-font-medium dk-border-b dk-border-gray-200 dk-pb-wp-3 dk-mb-wp-4",children:(0,ua.__)("Settings Management","dokan-kits")}),(0,br.jsxs)("div",{children:[(0,br.jsx)("p",{className:"dk-text-sm dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Manage your Dokan Kits features with these options:","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-space-y-wp-3",children:[(0,br.jsxs)(r.Button,{href:`${Dokan_Kits.adminUrl}?page=dokan-kits#/features`,variant:"primary",className:"dk-admin-button dk-w-full dk-justify-center dk-h-9",children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-settings dk-mr-2"}),(0,ua.__)("Configure Settings","dokan-kits")]}),(0,br.jsxs)(r.Button,{variant:"secondary",onClick:async()=>{try{l(!0),w((0,ua.__)("Preparing export file…","dokan-kits"),"info");const e=await Us()({path:"/dokan-kits/v1/dashboard/export",method:"GET"});if(!e||!e.data)throw new Error((0,ua.__)("No data received from the server.","dokan-kits"));{const t=new Blob([JSON.stringify(e.data.data,null,2)],{type:"application/json"}),a=window.URL.createObjectURL(t),r=document.createElement("a");r.href=a;const s=(new Date).toISOString().split("T")[0];r.download=`dokan-kits-settings-${s}.json`,document.body.appendChild(r),r.click(),window.URL.revokeObjectURL(a),document.body.removeChild(r),w((0,ua.__)("Settings exported successfully.","dokan-kits"),"success")}}catch(e){w(e.message||(0,ua.__)("Failed to export settings. Please try again.","dokan-kits"),"error")}finally{l(!1)}},disabled:d,className:"dk-admin-button dk-admin-button-secondary dk-w-full dk-justify-center dk-h-9",children:[(0,br.jsx)("span",{className:"dashicons dashicons-download dk-mr-2"}),d?(0,ua.__)("Exporting…","dokan-kits"):(0,ua.__)("Export Settings","dokan-kits")]}),(0,br.jsxs)(r.Button,{variant:"secondary",onClick:()=>{k(!0)},className:"dk-admin-button dk-admin-button-secondary dk-w-full dk-justify-center dk-h-9",children:[(0,br.jsx)("span",{className:"dashicons dashicons-upload dk-mr-2"}),(0,ua.__)("Import Settings","dokan-kits")]}),(0,br.jsxs)(r.Button,{variant:"secondary",onClick:()=>{u(!0)},className:"dk-admin-button dk-admin-button-danger dk-w-full dk-justify-center dk-h-9",children:[(0,br.jsx)("span",{className:"dashicons dashicons-image-rotate dk-mr-2"}),(0,ua.__)("Reset Settings","dokan-kits")]})]})]})]}),(0,br.jsxs)("div",{className:"dk-admin-card",children:[(0,br.jsx)("h2",{className:"dk-text-lg dk-font-medium dk-border-b dk-border-gray-200 dk-pb-wp-3 dk-mb-wp-4",children:(0,ua.__)("Documentation & Support","dokan-kits")}),(0,br.jsxs)("div",{children:[(0,br.jsx)("p",{className:"dk-text-sm dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Need help with Dokan Kits? Check out these resources:","dokan-kits")}),(0,br.jsxs)("ul",{className:"dk-space-y-wp-3",children:[(0,br.jsx)("li",{children:(0,br.jsxs)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-flex dk-items-center dk-text-primary-600 dk-hover:text-primary-800",children:[(0,br.jsx)("span",{className:"dk-w-8 dk-h-8 dk-rounded-full dk-bg-primary-100 dk-flex dk-items-center dk-justify-center dk-mr-wp-2",children:(0,br.jsx)("span",{className:"dashicons dashicons-editor-help"})}),(0,ua.__)("Support Forum","dokan-kits")]})}),(0,br.jsx)("li",{children:(0,br.jsxs)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/reviews/#new-post",target:"_blank",rel:"noopener noreferrer",className:"dk-flex dk-items-center dk-text-primary-600 dk-hover:text-primary-800",children:[(0,br.jsx)("span",{className:"dk-w-8 dk-h-8 dk-rounded-full dk-bg-primary-100 dk-flex dk-items-center dk-justify-center dk-mr-wp-2",children:(0,br.jsx)("span",{className:"dashicons dashicons-admin-comments"})}),(0,ua.__)("Submit your feedback","dokan-kits")]})}),(0,br.jsx)("li",{children:(0,br.jsxs)("a",{href:"https://github.com/wpintegrity/feedback/issues",target:"_blank",rel:"noopener noreferrer",className:"dk-flex dk-items-center dk-text-primary-600 dk-hover:text-primary-800",children:[(0,br.jsx)("span",{className:"dk-w-8 dk-h-8 dk-rounded-full dk-bg-primary-100 dk-flex dk-items-center dk-justify-center dk-mr-wp-2",children:(0,br.jsx)("span",{className:"dashicons dashicons-feedback"})}),(0,ua.__)("Feature Idea or Bug Report","dokan-kits")]})})]}),(0,br.jsxs)("div",{className:"dk-mt-wp-6 dk-p-wp-3 dk-bg-yellow-50 dk-rounded-md dk-border dk-border-yellow-200",children:[(0,br.jsxs)("h3",{className:"dk-text-md dk-font-medium dk-text-yellow-800 dk-mb-wp-2",children:[(0,br.jsx)("span",{className:"dashicons dashicons-warning dk-mr-1"}),(0,ua.__)("Need Help?","dokan-kits")]}),(0,br.jsx)("p",{className:"dk-text-sm dk-text-yellow-700 dk-mb-wp-3",children:(0,ua.__)("If you need support or have a feature request, please visit our support forum.","dokan-kits")}),(0,br.jsx)(r.Button,{href:"https://wordpress.org/support/plugin/dokan-kits/#new-topic-0",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-warning dk-w-full dk-justify-center",children:(0,ua.__)("Get Support","dokan-kits")})]})]})]})]})]}),m&&(0,br.jsx)(r.Modal,{title:(0,ua.__)("Import Settings","dokan-kits"),onRequestClose:v,className:"dokan-kits-admin-page dokan-kits-admin-modal dokan-kits-import-modal",children:(0,br.jsxs)("div",{className:"dk-modal-content",children:[(0,br.jsxs)("div",{className:"dk-modal-header",children:[(0,br.jsx)("h2",{className:"dk-modal-title",children:(0,ua.__)("Import Settings","dokan-kits")}),(0,br.jsx)("button",{type:"button",className:"dk-modal-close",onClick:v,"aria-label":(0,ua.__)("Close modal","dokan-kits"),children:(0,br.jsx)("span",{className:"dashicons dashicons-no-alt"})})]}),(0,br.jsxs)("div",{className:"dk-modal-body",children:[(0,br.jsx)("div",{className:"dk-modal-icon dk-bg-primary-50 dk-text-primary-500",children:(0,br.jsx)("span",{className:"dashicons dashicons-upload"})}),(0,br.jsx)("p",{className:"dk-modal-description",children:(0,ua.__)("Select a Dokan Kits settings file to import. This will overwrite your current settings.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-form-field",children:[(0,br.jsx)("label",{htmlFor:"import-file",className:"dk-form-label",children:(0,ua.__)("Settings File","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-file-input-wrapper",children:[(0,br.jsx)("input",{type:"file",id:"import-file",ref:x,accept:".json",onChange:e=>{const t=e.target.files[0];g(t)},className:"dk-file-input"}),(0,br.jsx)("div",{className:"dk-file-input-info",children:f?(0,br.jsx)("span",{className:"dk-file-name",children:f.name}):(0,br.jsx)("span",{className:"dk-file-placeholder",children:(0,ua.__)("Choose a file or drag it here","dokan-kits")})})]}),(0,br.jsx)("p",{className:"dk-form-help",children:(0,ua.__)("Only .json files exported from Dokan Kits are supported.","dokan-kits")})]})]}),(0,br.jsxs)("div",{className:"dk-modal-footer",children:[(0,br.jsx)(r.Button,{variant:"secondary",onClick:v,className:"dk-admin-button dk-admin-button-secondary",children:(0,ua.__)("Cancel","dokan-kits")}),(0,br.jsx)(r.Button,{variant:"primary",isBusy:n,disabled:n||!f,onClick:async()=>{if(f)if(f.name.endsWith(".json"))try{i(!0);const e=new window.FileReader;e.onload=async e=>{try{const t=JSON.parse(e.target.result),a=await Us()({path:"/dokan-kits/v1/dashboard/import",method:"POST",data:{settings:t}});if(!a.success)throw new Error(a.message||(0,ua.__)("Failed to import settings.","dokan-kits"));{w(a.message||(0,ua.__)("Settings imported successfully.","dokan-kits"),"success");const e=await Us()({path:"/dokan-kits/v1/dashboard"});if(e.success){const t=e.data?.statistics||{};y({active_features_count:t.active_features?.value||0,total_settings_count:t.total_features?.value||0,dokan_version:t.dokan_version?.value||(0,ua.__)("Not Detected","dokan-kits"),url:window.location.href,setting_names:a.data?.setting_names||[]})}}i(!1),v()}catch(e){w(e.message||(0,ua.__)("Failed to import settings. Please try again.","dokan-kits"),"error"),i(!1)}},e.onerror=()=>{w((0,ua.__)("Failed to read the file. Please try again.","dokan-kits"),"error"),i(!1)},e.readAsText(f)}catch(e){w(e.message||(0,ua.__)("Failed to import settings. Please try again.","dokan-kits"),"error"),i(!1)}else w((0,ua.__)("Please select a valid JSON file.","dokan-kits"),"error");else w((0,ua.__)("Please select a file to import.","dokan-kits"),"error")},className:"dk-admin-button",children:n?(0,ua.__)("Importing…","dokan-kits"):(0,ua.__)("Import","dokan-kits")})]})]})}),c&&(0,br.jsx)(r.Modal,{title:(0,ua.__)("Reset Settings","dokan-kits"),onRequestClose:j,className:"dokan-kits-admin-page dokan-kits-admin-modal dokan-kits-reset-modal",children:(0,br.jsxs)("div",{className:"dk-modal-content",children:[(0,br.jsxs)("div",{className:"dk-modal-header",children:[(0,br.jsx)("h2",{className:"dk-modal-title",children:(0,ua.__)("Reset Settings","dokan-kits")}),(0,br.jsx)("button",{type:"button",className:"dk-modal-close",onClick:j,"aria-label":(0,ua.__)("Close modal","dokan-kits"),children:(0,br.jsx)("span",{className:"dashicons dashicons-no-alt"})})]}),(0,br.jsxs)("div",{className:"dk-modal-body",children:[(0,br.jsx)("div",{className:"dk-modal-icon dk-bg-red-50 dk-text-red-500",children:(0,br.jsx)("span",{className:"dashicons dashicons-warning"})}),(0,br.jsx)("p",{className:"dk-modal-description dk-text-red-700",children:(0,ua.__)("Are you sure you want to reset Dokan Kits settings? This action cannot be undone.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-form-field",children:[(0,br.jsx)("label",{htmlFor:"reset-scope",className:"dk-form-label",children:(0,ua.__)("Reset Scope","dokan-kits")}),(0,br.jsxs)("select",{id:"reset-scope",className:"dk-form-select",value:h,onChange:e=>p(e.target.value),children:[(0,br.jsx)("option",{value:"all",children:(0,ua.__)("All Settings","dokan-kits")}),b.setting_names&&b.setting_names.map(((e,t)=>(0,br.jsx)("option",{value:e.toLowerCase(),children:e},t)))]})]}),b.setting_names&&b.setting_names.length>0&&(0,br.jsxs)("div",{className:"dk-mt-wp-4",children:[(0,br.jsx)("p",{className:"dk-form-label dk-mb-wp-2",children:(0,ua.__)("Available Settings:","dokan-kits")}),(0,br.jsx)("div",{className:"dk-p-wp-3 dk-bg-gray-50 dk-rounded-md dk-border dk-border-gray-200 dk-max-h-60 dk-overflow-y-auto",children:(0,br.jsx)("div",{className:"dk-flex dk-flex-wrap dk-gap-wp-2",children:b.setting_names.map(((e,t)=>(0,br.jsx)("span",{className:"dk-text-sm dk-text-gray-700 dk-bg-white dk-px-wp-2 dk-py-wp-1 dk-rounded dk-border dk-border-gray-200",children:e},t)))})})]})]}),(0,br.jsxs)("div",{className:"dk-modal-footer",children:[(0,br.jsx)(r.Button,{variant:"secondary",onClick:j,className:"dk-admin-button dk-admin-button-secondary",children:(0,ua.__)("Cancel","dokan-kits")}),(0,br.jsx)(r.Button,{variant:"primary",isBusy:a,disabled:a,onClick:async()=>{try{s(!0);const e=await Us()({path:"/dokan-kits/v1/dashboard/reset",method:"POST",data:{scope:h,confirm:!0}});if(!e.success)throw new Error(e.message||(0,ua.__)("Failed to reset settings.","dokan-kits"));{w(e.message||(0,ua.__)("Settings reset successfully.","dokan-kits"),"success");const t=await Us()({path:"/dokan-kits/v1/dashboard"});if(t.success){const a=t.data?.statistics||{};y({setting_names:e.data?.setting_names||[],active_features_count:a.active_features?.value||0,total_settings_count:a.total_features?.value||0,dokan_version:a.dokan_version?.value||(0,ua.__)("Not Detected","dokan-kits"),url:window.location.href})}}}catch(e){w(e.message||(0,ua.__)("Failed to reset settings. Please try again.","dokan-kits"),"error")}finally{s(!1),j()}},className:"dk-admin-button dk-admin-button-danger",children:a?(0,ua.__)("Resetting…","dokan-kits"):(0,ua.__)("Reset","dokan-kits")})]})]})})]})},qs=window.wp.htmlEntities,Vs=(e,t,a="=")=>{switch("string"!=typeof t||"true"!==t&&"false"!==t||(t="true"===t),"string"!=typeof t||isNaN(Number(t))||("number"==typeof e||"string"==typeof e&&!isNaN(Number(e)))&&(e=Number(e),t=Number(t)),a){case"=":default:return e===t;case"!=":return e!==t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t;case"contains":return String(e).includes(String(t));case"not_contains":return!String(e).includes(String(t));case"is_empty":return""===e||null==e;case"is_not_empty":return""!==e&&null!=e}},Ks=(e,t)=>{if(!e?.dependencies?.length)return!0;for(const a of e.dependencies){if(a.key&&void 0===t[a.key])return!1;const e=t[a.key];if(!Vs(e,a.value,a.comparison))return!1}return!0},Gs=(e,t)=>{const a={};let r=!0;return((e,t)=>{const a=[];for(const r in e){const s=e[r];for(const e in s.sections){const n=s.sections[e];for(const s in n.fields){const o=n.fields[s];o.id||(o.id=s);const i=o.dependency_key||`${r}.${e}.${s}`;void 0===t[i]&&void 0!==o.value&&(t[i]=o.value),Ks(o,t)&&a.push({field:o,path:{tabId:r,sectionId:e,fieldId:s},key:i})}}}return a})(e,t).forEach((({field:e,key:s})=>{const n=((e,t)=>{if(!e)return{isValid:!1,message:"Field not found"};if(e.required&&(""===t||null==t))return{isValid:!1,message:e.title+" is required"};switch(e.variant){case"number":if(""===t&&!e.required)return{isValid:!0,message:""};const a=parseFloat(t);if(isNaN(a))return{isValid:!1,message:e.title+" must be a valid number"};if(void 0!==e.minimum&&a<e.minimum)return{isValid:!1,message:e.title+" must be at least "+e.minimum};if(void 0!==e.maximum&&a>e.maximum)return{isValid:!1,message:e.title+" must be at most "+e.maximum};break;case"select":if(e.options&&e.options.length>0&&!e.options.map((e=>e.value)).includes(t))return{isValid:!1,message:e.title+" has an invalid selection"}}return{isValid:!0,message:""}})(e,t[s]);n.isValid||(a[s]=n.message,r=!1)})),{isValid:r,errors:a}},Ys=e=>{const t={};for(const a in e){const r=e[a];for(const e in r.sections){const s=r.sections[e];for(const r in s.fields){const n=s.fields[r],o=n.dependency_key||`${a}.${e}.${r}`;let i=n.value;if(null==i&&(i=void 0!==n.default?n.default:""),["toggle","checkbox"].includes(n.variant))i=Boolean(!0===i||"true"===i||"1"===i||1===i);else if("number"===n.variant&&""!==i){const e=parseFloat(i);isNaN(e)||(i=e)}else"multiselect"!==n.variant||Array.isArray(i)||(i=i?[i]:[]);t[o]=i}}}return t},Js=window.wp.blockEditor,Xs={toggle:({field:e,value:t,onChange:a})=>{const s=!0===t||"true"===t||"1"===t||1===t;return(0,br.jsx)(r.ToggleControl,{label:e.label,help:e.description,checked:s,onChange:e=>{a(e)},disabled:e.disabled||e.readonly})},text:({field:e,value:t,onChange:a})=>{const s=e.inputType||"text",n=null!=t?String(t):"";return(0,br.jsx)(r.TextControl,{label:e.label,help:e.description,value:n,onChange:a,disabled:e.disabled,readOnly:e.readonly,placeholder:e.placeholder||"",type:s,required:e.required,size:e.size})},select:({field:e,value:t,onChange:a})=>{const s=e.options||[],n=Array.isArray(s)?s.map((e=>"object"==typeof e&&void 0!==e.value?e:{value:e,label:e})):Object.entries(s).map((([e,t])=>({value:e,label:t})));return(0,br.jsx)(r.SelectControl,{label:e.label,help:e.description,value:t||"",options:n,onChange:a,disabled:e.disabled,multiple:e.multiple})},multiselect:({field:e,value:t,onChange:a})=>{const s=e.options||[],n=Array.isArray(s)?s.map((e=>"object"==typeof e&&void 0!==e.value?e:{value:e,label:e})):Object.entries(s).map((([e,t])=>({value:e,label:t})));let o=[];Array.isArray(t)?o=t:t&&(o=[t]);const i=o.map((e=>n.find((t=>t.value===e))||{value:e,label:e}));return(0,br.jsx)(r.CustomSelectControlV2,{label:e.label,help:e.description,options:n,onChange:({selectedItems:e})=>a(e.map((e=>e.value))),value:i,isMultiple:!0,__next40pxDefaultSize:!0,className:"dokan-kits-multiselect-field",disabled:e.disabled})},number:({field:e,value:t,onChange:a})=>{const s=void 0!==e.min?e.min:e.minimum,n=void 0!==e.max?e.max:e.maximum,o=e.step||1,i=null!=t?String(t):"";return(0,br.jsx)(r.TextControl,{type:"number",label:e.label,help:e.description,value:i,onChange:e=>{if(""===e)return void a("");const t=parseFloat(e);if(isNaN(t))return;let r=t;void 0!==s&&t<s&&(r=s),void 0!==n&&t>n&&(r=n),a(r)},min:s,max:n,step:o,disabled:e.disabled,readOnly:e.readonly,placeholder:e.placeholder,className:e.hasError?"dk-has-error":""})},range:({field:e,value:t,onChange:a})=>{const s=void 0!==e.min?e.min:e.minimum,n=void 0!==e.max?e.max:e.maximum,o=e.step||1,i=null!=t?Number(t):"";return(0,br.jsx)(r.RangeControl,{label:e.label,help:e.description,value:i,onChange:a,min:s,max:n,step:o,allowReset:e.allowReset||!1,resetFallbackValue:e.default||s,disabled:e.disabled,withInputField:!0,showTooltip:!0,railColor:e.railColor||void 0,trackColor:e.trackColor||void 0,marks:e.marks||!1,className:e.hasError?"dk-has-error":""})},color:({field:e,value:t,onChange:a})=>{const s=(0,o.useId)(),n=`dokan-kits-color-${e.id||s}`;return(0,br.jsxs)("div",{className:"dokan-kits-color-field",children:[(0,br.jsx)("div",{className:"dokan-kits-color-field-label",children:e.label&&(0,br.jsx)("label",{htmlFor:n,children:e.label})}),(0,br.jsx)(r.ColorPicker,{id:n,color:t||e.default||"#000000",onChangeComplete:e=>{let t;t="string"==typeof e.hex?e.hex:`rgba(${e.rgb.r}, ${e.rgb.g}, ${e.rgb.b}, ${e.rgb.a})`,a(t)},disableAlpha:!0===e.disableAlpha}),e.description&&(0,br.jsx)("p",{className:"dokan-kits-color-field-description",children:e.description})]})},textarea:({field:e,value:t,onChange:a})=>(0,br.jsx)(r.TextareaControl,{label:e.label,help:e.description,value:t||"",onChange:a,disabled:e.disabled,placeholder:e.placeholder||"",rows:e.rows||4}),radio:({field:e,value:t,onChange:a})=>(0,br.jsx)(r.RadioControl,{label:e.label,help:e.description,selected:t||e.default||"",options:e.options||[],onChange:a,disabled:e.disabled}),checkbox:({field:e,value:t,onChange:a})=>{const s=!0===t||"true"===t||"1"===t||1===t;return(0,br.jsx)(r.CheckboxControl,{label:e.label,help:e.description,checked:s,onChange:e=>{a(e)},disabled:e.disabled||e.readonly})},media:({field:e,value:t,onChange:a})=>{const s=e.allowedTypes||["image"],n=(0,o.useId)(),i=`dokan-kits-media-${e.id||n}`,d=`${i}-label`;return(0,br.jsxs)("div",{className:"dokan-kits-media-field",children:[(0,br.jsx)("div",{className:"dokan-kits-media-field-label",children:e.label&&(0,br.jsx)("label",{id:d,htmlFor:i,children:e.label})}),(0,br.jsx)(Js.MediaUploadCheck,{children:(0,br.jsx)(Js.MediaUpload,{onSelect:e=>{a(e.id)},allowedTypes:s,value:t,render:({open:n})=>(0,br.jsx)("div",{className:"dokan-kits-media-upload",id:i,children:t?(0,br.jsxs)("div",{className:"dokan-kits-media-preview",children:[s.includes("image")&&(0,br.jsx)("img",{src:`${e.mediaBaseUrl||""}?id=${t}&size=medium`,alt:""}),(0,br.jsxs)("div",{className:"dokan-kits-media-actions",children:[(0,br.jsx)(r.Button,{onClick:n,variant:"secondary",isSmall:!0,children:(0,ua.__)("Replace","dokan-kits")}),(0,br.jsx)(r.Button,{onClick:()=>a(""),variant:"link",isDestructive:!0,isSmall:!0,children:(0,ua.__)("Remove","dokan-kits")})]})]}):(0,br.jsx)(r.Button,{onClick:n,variant:"secondary","aria-labelledby":d,children:e.buttonText||(0,ua.__)("Choose Media","dokan-kits")})})})}),e.description&&(0,br.jsx)("p",{className:"dokan-kits-media-field-description",children:e.description})]})},code:({field:e,value:t,onChange:a})=>{const r=(0,o.useId)(),s=`dokan-kits-code-${e.id||r}`;return(0,br.jsxs)("div",{className:"dokan-kits-code-field",children:[e.label&&(0,br.jsx)("label",{htmlFor:s,className:"dokan-kits-code-field-label",children:e.label}),(0,br.jsx)("div",{className:"dokan-kits-code-editor",children:(0,br.jsx)("textarea",{id:s,className:"dokan-kits-code-textarea",value:t||"",onChange:e=>a(e.target.value),disabled:e.disabled,placeholder:e.placeholder||"",rows:e.rows||10,spellCheck:"false"})}),e.description&&(0,br.jsx)("p",{className:"dokan-kits-code-field-description",children:e.description})]})},button:({field:e})=>{const[t,a]=(0,o.useState)(!1);return(0,br.jsx)(r.Button,{variant:(()=>{switch(e.button_type){case"primary":default:return"primary";case"secondary":return"secondary";case"tertiary":return"tertiary";case"link":return"link"}})(),size:e.button_size,className:xr("dk-admin-button dk-w-full dk-justify-center",e.classes),icon:e.icon||null,isDestructive:"destructive"===e.button_type,isBusy:t,disabled:e.disabled||t,onClick:()=>{if(!e.confirm_message||e.skipConfirmation||window.confirm(e.confirm_message))switch(e.action){case"ajax":e.ajax_action&&(a(!0),window.jQuery.ajax({url:window.ajaxurl,method:"POST",data:{action:e.ajax_action,nonce:window.Dokan_Kits?.nonce||"",button_id:e.id}}).done((e=>{e.success&&"function"==typeof window.Dokan_Kits?.notify?window.Dokan_Kits.notify({type:"success",message:e.data?.message||"Action completed successfully",isDismissible:!0}):e.success||"function"!=typeof window.Dokan_Kits?.notify||window.Dokan_Kits.notify({type:"error",message:e.data?.message||"Action failed",isDismissible:!0})})).fail((()=>{"function"==typeof window.Dokan_Kits?.notify&&window.Dokan_Kits.notify({type:"error",message:"Failed to complete the action",isDismissible:!0})})).always((()=>{a(!1)})));break;case"link":e.url&&(window.location.href=e.url);break;default:"function"==typeof e.onClick&&e.onClick()}},children:e.button_text||e.label||"Button"})}},Zs={text:"text",textarea:"textarea",select:"select",multiselect:"multiselect",number:"number",checkbox:"checkbox",radio:"radio",color:"color",media:"media",code:"code",toggle:"toggle",button:"button"},Qs=({field:e,value:t,onChange:a})=>{let r=e.type;e.variant&&(r=Zs[e.variant]||"text","number"===e.variant&&"range"===e.display&&(r="range"));const s=Xs[r];if(!s)return(0,br.jsx)("div",{className:"dokan-kits-field-error",children:(0,br.jsxs)("p",{children:[(0,ua.__)("Unknown field type:","dokan-kits"),(0,br.jsx)("code",{children:r})]})});const n={...e,label:e.label||e.title||"",options:e.options||[],placeholder:e.placeholder||"",readonly:e.readonly||!1,disabled:e.disabled||!1,min:e.minimum,max:e.maximum,step:e.step};return(0,br.jsx)(s,{field:n,value:t,onChange:a})},en={text:"text",textarea:"textarea",select:"select",number:"number",checkbox:"checkbox",radio:"radio",color:"color",media:"media",code:"code",toggle:"toggle"},tn=({tabId:e,sectionId:t,fields:a,settings:r,validationErrors:s={},onSettingChange:n})=>{const[i,d]=(0,o.useState)({}),l=(0,o.useRef)({}),c=(0,o.useRef)({}),u=(0,o.useMemo)((()=>Object.values(a).map((a=>{const n=a.dependency_key||`${e}.${t}.${a.id}`;return{field:a,settingKey:n,value:r[n],isVisible:Ks(a,r),hasError:void 0!==s[n],errorMessage:s[n]}}))),[a,r,e,t,s]);return(0,o.useEffect)((()=>{const e={},t={};if(u.forEach((({field:a,isVisible:r})=>{r&&(t[a.id]=!0,l.current[a.id]||(e[a.id]="animate-field-enter"))})),Object.keys(e).length>0){d((t=>({...t,...e})));const t=Object.keys(e);setTimeout((()=>{d((e=>{const a={...e};return t.forEach((e=>{delete a[e]})),a}))}),500)}l.current=t}),[u]),(0,o.useEffect)((()=>{const e={};if(u.forEach((({field:t,settingKey:a,hasError:r})=>{r&&!c.current[a]&&(e[t.id]="dk-shake")})),Object.keys(e).length>0){d((t=>({...t,...e})));const t=Object.keys(e);setTimeout((()=>{d((e=>{const a={...e};return t.forEach((e=>{delete a[e]})),a}))}),800)}const t={};Object.entries(s).forEach((([e,a])=>{t[e]=a})),c.current=t}),[s,u]),a&&0!==Object.keys(a).length?(0,br.jsx)("div",{className:"dokan-kits-settings-fields",children:u.map((({field:e,settingKey:t,value:a,isVisible:r,hasError:s,errorMessage:o})=>{if(!r)return null;const d=(l=e.variant,en[l]||"text");var l;const c=i[e.id]||"";return(0,br.jsxs)("div",{className:`dokan-kits-field-container ${s?"dk-has-error":""} ${c}`,children:[(0,br.jsx)(Qs,{field:{...e,type:d,label:(0,qs.decodeEntities)(e.title),description:(0,qs.decodeEntities)(e.description),hasError:s,errorMessage:o},value:a,onChange:e=>{((e,t)=>{n(e,t)})(t,e)}}),s&&(0,br.jsx)("div",{className:"dk-text-red-500 dk-text-sm dk-mt-1",children:o})]},e.id)}))}):(0,br.jsx)("p",{children:(0,ua.__)("No fields in this section.","dokan-kits")})},an=({tabId:e,structure:t,settings:a,validationErrors:s={},onSettingChange:n,className:o="",emptyMessage:i=null})=>t?t.sections&&Object.keys(t.sections).length>0?(0,br.jsx)("div",{className:xr(`dokan-kits-tab-content dokan-kits-tab-${e}`,o,"dk-mt-1"),children:Object.keys(t.sections).map((o=>{const i=t.sections[o],d=Object.keys(s).some((t=>t.startsWith(`${e}.${o}.`)||Object.values(i.fields).some((e=>e.dependency_key&&s[e.dependency_key]))));return(0,br.jsxs)(r.Card,{className:xr("dokan-kits-settings-section dk-mb-wp-6 last:dk-mb-0",{"dk-border-red-300":d}),children:[(0,br.jsxs)(r.CardHeader,{className:"dk-block dk-p-4 dk-bg-white dk-border-b dk-border-gray-200",children:[(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-gap-2",children:[(0,br.jsx)("h3",{className:"dk-text-base dk-font-medium",children:(0,qs.decodeEntities)(i.title)}),i.badge&&(0,br.jsx)("span",{className:"dk-text-xs dk-px-2 dk-py-0.5 dk-rounded-full dk-font-medium "+("primary"===i.badge.type?"dk-bg-blue-100 dk-text-blue-800":"success"===i.badge.type?"dk-bg-green-100 dk-text-green-800":"warning"===i.badge.type?"dk-bg-yellow-100 dk-text-yellow-800":"danger"===i.badge.type?"dk-bg-red-100 dk-text-red-800":"info"===i.badge.type?"dk-bg-indigo-100 dk-text-indigo-800":"dk-bg-gray-100 dk-text-gray-800"),children:(0,qs.decodeEntities)(i.badge.text)})]}),i.description&&(0,br.jsx)("p",{className:"dk-text-sm dk-text-gray-600 dk-mt-1",children:(0,qs.decodeEntities)(i.description)})]}),(0,br.jsx)(r.CardBody,{children:(0,br.jsx)(tn,{tabId:e,sectionId:o,fields:i.fields,settings:a,validationErrors:s,onSettingChange:n})})]},o)}))}):(0,br.jsx)(r.Card,{className:"dk-bg-gray-50",children:(0,br.jsx)(r.CardBody,{children:(0,br.jsx)("p",{className:"dk-text-center dk-text-gray-500",children:i||(0,ua.__)("No features available for this tab.","dokan-kits")})})}):(0,br.jsx)(r.Card,{className:"dk-bg-gray-50",children:(0,br.jsx)(r.CardBody,{children:(0,br.jsx)("p",{className:"dk-text-center dk-text-gray-500",children:(0,ua.__)("Tab structure not found.","dokan-kits")})})}),rn=()=>{const e=({className:e})=>(0,br.jsx)("div",{className:`dk-animate-pulse dk-bg-gray-200 dk-rounded ${e}`}),t=()=>(0,br.jsx)("div",{className:"dk-flex dk-border-b dk-border-gray-200 dk-mb-wp-4",children:(0,br.jsx)("div",{className:"dk-flex dk-overflow-x-auto dk-no-scrollbar",children:Array(3).fill().map(((t,a)=>(0,br.jsx)("div",{className:"dk-pb-wp-3 dk-px-wp-4 dk-whitespace-nowrap "+(0===a?"dk-border-b-2 dk-border-primary-500":""),children:(0,br.jsx)(e,{className:"dk-h-6 dk-w-32"})},a)))})}),a=()=>(0,br.jsx)("div",{className:"dk-border-b dk-border-gray-200 dk-py-wp-4",children:(0,br.jsxs)("div",{className:"dk-flex dk-flex-col md:dk-flex-row dk-items-start md:dk-items-center dk-justify-between",children:[(0,br.jsxs)("div",{className:"dk-flex-grow",children:[(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-gap-wp-3",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-40 dk-mb-wp-1"}),(0,br.jsx)(e,{className:"dk-h-5 dk-w-16 dk-rounded-full"})]}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-max-w-2xl dk-mt-wp-1"})]}),(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-gap-wp-2 dk-mt-wp-2 md:dk-mt-0",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-12 dk-rounded-full"}),(0,br.jsx)(e,{className:"dk-h-8 dk-w-8 dk-rounded-full"})]})]})}),s=()=>(0,br.jsxs)(r.Card,{className:"dk-mt-wp-4",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsx)(e,{className:"dk-h-7 dk-w-64"})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("div",{className:"dk-space-y-wp-6",children:Array(3).fill().map(((t,a)=>(0,br.jsxs)("div",{className:"dk-space-y-wp-4",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-48"}),Array(2).fill().map(((t,a)=>(0,br.jsxs)("div",{className:"dk-mb-wp-4",children:[(0,br.jsx)(e,{className:"dk-h-5 dk-w-40 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-full dk-rounded"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4 dk-mt-wp-1"})]},a)))]},a)))}),(0,br.jsxs)("div",{className:"dk-flex dk-justify-end dk-gap-wp-2 dk-mt-wp-6 dk-pt-wp-4 dk-border-t dk-border-gray-200",children:[(0,br.jsx)(e,{className:"dk-h-10 dk-w-24 dk-rounded"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-24 dk-rounded"})]})]})]}),n=()=>(0,br.jsxs)("div",{className:"dk-mb-wp-6",children:[(0,br.jsx)(r.Card,{className:"dk-mb-wp-6",children:(0,br.jsx)(r.CardBody,{children:(0,br.jsxs)("div",{className:"dk-flex dk-flex-col md:dk-flex-row dk-items-start md:dk-items-center dk-justify-between dk-gap-wp-4",children:[(0,br.jsxs)("div",{children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-64 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-max-w-2xl"})]}),(0,br.jsxs)("div",{className:"dk-flex dk-gap-wp-2",children:[(0,br.jsx)(e,{className:"dk-h-10 dk-w-32 dk-rounded"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-32 dk-rounded"})]})]})})}),(0,br.jsx)("div",{className:"dk-mb-wp-6",children:(0,br.jsx)(r.Card,{children:(0,br.jsx)(r.CardBody,{children:Array(5).fill().map(((e,t)=>(0,br.jsx)(a,{},t)))})})}),(0,br.jsx)(s,{})]});return(0,br.jsxs)("div",{className:"dokan-kits-features-page dk-p-6",children:[(0,br.jsx)("div",{className:"dk-mb-wp-6",children:(0,br.jsx)(e,{className:"dk-h-12 dk-w-full dk-rounded"})}),(0,br.jsx)(t,{}),(0,br.jsx)(n,{})]})},sn=e=>{let t=void 0!==e.value?e.value:void 0!==e.default?e.default:"";t=((e,t,a="")=>{if(null==e&&(e=a),["toggle","checkbox"].includes(t))return Boolean(!0===e||"true"===e||"1"===e||1===e);if("number"===t){if(""===e||null==e)return"";const t=parseFloat(e);if(!isNaN(t))return t;if(""!==a&&null!=a){const e=parseFloat(a);return isNaN(e)?"":e}return""}return"multiselect"!==t||Array.isArray(e)?e:e?[e]:[]})(t,e.variant,e.default);const a=[];return e.dependencies&&Array.isArray(e.dependencies)&&e.dependencies.forEach((e=>{const t=(e=>{if(!e||!e.key)return null;const t={...e};return t.comparison||(t.comparison="="),"string"==typeof t.value&&("true"===t.value?t.value=!0:"false"===t.value?t.value=!1:isNaN(Number(t.value))||[">","<",">=","<="].includes(t.comparison)&&(t.value=Number(t.value))),t})(e);t&&a.push(t)})),{id:e.id,title:e.title||"",description:e.description||"",variant:e.variant||"text",value:t,default:e.default||"",placeholder:e.placeholder||"",readonly:e.readonly||!1,disabled:e.disabled||!1,dependencies:a,dependency_key:e.dependency_key||"",required:e.required||!1,options:e.options||[],minimum:e.minimum,maximum:e.maximum,step:e.step,size:e.size}},nn=(e,t,a)=>{if(!e||!t)return e;const r={...e},s=((e,t)=>{if(!e||!t)return null;for(const a in e){const r=e[a];for(const e in r.sections){const s=r.sections[e];for(const r in s.fields){const n=s.fields[r];if((n.dependency_key||`${a}.${e}.${r}`)===t)return{field:n,path:{tabId:a,sectionId:e,fieldId:r}}}}}return null})(r,t);if(s){const{path:e}=s;r[e.tabId].sections[e.sectionId].fields[e.fieldId]={...r[e.tabId].sections[e.sectionId].fields[e.fieldId],value:a}}return r},on=(e=null,t=()=>{})=>{const[a,r]=(0,o.useState)({}),[s,n]=(0,o.useState)({}),[i,d]=(0,o.useState)(!0),l=(0,o.useCallback)(((e,a)=>{n((t=>({...t,[e]:a}))),"function"==typeof t&&t(e,a),r((t=>nn(t,e,a)))}),[t]),c=(0,o.useCallback)((e=>{e&&"object"==typeof e&&(n((t=>({...t,...e}))),"function"==typeof t&&Object.entries(e).forEach((([e,a])=>{t(e,a)})),r((t=>((e,t)=>{if(!e||!t||"object"!=typeof t)return e;let a={...e};return Object.entries(t).forEach((([e,t])=>{a=nn(a,e,t)})),a})(t,e))))}),[t]);return(0,o.useEffect)((()=>{(()=>{if(void 0===window.Dokan_Kits)return void d(!1);const t=(e=>{const t={};if(!e?.children?.length)return console.warn("Invalid structure data: missing children"),t;try{e.children.forEach((e=>{e.id&&"section"===e.type&&e.display&&(t[e.id]={id:e.id,title:e.title||"",icon:e.icon||"",description:e.description||"",sections:{}},e.children?.length&&e.children.forEach((a=>{a.id&&"subsection"===a.type&&a.display&&(t[e.id].sections[a.id]={id:a.id,title:a.title||"",description:a.description||"",badge:a.badge||null,fields:{}},a.children?.length&&a.children.forEach((r=>{r.id&&"field"===r.type&&r.display&&(t[e.id].sections[a.id].fields[r.id]=sn(r))})))})))}))}catch(e){console.error("Error parsing structure:",e)}return t})(window.Dokan_Kits.features||{});r(t);const a=Ys(t);if(e&&Object.keys(e).length>0){const a=((e,t)=>{const a=Ys(e);if(!t||!t.data)return a;const r={...a},s=t.data;for(const t in e){const a=e[t];if(!s[t])continue;const n=s[t];for(const e in a.sections){const s=a.sections[e];for(const a in s.fields){if(!n[e])continue;const o=s.fields[a],i=o.dependency_key||`${t}.${e}.${a}`;if(!n[e][a])continue;let d=n[e][a];if(["toggle","checkbox"].includes(o.variant))d=Boolean(!0===d||"true"===d||"1"===d||1===d);else if("number"===o.variant&&""!==d){const e=parseFloat(d);isNaN(e)||(d=e)}else"multiselect"!==o.variant||Array.isArray(d)||(d=d?[d]:[]);r[i]=d}}}return r})(t,{data:e});n(a)}else n(a);d(!1)})()}),[e]),{structure:a,settings:s,isLoading:i,updateSetting:l,updateSettings:c}},dn={duration:5e3,position:"top-right",style:{background:"transparent",boxShadow:"none",padding:0}},ln=(e,t,a=Ps,r={})=>{const s={...dn,...r,id:e};let n=s.duration||5e3;return a===Ts&&(n=s.duration||8e3),xs.custom((e=>(0,br.jsx)(Ds,{t:e,message:t,type:a,onClose:()=>xs.dismiss(e.id)})),{...s,duration:n})},cn={},un=({tab:e,structure:t,settings:a,validationErrors:r,onSettingChange:s})=>{const n=e.name;if(cn[n]){const e=cn[n];return(0,br.jsx)(e,{structure:t[n],settings:a,validationErrors:r,onSettingChange:s})}return(0,br.jsx)(an,{tabId:n,structure:t[n],settings:a,validationErrors:r,onSettingChange:s})},mn=()=>{const{addNotice:e,clearNotices:t}=$s(),[a,s]=(0,o.useState)(null),[n,i]=(0,o.useState)(!0),[d,l]=(0,o.useState)({});(0,o.useEffect)((()=>{(async()=>{try{const e=await Us()({path:"/dokan-kits/v1/settings"});e.data&&s(e.data),i(!1)}catch(t){e(t.message||(0,ua.__)("Failed to load settings. Please refresh the page.","dokan-kits"),Ts),i(!1)}})()}),[e]);const c=(0,o.useCallback)(((e,t)=>{l((a=>({...a,[e]:t})))}),[]),u=(0,o.useCallback)((async()=>{try{const e=await Us()({path:"/dokan-kits/v1/settings",method:"POST",data:{settings:d}});if(e.success)return e;throw new Error(e.message||(0,ua.__)("Failed to save settings","dokan-kits"))}catch(e){throw e}}),[d]),{structure:m,settings:k,isLoading:h,updateSetting:p}=on(a,c),{isSaving:f,validationErrors:g,saveForm:x}=((e,t,a)=>{const[r,s]=(0,o.useState)(t||{}),[n,i]=(0,o.useState)(!1),[d,l]=(0,o.useState)(null),[c,u]=(0,o.useState)(!1),[m,k]=(0,o.useState)({}),h=(0,o.useCallback)(((e,t)=>{s((a=>({...a,[e]:t})))}),[]),p=(0,o.useCallback)((e=>{e&&"object"==typeof e&&s((t=>({...t,...e})))}),[]),f=(0,o.useCallback)((()=>{s(t||{}),k({}),l(null),u(!1)}),[t]),g=(0,o.useCallback)((()=>{l(null),u(!1)}),[]),x=(0,o.useCallback)((()=>{if(!e)return!0;const{isValid:t,errors:a}=Gs(e,r);return k(a),t||(l((0,ua.__)("Please fix the validation errors before saving.","dokan-kits")),u(!0)),t}),[e,r]),b=(0,o.useCallback)((async()=>{if(!x())return!1;k({}),i(!0),l(null),u(!1);try{const e=await a(r);return i(!1),l(e.message),u(!e.success),setTimeout((()=>{l(null)}),3e3),e.success}catch(e){return i(!1),l((0,ua.__)("Failed to save form data.","dokan-kits")),u(!0),!1}}),[x,a,r]);return{values:r,isSaving:n,message:d,isError:c,validationErrors:m,updateValue:h,updateValues:p,saveForm:b,resetForm:f,clearNotifications:g,validateForm:x}})(m,k,u),b=(0,o.useCallback)((async()=>{if(t(),Object.keys(g).length>0)return e((0,ua.__)("Please fix the validation errors before saving.","dokan-kits"),Ts,{duration:8e3}),Object.values(g).forEach(((t,a)=>{setTimeout((()=>{e(t,Ts,{duration:6e3})}),500*(a+1))})),!1;const a=((e,t={})=>xs.custom((t=>(0,br.jsx)(Ds,{t,message:e,type:"info",onClose:()=>xs.dismiss(t.id),showCloseButton:!1})),{...dn,duration:1/0,...t,id:t.id||`loading-${Date.now()}`}))((0,ua.__)("Saving your changes…","dokan-kits"));try{const e=await x();return e?ln(a,(0,ua.__)("Settings saved successfully!","dokan-kits"),Ps):ln(a,(0,ua.__)("Failed to save settings. Please try again.","dokan-kits"),Ts),e}catch(e){return ln(a,e.message||(0,ua.__)("An unexpected error occurred while saving.","dokan-kits"),Ts),!1}}),[e,t,g,x]);if(h||n)return(0,br.jsx)(rn,{});const y=Object.keys(m).map((e=>({name:e,title:(0,qs.decodeEntities)(m[e].title),className:`dokan-kits-tab-${e}`})));return(0,br.jsx)("div",{className:"dk-max-w-full dk-mx-auto dk-py-wp-5",children:(0,br.jsxs)(r.Card,{className:"dk-shadow-sm",children:[(0,br.jsx)(r.CardHeader,{className:"dk-border-b dk-border-gray-200",children:(0,br.jsx)("h2",{className:"dk-text-xl dk-font-semibold dk-m-0",children:(0,ua.__)("Manage Features","dokan-kits")})}),(0,br.jsx)(r.CardBody,{children:(0,br.jsx)(r.TabPanel,{activeClass:"dk-text-primary-600 dk-border dk-border-solid dk-border-b-2 dk-border-primary-500 dk-bg-gray-50",tabs:y,children:e=>(0,br.jsx)(un,{tab:e,structure:m,settings:k,validationErrors:g,onSettingChange:p})})}),(0,br.jsx)(r.CardFooter,{className:"dk-sticky dk-bottom-0 dk-border-t dk-border-gray-200 dk-bg-gray-50",children:(0,br.jsx)(r.Button,{variant:"primary",isBusy:f,onClick:b,disabled:h||f,className:"dk-w-full dk-justify-center hover:!dk-bg-primary-800 focus-visible:!dk-bg-primary-800 focus:!dk-ring-primary-800",children:f?(0,ua.__)("Saving Changes…","dokan-kits"):(0,ua.__)("Save Changes","dokan-kits")})})]})})},kn=({className:e})=>(0,br.jsxs)("div",{className:xr("dk-min-h-[400px] dk-flex dk-flex-col dk-items-center dk-justify-center dk-p-wp-8 dk-text-center",e),children:[(0,br.jsx)("div",{className:"dk-flex dk-justify-center dk-mb-wp-6",children:(0,br.jsxs)("div",{className:"dk-inline-flex dk-flex-col dk-items-center dk-justify-center",children:[(0,br.jsx)("div",{className:"dk-text-8xl dk-font-bold dk-text-primary-200 dk-mb-wp-4",children:"404"}),(0,br.jsx)("div",{className:"dk-inline-flex dk-items-center dk-justify-center dk-w-20 dk-h-20 dk-rounded-full dk-bg-blue-100 dk-border-4 dk-border-blue-200 dk-shadow-inner",children:(0,br.jsx)("span",{className:"dashicons dashicons-marker dk-text-4xl dk-text-blue-600"})})]})}),(0,br.jsx)("h1",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-3",children:(0,ua.__)("Page Not Found","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-max-w-lg dk-text-gray-600 dk-mb-wp-6",children:[(0,br.jsx)("p",{className:"dk-mb-wp-3",children:(0,ua.__)("We couldn't find the page you're looking for.","dokan-kits")}),(0,br.jsx)("p",{children:(0,ua.__)("It might have been moved, deleted, or perhaps you entered an incorrect URL.","dokan-kits")})]}),(0,br.jsxs)("div",{className:"dk-flex dk-flex-col md:dk-flex-row dk-items-center dk-space-y-wp-4 md:dk-space-y-0 md:dk-space-x-wp-4",children:[(0,br.jsxs)(sa,{to:"/",className:xr("dk-admin-button dk-bg-primary-600 hover:dk-bg-primary-700 dk-text-white dk-shadow-md hover:dk-shadow-lg dk-transition dk-duration-200 dk-flex dk-items-center"),children:[(0,br.jsx)("span",{className:"dashicons dashicons-dashboard dk-mr-wp-2"}),(0,ua.__)("Go to Dashboard","dokan-kits")]}),(0,br.jsxs)(sa,{to:"/features",className:xr("dk-admin-button dk-admin-button-secondary dk-shadow-md hover:dk-shadow-lg dk-transition dk-duration-200 dk-flex dk-items-center"),children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-settings dk-mr-wp-2"}),(0,ua.__)("Go to Features","dokan-kits")]})]}),(0,br.jsx)("div",{className:"dk-mt-wp-8 dk-pt-wp-6 dk-border-t dk-border-gray-200 dk-max-w-md",children:(0,br.jsxs)("div",{className:"dk-flex dk-justify-center dk-space-x-wp-6",children:[(0,br.jsxs)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:xr("dk-text-primary-600 hover:dk-text-primary-800 dk-flex dk-flex-col dk-items-center"),children:[(0,br.jsx)("span",{className:"dashicons dashicons-sos dk-text-xl dk-mb-wp-1"}),(0,br.jsx)("span",{className:"dk-text-sm",children:(0,ua.__)("Support","dokan-kits")})]}),(0,br.jsxs)("a",{href:"https://wordpress.org/plugins/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:xr("dk-text-primary-600 hover:dk-text-primary-800 dk-flex dk-flex-col dk-items-center"),children:[(0,br.jsx)("span",{className:"dashicons dashicons-book dk-text-xl dk-mb-wp-1"}),(0,br.jsx)("span",{className:"dk-text-sm",children:(0,ua.__)("Documentation","dokan-kits")})]}),(0,br.jsxs)("a",{href:"https://wordpress.org/plugins/dokan-kits/#developers",target:"_blank",rel:"noopener noreferrer",className:xr("dk-text-primary-600 hover:dk-text-primary-800 dk-flex dk-flex-col dk-items-center"),children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-plugins dk-text-xl dk-mb-wp-1"}),(0,br.jsx)("span",{className:"dk-text-sm",children:(0,ua.__)("Plugin Info","dokan-kits")})]})]})})]}),hn=()=>{const e=({className:e})=>(0,br.jsx)("div",{className:`dk-animate-pulse dk-bg-gray-200 dk-rounded ${e}`}),t=()=>(0,br.jsxs)("div",{className:"dk-mb-wp-8 dk-text-center",children:[(0,br.jsx)(e,{className:"dk-mx-auto dk-h-10 dk-w-1/4 dk-mb-wp-3"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-5 dk-w-2/3 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-5 dk-w-1/2 dk-mb-wp-2"})]}),a=({cardCount:t=2})=>(0,br.jsxs)("div",{className:"dk-mb-wp-8",children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-1/4 dk-mb-wp-4"}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6",children:Array(t).fill().map(((t,a)=>(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-6 dk-mr-wp-2"}),(0,br.jsx)(e,{className:"dk-h-6 dk-w-2/3"})]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4 dk-mb-wp-2"})]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(e,{className:"dk-h-10 dk-w-36"})})]},a)))})]}),s=()=>(0,br.jsx)("div",{className:"dk-mt-wp-10 dk-p-wp-6 dk-bg-gray-100 dk-rounded-lg dk-border dk-border-gray-200",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-start",children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-8 dk-mr-wp-4"}),(0,br.jsxs)("div",{children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-1/4 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4 dk-mb-wp-3"}),(0,br.jsxs)("div",{className:"dk-flex dk-gap-wp-4",children:[(0,br.jsx)(e,{className:"dk-h-10 dk-w-32"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-40"})]})]})]})});return(0,br.jsxs)("div",{className:"dokan-kits-tools-page",children:[(0,br.jsx)(t,{}),(0,br.jsx)(a,{cardCount:2}),(0,br.jsx)(a,{cardCount:1}),(0,br.jsx)(a,{cardCount:1}),(0,br.jsx)(a,{cardCount:2}),(0,br.jsx)(s,{})]})},pn=()=>{const[e,t]=(0,o.useState)(!0),[a,s]=(0,o.useState)(null),[n,i]=(0,o.useState)(null),[d,l]=(0,o.useState)({}),[c,u]=(0,o.useState)(null),[m,k]=(0,o.useState)({recreateTables:!1,migrateSettings:!1,optimizeTables:!1,runDiagnostics:!1,downloadLogs:!1}),{addNotice:h}=$s(),p=(0,o.useCallback)((async()=>{try{const e=await Us()({path:"/dokan-kits/v1/tools/migration-status",method:"GET"});e.success&&s(e.data)}catch(e){console.warn("Failed to load migration status:",e.message)}finally{t(!1)}}),[]);(0,o.useEffect)((()=>{p()}),[p]);const f=async(e,t,a=!1)=>{if(a||!["recreate-tables","optimize-tables"].includes(t)){k((t=>({...t,[e]:!0})));try{const a=await Us()({path:`/dokan-kits/v1/tools/${t}`,method:"POST"});if(!a.success)throw new Error(a.message||(0,ua.__)("Failed to complete operation.","dokan-kits"));l((t=>({...t,[e]:{success:!0,message:a.message,data:a.data,timestamp:(new Date).toISOString()}}))),"runDiagnostics"===e&&a.data&&u(a.data),h(a.message||(0,ua.__)("Operation completed successfully.","dokan-kits"),"success"),"migrate-settings"===t&&p()}catch(t){l((a=>({...a,[e]:{success:!1,message:t.message,timestamp:(new Date).toISOString()}}))),h(t.message||(0,ua.__)("An unexpected error occurred.","dokan-kits"),"error")}finally{k((t=>({...t,[e]:!1})))}}else i({tool:e,action:t})},g=e=>{const t=d[e];if(!t)return null;const a=t.success,r=new Date(t.timestamp).toLocaleString();return(0,br.jsxs)("div",{className:"dk-mt-2 dk-p-3 dk-rounded dk-text-sm "+(a?"dk-bg-green-50 dk-text-green-700 dk-border dk-border-green-200":"dk-bg-red-50 dk-text-red-700 dk-border dk-border-red-200"),children:[(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-justify-between dk-mb-2",children:[(0,br.jsx)("span",{className:"dk-font-medium",children:a?"✓ "+(0,ua.__)("Success","dokan-kits"):"✗ "+(0,ua.__)("Failed","dokan-kits")}),(0,br.jsx)("span",{className:"dk-text-xs dk-opacity-75",children:r})]}),t.data&&t.data.tables&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mb-1",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Tables affected:","dokan-kits")})," ",t.data.tables.length,t.data.tables.length>0&&(0,br.jsxs)("div",{className:"dk-mt-1 dk-text-xs dk-opacity-75",children:[t.data.tables.slice(0,3).join(", "),t.data.tables.length>3&&(0,ua.__)("and more…","dokan-kits")]})]}),t.data&&t.data.versions&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mb-1",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Migrations executed:","dokan-kits")})," ",t.data.versions.length]}),t.data&&t.data.optimized&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mb-1",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Tables optimized:","dokan-kits")})," ",t.data.optimized.length,t.data.failed&&t.data.failed.length>0&&(0,br.jsxs)("div",{className:"dk-text-red-600",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Failed:","dokan-kits")})," ",t.data.failed.length]})]}),t.data&&t.data.file_name&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mb-1",children:[(0,br.jsx)("strong",{children:(0,ua.__)("File:","dokan-kits")})," ",t.data.file_name," (",t.data.file_size,")"]})]})};return e?(0,br.jsx)(hn,{}):(0,br.jsxs)("div",{className:"dokan-kits-tools-page",children:[n&&(0,br.jsx)(r.Modal,{title:(0,ua.__)("Confirm Database Operation","dokan-kits"),onRequestClose:()=>i(null),className:"dokan-kits-admin-page dokan-kits-admin-modal dokan-kits-tools-confirm-modal",children:(0,br.jsxs)("div",{className:"dk-modal-content",children:[(0,br.jsxs)("div",{className:"dk-modal-header",children:[(0,br.jsx)("h2",{className:"dk-modal-title",children:(0,ua.__)("Confirm Database Operation","dokan-kits")}),(0,br.jsx)("button",{type:"button",className:"dk-modal-close",onClick:()=>i(null),"aria-label":(0,ua.__)("Close modal","dokan-kits"),children:(0,br.jsx)("span",{className:"dashicons dashicons-no-alt"})})]}),(0,br.jsxs)("div",{className:"dk-modal-body",children:[(0,br.jsx)("div",{className:"dk-modal-icon dk-bg-red-50 dk-text-red-500",children:(0,br.jsx)("span",{className:"dashicons dashicons-warning"})}),(0,br.jsx)("p",{className:"dk-modal-description dk-text-red-700",children:(0,ua.__)("This action will modify your database structure. Please ensure you have a backup before proceeding.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-form-field",children:[(0,br.jsx)("label",{className:"dk-form-label",children:(0,ua.__)("Recommended precautions:","dokan-kits")}),(0,br.jsx)("div",{className:"dk-p-wp-3 dk-bg-yellow-50 dk-rounded-md dk-border dk-border-yellow-200",children:(0,br.jsxs)("ul",{className:"dk-text-sm dk-text-yellow-700 dk-list-disc dk-list-inside dk-space-y-1",children:[(0,br.jsx)("li",{children:(0,ua.__)("Create a full database backup","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Ensure no other processes are accessing the database","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Run this operation during low-traffic periods","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Monitor your site after the operation completes","dokan-kits")})]})})]}),(0,br.jsxs)("div",{className:"dk-form-field",children:[(0,br.jsx)("label",{className:"dk-form-label",children:(0,ua.__)("Operation Details:","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-p-wp-3 dk-bg-gray-50 dk-rounded-md dk-border dk-border-gray-200",children:[(0,br.jsxs)("p",{className:"dk-text-sm dk-text-gray-700",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Action:","dokan-kits")})," ",n.action.replace("-"," ").replace(/\b\w/g,(e=>e.toUpperCase()))]}),(0,br.jsxs)("p",{className:"dk-text-sm dk-text-gray-700 dk-mt-1",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Risk Level:","dokan-kits")}),(0,br.jsxs)("span",{className:"dk-text-red-600 dk-font-medium",children:[" ",(0,ua.__)("High - Database Structure Changes","dokan-kits")]})]})]})]})]}),(0,br.jsxs)("div",{className:"dk-modal-footer",children:[(0,br.jsx)(r.Button,{variant:"secondary",onClick:()=>i(null),className:"dk-admin-button dk-admin-button-secondary",children:(0,ua.__)("Cancel","dokan-kits")}),(0,br.jsx)(r.Button,{variant:"primary",onClick:()=>{if(n){const{tool:e,action:t}=n;i(null),f(e,t,!0)}},className:"dk-admin-button dk-admin-button-danger",children:(0,ua.__)("Yes, I understand the risks","dokan-kits")})]})]})}),(0,br.jsx)(r.Card,{className:"dk-mb-wp-6",children:(0,br.jsxs)(r.CardBody,{className:"dk-text-center dk-py-wp-8",children:[(0,br.jsx)("img",{src:As,alt:"Dokan Kits",className:"dk-mx-auto dk-h-24 dk-w-auto dk-mb-wp-4"}),(0,br.jsx)("h1",{className:"dk-text-3xl dk-font-bold dk-text-gray-900 dk-mb-wp-3",children:(0,ua.__)("Tools & Utilities","dokan-kits")}),(0,br.jsx)("p",{className:"dk-max-w-2xl dk-mx-auto dk-text-lg dk-text-gray-600 dk-mb-wp-3",children:(0,ua.__)("Manage advanced Dokan Kits maintenance and migration tasks. Use these tools for troubleshooting, database management, and data migration.","dokan-kits")}),(0,br.jsx)("p",{className:"dk-max-w-2xl dk-mx-auto dk-text-base dk-text-gray-500",children:(0,ua.__)("These utilities help you maintain and optimize your Dokan Kits installation for better performance and reliability.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-mt-wp-6 dk-flex dk-flex-wrap dk-justify-center dk-gap-wp-4",children:[(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-blue-100 dk-text-blue-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-tools dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Maintenance","dokan-kits")]}),(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-green-100 dk-text-green-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-database dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Database","dokan-kits")]}),(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-purple-100 dk-text-purple-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-performance dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Optimization","dokan-kits")]})]})]})}),(()=>{if(!a)return null;const{needs_migration:e,is_running:t,current_version:s,migration_history:n}=a;return t?(0,br.jsxs)(r.Notice,{status:"warning",isDismissible:!1,className:"dk-mb-4",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Migration in Progress","dokan-kits")}),(0,br.jsx)("p",{children:(0,ua.__)("A migration is currently running. Please wait for it to complete before running other tools.","dokan-kits")})]}):e?(0,br.jsxs)(r.Notice,{status:"info",isDismissible:!1,className:"dk-mb-4",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Migration Required","dokan-kits")}),(0,br.jsx)("p",{children:(0,ua.__)("Your database needs to be migrated to the latest version. Please run the migration tool below.","dokan-kits")})]}):(0,br.jsxs)(r.Notice,{status:"success",isDismissible:!1,className:"dk-mb-4",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Up to Date","dokan-kits")}),(0,br.jsxs)("p",{children:[(0,ua.__)(`All migrations are current (v${s}).`,"dokan-kits"),n&&n.length>0&&(0,br.jsx)("span",{className:"dk-ml-2 dk-text-sm",children:(0,ua.__)(`Last migration: ${n[n.length-1]}`,"dokan-kits")})]})]})})(),(0,br.jsxs)("div",{className:"dk-mb-wp-8",children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Database Tools","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6",children:[(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-md",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-database dk-mr-wp-2 dk-text-primary-600"}),(0,ua.__)("Database Tables","dokan-kits")]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Recreate missing or corrupted database tables. This will create new tables and verify their structure without affecting existing data.","dokan-kits")}),g("recreateTables")]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(r.Button,{variant:"primary",className:"dk-admin-button",isBusy:m.recreateTables,disabled:m.recreateTables,onClick:()=>f("recreateTables","recreate-tables"),children:m.recreateTables?(0,ua.__)("Processing…","dokan-kits"):(0,ua.__)("Recreate Tables","dokan-kits")})})]}),(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-md",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-performance dk-mr-wp-2 dk-text-primary-600"}),(0,ua.__)("Optimize Tables","dokan-kits")]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Repair and optimize database tables to improve performance and fix potential data corruption issues. This may take several minutes.","dokan-kits")}),g("optimizeTables")]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(r.Button,{variant:"primary",className:"dk-admin-button",isBusy:m.optimizeTables,disabled:m.optimizeTables,onClick:()=>f("optimizeTables","optimize-tables"),children:m.optimizeTables?(0,ua.__)("Optimizing…","dokan-kits"):(0,ua.__)("Optimize Tables","dokan-kits")})})]})]})]}),(0,br.jsxs)("div",{className:"dk-mb-wp-8",children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Data Migration","dokan-kits")}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6",children:(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-md",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-migrate dk-mr-wp-2 dk-text-secondary-600"}),(0,ua.__)("Migrate Settings","dokan-kits")]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Migrate legacy Dokan Kits options to the new settings structure. This is required when upgrading from older versions.","dokan-kits")}),a&&a.needs_migration&&(0,br.jsx)("div",{className:"dk-p-3 dk-bg-yellow-50 dk-border dk-border-yellow-200 dk-rounded dk-text-sm dk-text-yellow-800 dk-mb-4",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-warning dk-mr-2"}),(0,br.jsxs)("div",{children:[(0,br.jsx)("strong",{children:(0,ua.__)("Migration Required","dokan-kits")}),(0,br.jsx)("p",{className:"dk-mt-1",children:(0,ua.__)("Your database needs to be migrated to work with the current version.","dokan-kits")})]})]})}),g("migrateSettings")]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(r.Button,{variant:a&&a.needs_migration?"primary":"secondary",className:a&&a.needs_migration?"dk-admin-button":"dk-admin-button dk-admin-button-secondary",isBusy:m.migrateSettings,disabled:m.migrateSettings||a&&a.is_running,onClick:()=>f("migrateSettings","migrate-settings"),children:m.migrateSettings?(0,ua.__)("Migrating…","dokan-kits"):(0,ua.__)("Run Migration","dokan-kits")})})]})})]}),(0,br.jsxs)("div",{className:"dk-mb-wp-8",children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Troubleshooting","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6",children:[(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-md",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-chart-bar dk-mr-wp-2 dk-text-primary-600"}),(0,ua.__)("System Diagnostics","dokan-kits")]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Run comprehensive diagnostic tests to identify potential issues with your environment, dependencies, and configuration.","dokan-kits")}),g("runDiagnostics"),(()=>{if(!c)return null;const{wordpress:e,php:t,dokan_kits:a,system_check:r}=c;return(0,br.jsxs)("div",{className:"dk-mt-2 dk-p-3 dk-bg-blue-50 dk-border dk-border-blue-200 dk-rounded dk-text-sm",children:[(0,br.jsx)("div",{className:"dk-font-medium dk-text-blue-800 dk-mb-2",children:(0,ua.__)("System Status Overview","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-2 dk-gap-2 dk-text-xs",children:[e&&(0,br.jsxs)("div",{children:[(0,br.jsx)("strong",{children:(0,ua.__)("WordPress:","dokan-kits")})," ",e.version]}),t&&(0,br.jsxs)("div",{children:[(0,br.jsx)("strong",{children:(0,ua.__)("PHP:","dokan-kits")})," ",t.version]}),a&&(0,br.jsxs)("div",{children:[(0,br.jsx)("strong",{children:(0,ua.__)("Plugin:","dokan-kits")})," ",a.version]}),r&&(0,br.jsxs)("div",{className:r.pass?"dk-text-green-600":"dk-text-red-600",children:[(0,br.jsx)("strong",{children:(0,ua.__)("System Check:","dokan-kits")})," ",r.pass?(0,ua.__)("Pass","dokan-kits"):(0,ua.__)("Fail","dokan-kits")]})]})]})})()]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(r.Button,{variant:"primary",className:"dk-admin-button",isBusy:m.runDiagnostics,disabled:m.runDiagnostics,onClick:()=>f("runDiagnostics","run-diagnostics"),children:m.runDiagnostics?(0,ua.__)("Running Diagnostics…","dokan-kits"):(0,ua.__)("Run System Check","dokan-kits")})})]}),(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-md",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-media-text dk-mr-wp-2 dk-text-primary-600"}),(0,ua.__)("Debug Logs","dokan-kits")]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Generate and download comprehensive debug logs including system information, configuration, and error details for support purposes.","dokan-kits")}),g("downloadLogs")]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(r.Button,{variant:"primary",className:"dk-admin-button",isBusy:m.downloadLogs,disabled:m.downloadLogs,onClick:async()=>{k((e=>({...e,downloadLogs:!0})));try{const e=await Us()({path:"/dokan-kits/v1/tools/download-logs",method:"POST"});if(!e.success||!e.data)throw new Error(e.message||(0,ua.__)("Failed to prepare log file.","dokan-kits"));{const{file_url:t,file_name:a,file_size:r}=e.data,s=document.createElement("a");s.href=t,s.download=a,s.target="_blank",document.body.appendChild(s),s.click(),document.body.removeChild(s),l((t=>({...t,downloadLogs:{success:!0,message:e.message,data:e.data,timestamp:(new Date).toISOString()}}))),h((0,ua.__)(`Log file prepared for download: ${a} (${r})`,"dokan-kits"),"success")}}catch(e){l((t=>({...t,downloadLogs:{success:!1,message:e.message,timestamp:(new Date).toISOString()}}))),h(e.message||(0,ua.__)("Failed to download logs.","dokan-kits"),"error")}finally{k((e=>({...e,downloadLogs:!1})))}},children:m.downloadLogs?(0,ua.__)("Preparing Download…","dokan-kits"):(0,ua.__)("Download Debug Logs","dokan-kits")})})]})]})]}),(0,br.jsx)("div",{className:"dk-mt-wp-10 dk-p-wp-6 dk-bg-yellow-50 dk-rounded-lg dk-border dk-border-yellow-200",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-start",children:[(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-mr-wp-4",children:(0,br.jsx)("span",{className:"dashicons dashicons-info-outline dk-text-2xl dk-text-yellow-600"})}),(0,br.jsxs)("div",{children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-semibold dk-text-yellow-800 dk-mb-wp-2",children:(0,ua.__)("Need Help?","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-yellow-700 dk-mb-wp-3",children:(0,ua.__)("If you encounter issues while using these tools or need additional support, please visit our support forum or documentation. When contacting support, include your debug logs for faster assistance.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-flex dk-flex-wrap dk-gap-wp-3",children:[(0,br.jsxs)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-warning dk-inline-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-sos dk-mr-1"}),(0,ua.__)("Get Support","dokan-kits")]}),(0,br.jsxs)("a",{href:"https://wordpress.org/plugins/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-secondary dk-inline-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-book dk-mr-1"}),(0,ua.__)("Documentation","dokan-kits")]}),(0,br.jsxs)("a",{href:"https://github.com/getdokan/dokan-kits/issues",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-secondary dk-inline-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-github dk-mr-1"}),(0,ua.__)("Report Issue","dokan-kits")]})]}),(0,br.jsxs)("div",{className:"dk-mt-wp-4 dk-p-3 dk-bg-yellow-100 dk-rounded dk-border dk-border-yellow-300",children:[(0,br.jsx)("h4",{className:"dk-font-medium dk-text-yellow-800 dk-mb-2",children:(0,ua.__)("Before contacting support:","dokan-kits")}),(0,br.jsxs)("ul",{className:"dk-text-sm dk-text-yellow-700 dk-list-disc dk-list-inside dk-space-y-1",children:[(0,br.jsx)("li",{children:(0,ua.__)("Run system diagnostics to identify common issues","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Download debug logs to include with your support request","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Check if migrations are up to date","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Try recreating database tables if experiencing data issues","dokan-kits")})]})]})]})]})})]})},fn=ea([{path:"/",element:(0,br.jsx)(Os,{}),errorElement:(0,br.jsx)(yr,{}),children:[{index:!0,element:(0,br.jsx)(Ws,{})},{path:"features",element:(0,br.jsx)(mn,{})},{path:"about",element:(0,br.jsx)(Is,{})},{path:"tools",element:(0,br.jsx)(pn,{})}]},{path:"*",element:(0,br.jsx)(kn,{})}]);n()((()=>{const e=document.getElementById("dokan-kits-admin-root");if(!e)return;e.classList.add("dokan-kits-admin-page");const t=(0,o.createRoot)(e),a=window.Dokan_Kits?.initialPath||"/",s=ea(fn.routes,{initialEntries:[a]});t.render((0,br.jsx)(i.StrictMode,{children:(0,br.jsx)(r.SlotFillProvider,{children:(0,br.jsx)(Ls,{children:(0,br.jsx)(ca,{router:s})})})}))}))})();
     171`,xs=({reverseOrder:e,position:t="top-center",toastOptions:a,gutter:r,children:s,containerStyle:n,containerClassName:o})=>{let{toasts:d,handlers:l}=(e=>{let{toasts:t,pausedAt:a}=((e={})=>{let[t,a]=(0,i.useState)(Ur),r=(0,i.useRef)(Ur);(0,i.useEffect)((()=>(r.current!==Ur&&a(Ur),Br.push(a),()=>{let e=Br.indexOf(a);e>-1&&Br.splice(e,1)})),[]);let s=t.toasts.map((t=>{var a,r,s;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(a=e[t.type])?void 0:a.removeDelay)||(null==e?void 0:e.removeDelay),duration:t.duration||(null==(r=e[t.type])?void 0:r.duration)||(null==e?void 0:e.duration)||Wr[t.type],style:{...e.style,...null==(s=e[t.type])?void 0:s.style,...t.style}}}));return{...t,toasts:s}})(e);(0,i.useEffect)((()=>{if(a)return;let e=Date.now(),r=t.map((t=>{if(t.duration===1/0)return;let a=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(a<0))return setTimeout((()=>qr.dismiss(t.id)),a);t.visible&&qr.dismiss(t.id)}));return()=>{r.forEach((e=>e&&clearTimeout(e)))}}),[t,a]);let r=(0,i.useCallback)((()=>{a&&Hr({type:6,time:Date.now()})}),[a]),s=(0,i.useCallback)(((e,a)=>{let{reverseOrder:r=!1,gutter:s=8,defaultPosition:n}=a||{},o=t.filter((t=>(t.position||n)===(e.position||n)&&t.height)),i=o.findIndex((t=>t.id===e.id)),d=o.filter(((e,t)=>t<i&&e.visible)).length;return o.filter((e=>e.visible)).slice(...r?[d+1]:[0,d]).reduce(((e,t)=>e+(t.height||0)+s),0)}),[t]);return(0,i.useEffect)((()=>{t.forEach((e=>{if(e.dismissed)((e,t=1e3)=>{if(Yr.has(e))return;let a=setTimeout((()=>{Yr.delete(e),Hr({type:4,toastId:e})}),t);Yr.set(e,a)})(e.id,e.removeDelay);else{let t=Yr.get(e.id);t&&(clearTimeout(t),Yr.delete(e.id))}}))}),[t]),{toasts:t,handlers:{updateHeight:Kr,startPause:Gr,endPause:r,calculateOffset:s}}})(a);return i.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...n},className:o,onMouseEnter:l.startPause,onMouseLeave:l.endPause},d.map((a=>{let n=a.position||t,o=((e,t)=>{let a=e.includes("top"),r=a?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Fr()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(a?1:-1)}px)`,...r,...s}})(n,l.calculateOffset(a,{reverseOrder:e,gutter:r,defaultPosition:t}));return i.createElement(ps,{id:a.id,key:a.id,onHeightUpdate:l.updateHeight,className:a.visible?fs:"",style:o},"custom"===a.type?Ar(a.message,a):s?s(a):i.createElement(hs,{toast:a,position:n}))})))},gs=qr;const bs=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,((e,t,a)=>a?a.toUpperCase():t.toLowerCase())))(e);return t.charAt(0).toUpperCase()+t.slice(1)},ys=(...e)=>e.filter(((e,t,a)=>Boolean(e)&&""!==e.trim()&&a.indexOf(e)===t)).join(" ").trim(),ws=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var vs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const js=(0,i.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:s="",children:n,iconNode:o,...d},l)=>(0,i.createElement)("svg",{ref:l,...vs,width:t,height:t,stroke:e,strokeWidth:r?24*Number(a)/Number(t):a,className:ys("lucide",s),...!n&&!ws(d)&&{"aria-hidden":"true"},...d},[...o.map((([e,t])=>(0,i.createElement)(e,t))),...Array.isArray(n)?n:[n]]))),Ns=(e,t)=>{const a=(0,i.forwardRef)((({className:a,...r},s)=>{return(0,i.createElement)(js,{ref:s,iconNode:t,className:ys(`lucide-${n=bs(e),n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...r});var n}));return a.displayName=bs(e),a},_s=Ns("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Cs=Ns("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Ss=Ns("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Es=Ns("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Rs=Ns("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ds=({t:e,message:t,type:a,onClose:r,showCloseButton:s=!0})=>{const n={success:(0,br.jsx)(_s,{className:"dk-w-wp-5 dk-h-wp-5 dk-text-primary-600"}),error:(0,br.jsx)(Cs,{className:"dk-w-wp-5 dk-h-wp-5 dk-text-red-500"}),warning:(0,br.jsx)(Ss,{className:"dk-w-wp-5 dk-h-wp-5 dk-text-yellow-500"}),info:(0,br.jsx)(Es,{className:"dk-w-wp-5 dk-h-wp-5 dk-text-blue-500"})};return(0,br.jsxs)("div",{className:gr("dk-flex dk-items-start dk-p-wp-4 dk-rounded-md dk-border dk-shadow-wp-card dk-min-w-[320px] dk-max-w-md","dk-transform dk-transition-all dk-duration-300 dk-ease-in-out",{success:"dk-border-primary-200 dk-bg-primary-50",error:"dk-border-red-200 dk-bg-red-50",warning:"dk-border-yellow-200 dk-bg-yellow-50",info:"dk-border-blue-200 dk-bg-blue-50"}[a],e.visible?"dk-animate-in dk-slide-in-from-top-2 dk-fade-in":"dk-animate-out dk-slide-out-to-top-2 dk-fade-out"),children:[(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-mr-wp-3",children:n[a]}),(0,br.jsx)("div",{className:"dk-flex-1 dk-min-w-0",children:(0,br.jsx)("div",{className:gr("dk-text-admin-sm dk-font-medium dk-leading-5",{success:"dk-text-primary-800",error:"dk-text-red-800",warning:"dk-text-yellow-800",info:"dk-text-blue-800"}[a]),children:t})}),s&&(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-ml-wp-4",children:(0,br.jsx)("button",{type:"button",className:gr("dk-inline-flex dk-rounded-md dk-p-1.5 dk-transition-colors dk-focus:outline-none dk-focus:ring-2 dk-focus:ring-offset-2",{success:"dk-text-primary-400 hover:dk-text-primary-500 dk-focus:ring-primary-600",error:"dk-text-red-400 hover:dk-text-red-500 dk-focus:ring-red-600",warning:"dk-text-yellow-400 hover:dk-text-yellow-500 dk-focus:ring-yellow-600",info:"dk-text-blue-400 hover:dk-text-blue-500 dk-focus:ring-blue-600"}[a]),onClick:r,"aria-label":(0,ua.__)("Dismiss notification","dokan-kits"),children:(0,br.jsx)(Rs,{className:"dk-w-wp-4 dk-h-wp-4"})})})]})},Ps="success",Ts="error",Ms=(0,o.createContext)({notices:[],addNotice:()=>{},removeNotice:()=>{},clearNotices:()=>{}}),Ls=({children:e})=>{const[t,a]=(0,o.useState)([]),r=(0,o.useCallback)(((e,t="info",r={})=>{const s=`notice-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,{isDismissible:n=!0,duration:o=5e3,position:i="top-right"}=r,d={id:s,message:e,type:t,isDismissible:n,duration:o,position:i,timestamp:Date.now()};return a((a=>{const r=a.find((a=>a.message===e&&a.type===t));return r?a:[...a,d]})),s}),[]),s={notices:t,addNotice:r,removeNotice:(0,o.useCallback)((e=>{a((t=>t.filter((t=>t.id!==e))))}),[]),clearNotices:(0,o.useCallback)((()=>{a([])}),[])};return(0,br.jsx)(Ms.Provider,{value:s,children:e})},$s=()=>{const e=(0,o.useContext)(Ms);if(void 0===e)throw new Error("useNotices must be used within a NoticesProvider");return e},zs=()=>{const{notices:e,removeNotice:t}=$s(),a=(0,o.useRef)(new Set);return(0,o.useEffect)((()=>{e.forEach((e=>{if(a.current.has(e.id))return;a.current.add(e.id);let r=e.duration||5e3;"error"===e.type&&(r=e.duration||8e3),e.isDismissible||(r=1/0),gs.custom((r=>(0,br.jsx)(Ds,{t:r,message:e.message,type:e.type,onClose:()=>{gs.dismiss(r.id),t(e.id),a.current.delete(e.id)}})),{id:e.id,duration:r,position:e.position||"top-right"}),e.isDismissible&&r!==1/0&&setTimeout((()=>{t(e.id),a.current.delete(e.id)}),r)}));const r=new Set(e.map((e=>e.id)));for(const e of a.current)r.has(e)||a.current.delete(e)}),[e,t]),(0,o.useEffect)((()=>()=>{a.current.clear()}),[]),(0,br.jsx)(xs,{position:"top-right",gutter:12,containerClassName:"dk-toast-container",containerStyle:{top:"var(--wp-admin--admin-bar--height, 46px)"},toastOptions:{className:"dk-toast",duration:5e3,style:{background:"transparent",boxShadow:"none",padding:0}}})},As=a.p+"images/dokan-kits-logo.png",Os=()=>{const e=dt(),t="loading"===yt("useNavigation").navigation.state,a=window.Dokan_Kits||{};(0,o.useEffect)((()=>{const t={"/":(0,ua.__)("Dashboard","dokan-kits"),"/features":(0,ua.__)("Features","dokan-kits"),"/about":(0,ua.__)("About","dokan-kits"),"/tools":(0,ua.__)("Tools","dokan-kits"),"/tailwind-demo":(0,ua.__)("Tailwind Merge Demo","dokan-kits")}[e.pathname];if(document.title=(0,ua.sprintf)(/* translators: %s: Page title */ /* translators: %s: Page title */
     172(0,ua.__)("%s - Dokan Kits","dokan-kits"),null!=t?t:(0,ua.__)("Dashboard","dokan-kits")),"undefined"!=typeof document){const t=document.querySelectorAll("#toplevel_page_dokan-kits .wp-submenu li");t.forEach((e=>{e.classList.remove("current")}));const a={"/":1,"/features":2,"/about":3,"/tools":4,"/tailwind-demo":5}[e.pathname];void 0!==a&&t[a]&&t[a].classList.add("current")}}),[e]);const r=({isActive:e})=>gr("dk-inline-flex dk-items-center dk-px-wp-1 dk-py-wp-4 dk-text-sm dk-font-medium dk-border-b-2 !dk-shadow-none !dk-outline-none",e?"dk-border-primary-500 dk-text-primary-600":"dk-border-transparent dk-text-gray-500 hover:dk-text-gray-700 hover:dk-border-gray-300");return(0,br.jsxs)("div",{className:"dokan-kits-app-wrapper",children:[(0,br.jsx)("div",{className:"dokan-kits-app-header dk-bg-white dk-border-b dk-border-gray-200 dk-mb-wp-6",children:(0,br.jsxs)("div",{className:"dk-container dk-mx-auto dk-px-wp-4",children:[(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-justify-between dk-pt-wp-4",children:[(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)("img",{src:As,alt:"Dokan Kits",className:"dk-h-20 dk-w-auto dk-mr-wp-3"}),(0,br.jsx)("h1",{className:"dk-text-xl dk-font-medium dk-text-gray-900",children:(0,ua.__)("Dokan Kits","dokan-kits")})]}),(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-space-x-wp-2",children:[(0,br.jsx)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/#new-topic-0",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-secondary dk-text-sm",children:(0,ua.__)("Support","dokan-kits")}),(0,br.jsx)("a",{href:"https://wordpress.org/plugins/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-secondary dk-text-sm",children:(0,ua.__)("Documentation","dokan-kits")})]})]}),(0,br.jsxs)("nav",{className:"dk-flex dk-space-x-wp-6 dk--mb-px",children:[(0,br.jsxs)(na,{to:"/",end:!0,className:r,children:[(0,br.jsx)("span",{className:"dashicons dashicons-dashboard dk-mr-wp-2"}),(0,ua.__)("Dashboard","dokan-kits")]}),(0,br.jsxs)(na,{to:"/features",className:r,children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-settings dk-mr-wp-2"}),(0,ua.__)("Features","dokan-kits")]}),(0,br.jsxs)(na,{to:"/about",className:r,children:[(0,br.jsx)("span",{className:"dashicons dashicons-info dk-mr-wp-2"}),(0,ua.__)("About","dokan-kits")]}),(0,br.jsxs)(na,{to:"/tools",className:r,children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-tools dk-mr-wp-2"}),(0,ua.__)("Tools","dokan-kits")]})]})]})}),(0,br.jsxs)("div",{className:"dokan-kits-app-content dk-container dk-mx-auto dk-px-wp-4 dk-pb-wp-8",children:[(0,br.jsx)(zs,{}),(0,br.jsx)("div",{className:"dk-route-transition",children:t?(0,br.jsx)(wr,{message:(0,ua.__)("Loading content…","dokan-kits")}):(0,br.jsx)(Tt,{})})]}),(0,br.jsx)("div",{className:"dokan-kits-app-footer dk-mt-wp-12 dk-py-wp-6 dk-border-t dk-border-gray-200 dk-text-center dk-text-sm dk-text-gray-500",children:(0,br.jsxs)("p",{children:[(0,ua.__)("Dokan Kits","dokan-kits")," ",a.version||"3.0.0"," | ",(0,ua.__)("Made with","dokan-kits")," ❤️ ",(0,ua.__)("by","dokan-kits"),(0,br.jsx)("a",{href:"https://profiles.wordpress.org/wpintegrity/",target:"_blank",rel:"noopener noreferrer",className:"dk-text-primary-600 hover:dk-text-primary-800 dk-ml-wp-1",children:"WPIntegrity"})]})})]})},Fs=()=>{const e=({className:e})=>(0,br.jsx)("div",{className:`dk-animate-pulse dk-bg-gray-200 dk-rounded ${e}`}),t=()=>(0,br.jsx)(r.Card,{className:"dk-mb-wp-6",children:(0,br.jsxs)(r.CardBody,{className:"dk-text-center dk-py-wp-8",children:[(0,br.jsx)(e,{className:"dk-mx-auto dk-h-24 dk-w-24 dk-mb-wp-4"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-10 dk-w-1/2 dk-mb-wp-3"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-5 dk-w-3/4 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-5 dk-w-2/3 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-5 dk-w-1/2 dk-mb-wp-6"}),(0,br.jsxs)("div",{className:"dk-flex dk-flex-wrap dk-justify-center dk-gap-wp-4",children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-28"}),(0,br.jsx)(e,{className:"dk-h-8 dk-w-36"}),(0,br.jsx)(e,{className:"dk-h-8 dk-w-32"})]})]})}),a=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-1/4 dk-mb-wp-4"}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6 dk-mb-wp-8",children:Array(2).fill().map(((t,a)=>(0,br.jsxs)(r.Card,{children:[(0,br.jsx)(r.CardBody,{className:"dk-p-6",children:(0,br.jsxs)("div",{className:"dk-flex dk-flex-col md:dk-flex-row dk-items-start",children:[(0,br.jsx)(e,{className:"dk-h-16 dk-w-16 dk-mb-wp-4 md:dk-mb-0 md:dk-mr-wp-5"}),(0,br.jsxs)("div",{className:"dk-flex-grow dk-w-full",children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-3/4 dk-mb-wp-3"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4"})]})]})}),(0,br.jsx)(r.CardFooter,{className:"dk-p-5 dk-bg-gray-50 dk-border-t dk-border-gray-200 dk-flex dk-justify-end",children:(0,br.jsx)(e,{className:"dk-h-10 dk-w-32"})})]},a)))})]}),s=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-1/4 dk-mb-wp-4"}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6 dk-mb-wp-8",children:Array(4).fill().map(((t,a)=>(0,br.jsxs)(r.Card,{children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsx)(e,{className:"dk-h-6 dk-w-1/2"})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4 dk-mb-wp-4"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-36"})]})]},a)))})]}),n=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-1/4 dk-mb-wp-4"}),(0,br.jsxs)(r.Card,{children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsx)(e,{className:"dk-h-6 dk-w-1/4"})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("div",{className:"dk-space-y-wp-4",children:Array(3).fill().map(((t,a)=>(0,br.jsxs)("div",{className:"dk-mb-wp-6",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-1/3 dk-mb-wp-3"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4"})]},a)))}),(0,br.jsx)("div",{className:"dk-mt-wp-4 dk-pt-wp-4 dk-border-t dk-border-gray-200",children:(0,br.jsx)(e,{className:"dk-h-6 dk-w-1/4"})})]})]})]});return(0,br.jsxs)("div",{className:"dokan-kits-about-page-skeleton dk-p-6",children:[(0,br.jsx)(t,{}),(0,br.jsx)(a,{}),(0,br.jsx)(s,{}),(0,br.jsx)(n,{})]})},Is=()=>{const[e,t]=(0,o.useState)(!0);if((0,o.useEffect)((()=>{const e=setTimeout((()=>{t(!1)}),300);return()=>clearTimeout(e)}),[]),e)return(0,br.jsx)(Fs,{});const a=[],s=[{title:(0,ua.__)("Vendor Product Video Gallery","dokan-kits"),description:(0,ua.__)("Allow vendors to upload product videos to showcase their products better in your Dokan marketplace. Support multiple video formats and customize playback options.","dokan-kits"),icon:"format-video",image:"https://wpintegrity.com/wp-content/uploads/2025/06/Dokan-Kits-Vendor-Product-Video-Gallery_big.png",status:(0,ua.__)("Live","dokan-kits"),url:"https://wpintegrity.com/dokan-kits-vendor-product-video-gallery/"},{title:(0,ua.__)("Vendor Product Image Upload Limit","dokan-kits"),description:(0,ua.__)("Control and limit product image uploads for vendors in your Dokan marketplace. Set image dimensions, file sizes, and maximum upload limits to maintain quality and performance.","dokan-kits"),icon:"format-gallery",image:"https://wpintegrity.com/wp-content/uploads/2025/06/Dokan-Kits-Vendor-Product-Image-Upload-Limit_big-1.png",status:(0,ua.__)("Live","dokan-kits"),url:"https://wpintegrity.com/dokan-kits-vendor-product-image-upload-limit/"},{title:(0,ua.__)("Vendor Product Bundles","dokan-kits"),description:(0,ua.__)("Allow vendors to add and sell bundle products from their frontend vendor dashboard.","dokan-kits"),icon:"format-gallery",image:"https://wpintegrity.com/wp-content/uploads/2025/06/dokan-product-bundle@2x-768x593-1-300x295.png",status:(0,ua.__)("Live","dokan-kits"),url:"https://wpintegrity.com/products/dokan-kits-vendor-product-bundles/"}],n=[{title:(0,ua.__)("Support","dokan-kits"),description:(0,ua.__)("Need help with Dokan Kits? Visit our support forum to get assistance from our team and community.","dokan-kits"),buttonText:(0,ua.__)("Visit Support Forum","dokan-kits"),buttonUrl:"https://wordpress.org/support/plugin/dokan-kits/",icon:"sos"},{title:(0,ua.__)("Documentation","dokan-kits"),description:(0,ua.__)("Check our documentation for detailed guides, tutorials, and reference materials.","dokan-kits"),buttonText:(0,ua.__)("View Documentation","dokan-kits"),buttonUrl:"https://wordpress.org/plugins/dokan-kits/",icon:"book"},{title:(0,ua.__)("Feature Requests","dokan-kits"),description:(0,ua.__)("Have ideas to improve Dokan Kits? Submit your feature requests and help us make the plugin better.","dokan-kits"),buttonText:(0,ua.__)("Submit Request","dokan-kits"),buttonUrl:"https://github.com/wpintegrity/feedback/issues/new",icon:"lightbulb"},{title:(0,ua.__)("Video Tutorials","dokan-kits"),description:(0,ua.__)("Learn how to use Dokan Kits effectively with our step-by-step video tutorials and guides.","dokan-kits"),buttonText:(0,ua.__)("Watch Tutorials","dokan-kits"),buttonUrl:"#",icon:"video-alt3"}],i=[{version:"3.0.2",releaseDate:"June 30, 2025",changes:[(0,ua.__)("Improved UI for ErrorBoundary: centered Dashicon error icon, modern layout","dokan-kits"),(0,ua.__)("Refactored Not Found page for consistent, professional UI","dokan-kits"),(0,ua.__)("Updated Tools page with hero/title section and card-based layout","dokan-kits"),(0,ua.__)("Ensured Tools REST controller is registered and follows best practices","dokan-kits"),(0,ua.__)("General UI/UX consistency improvements across admin pages","dokan-kits")]},{version:"3.0.1",releaseDate:"June 24, 2025",changes:[(0,ua.__)("Fixed a critical issue with setting data store","dokan-kits")]},{version:"3.0.0",releaseDate:"June 23, 2025",changes:[(0,ua.__)("Complete plugin restructuring with modern architecture","dokan-kits"),(0,ua.__)("New React-based admin interface with Tailwind CSS","dokan-kits"),(0,ua.__)("Improved REST API for features management","dokan-kits"),(0,ua.__)("Enhanced extensibility with service providers","dokan-kits"),(0,ua.__)("Added React Router for better admin navigation","dokan-kits")]}],d=()=>(0,br.jsx)(r.Card,{className:"dk-mb-wp-6",children:(0,br.jsxs)(r.CardBody,{className:"dk-text-center dk-py-wp-8",children:[(0,br.jsx)("img",{src:As,alt:"Dokan Kits",className:"dk-mx-auto dk-h-24 dk-w-auto dk-mb-wp-4"}),(0,br.jsx)("h1",{className:"dk-text-3xl dk-font-bold dk-text-gray-900 dk-mb-wp-3",children:(0,ua.__)("Welcome to Dokan Kits","dokan-kits")}),(0,br.jsx)("p",{className:"dk-max-w-2xl dk-mx-auto dk-text-lg dk-text-gray-600 dk-mb-wp-3",children:(0,ua.__)("The essential toolkit to supercharge your Dokan-powered marketplace with advanced features for vendors and administrators.","dokan-kits")}),(0,br.jsx)("p",{className:"dk-max-w-2xl dk-mx-auto dk-text-base dk-text-gray-500",children:(0,ua.__)("Enhance product management, streamline vendor operations, and improve the overall marketplace experience with our carefully crafted extensions.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-mt-wp-6 dk-flex dk-flex-wrap dk-justify-center dk-gap-wp-4",children:[(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-primary-100 dk-text-primary-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-tag dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Version","dokan-kits"),": ",Dokan_Kits?.version||"3.0.0"]}),(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-green-100 dk-text-green-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-chart-area dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Active Installations","dokan-kits"),": 500+"]}),(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-blue-100 dk-text-blue-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-calendar dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Last Updated","dokan-kits"),": ",i[0]?.releaseDate||"June 23, 2025"]})]})]})}),l=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Advanced Features","dokan-kits")}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6 dk-mb-wp-8",children:s.map(((e,t)=>(0,br.jsxs)(r.Card,{className:"dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-lg",children:[(0,br.jsx)(r.CardBody,{className:"w-full dk-p-6",children:(0,br.jsxs)("div",{className:"dk-flex dk-flex-col md:dk-flex-row dk-items-start",children:[(0,br.jsx)("img",{src:e.image,alt:e.title,className:"dk-h-16 dk-w-16 dk-rounded-lg dk-mb-wp-4 md:dk-mb-0 md:dk-mr-wp-5"}),(0,br.jsxs)("div",{className:"dk-flex-grow",children:[(0,br.jsx)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-mb-wp-3",children:e.title}),(0,br.jsx)("p",{className:"dk-text-gray-600 dk-leading-relaxed",children:e.description})]})]})}),(0,br.jsx)(r.CardFooter,{className:"dk-p-5 dk-bg-gray-50 dk-border-t dk-border-gray-200 dk-flex dk-flex-col md:dk-flex-row md:dk-justify-end md:dk-items-center",children:(0,br.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button",children:[(0,ua.__)("Explore Now","dokan-kits"),(0,br.jsx)("span",{className:"dashicons dashicons-arrow-right-alt dk-ml-wp-1 dk-text-sm"})]})})]},t)))})]}),c=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Contributors","dokan-kits")}),(0,br.jsx)(r.Card,{className:"dk-mb-wp-8",children:(0,br.jsx)(r.CardBody,{children:(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 lg:dk-grid-cols-3 dk-gap-wp-6",children:a.map(((e,t)=>(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-space-x-wp-4",children:[(0,br.jsx)("img",{src:e.avatar,alt:e.name,className:"dk-h-14 dk-w-14 dk-rounded-full"}),(0,br.jsxs)("div",{children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-medium dk-text-gray-900",children:e.name}),(0,br.jsx)("p",{className:"dk-text-sm dk-text-gray-600 dk-mb-wp-1",children:e.role}),(0,br.jsx)("a",{href:e.profile,target:"_blank",rel:"noopener noreferrer",className:"dk-text-sm dk-text-primary-600 hover:dk-text-primary-800",children:(0,ua.__)("WordPress.org Profile","dokan-kits")})]})]},t)))})})})]}),u=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Getting Help","dokan-kits")}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6 dk-mb-wp-8",children:n.map(((e,t)=>(0,br.jsxs)(r.Card,{children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-lg dk-font-medium dk-text-gray-900 dk-flex dk-items-center",children:[e.icon&&(0,br.jsx)("span",{className:`dashicons dashicons-${e.icon} dk-mr-wp-2 dk-text-primary-600`}),e.title]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:e.description}),(0,br.jsx)("a",{href:e.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button",children:e.buttonText})]})]},t)))})]}),m=()=>(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Latest Changes","dokan-kits")}),(0,br.jsxs)(r.Card,{children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsx)("h3",{className:"dk-text-lg dk-font-medium dk-text-gray-900",children:(0,ua.__)("Changelog","dokan-kits")})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("div",{className:"dk-space-y-wp-4",children:i.map(((e,t)=>(0,br.jsxs)("div",{children:[(0,br.jsxs)("h4",{className:"dk-text-md dk-font-medium dk-text-gray-900",children:[(0,ua.__)("Version","dokan-kits")," ",e.version,(0,br.jsxs)("span",{className:"dk-ml-wp-2 dk-text-sm dk-text-gray-500",children:["- ",(0,ua.__)("Released on","dokan-kits")," ",e.releaseDate]})]}),(0,br.jsx)("ul",{className:"dk-list-disc dk-list-inside dk-text-gray-600 dk-mt-wp-2 dk-space-y-wp-1",children:e.changes.map(((e,t)=>(0,br.jsx)("li",{children:e},t)))})]},t)))}),(0,br.jsx)("div",{className:"dk-mt-wp-4 dk-pt-wp-4 dk-border-t dk-border-gray-200",children:(0,br.jsxs)("a",{href:"https://wordpress.org/plugins/dokan-kits/changelog/",target:"_blank",rel:"noopener noreferrer",className:"dk-text-primary-600 hover:dk-text-primary-800 dk-inline-flex dk-items-center",children:[(0,ua.__)("View full changelog","dokan-kits"),(0,br.jsx)("span",{className:"dashicons dashicons-arrow-right-alt dk-ml-wp-1 dk-text-sm"})]})})]})]})]});return(0,br.jsxs)("div",{className:"dokan-kits-about-page",children:[(0,br.jsx)(d,{}),(0,br.jsx)(l,{}),a.length>0&&(0,br.jsx)(c,{}),(0,br.jsx)(u,{}),(0,br.jsx)(m,{})]})},Bs=window.wp.apiFetch;var Us=a.n(Bs);const Hs=()=>{const e=({className:e})=>(0,br.jsx)("div",{className:`dk-animate-pulse dk-bg-gray-200 dk-rounded ${e}`}),t=()=>(0,br.jsx)("div",{className:"dk-admin-card dk-bg-gradient-to-r dk-from-primary-50 dk-to-secondary-50 dk-border-l-4 dk-border-primary-500 dk-mb-wp-6",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-mr-wp-4",children:(0,br.jsx)(e,{className:"dk-w-16 dk-h-16 dk-rounded"})}),(0,br.jsxs)("div",{className:"dk-flex-grow",children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-64 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-max-w-2xl"})]})]})}),a=()=>(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 dk-gap-wp-6",children:(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-3 dk-gap-wp-4",children:Array(3).fill().map(((t,a)=>(0,br.jsx)("div",{className:"dk-admin-card dk-border-t-4 dk-border-primary-500 dk-bg-primary-50",children:(0,br.jsxs)("div",{className:"dk-flex dk-justify-between dk-items-center",children:[(0,br.jsxs)("div",{children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-32 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-8 dk-w-16"})]}),(0,br.jsx)("div",{className:"dk-rounded-full dk-w-12 dk-h-12 dk-flex dk-items-center dk-justify-center dk-bg-white dk-border dk-border-gray-200",children:(0,br.jsx)(e,{className:"dk-w-6 dk-h-6 dk-rounded"})})]})},a)))})}),r=()=>(0,br.jsxs)("div",{className:"dk-admin-card",children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-48 dk-border-b dk-border-gray-200 dk-pb-wp-3 dk-mb-wp-4"}),(0,br.jsxs)("div",{children:[(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-4"}),(0,br.jsx)("div",{className:"dk-space-y-wp-3",children:Array(4).fill().map(((t,a)=>(0,br.jsx)(e,{className:"dk-h-9 dk-w-full dk-rounded-md"},a)))})]})]}),s=()=>(0,br.jsxs)("div",{className:"dk-admin-card",children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-64 dk-border-b dk-border-gray-200 dk-pb-wp-3 dk-mb-wp-4"}),(0,br.jsxs)("div",{children:[(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-4"}),(0,br.jsx)("ul",{className:"dk-space-y-wp-3",children:Array(3).fill().map(((t,a)=>(0,br.jsx)("li",{children:(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)("div",{className:"dk-w-8 dk-h-8 dk-rounded-full dk-bg-primary-100 dk-flex dk-items-center dk-justify-center dk-mr-wp-2",children:(0,br.jsx)(e,{className:"dk-w-4 dk-h-4 dk-rounded"})}),(0,br.jsx)(e,{className:"dk-h-5 dk-w-32"})]})},a)))}),(0,br.jsxs)("div",{className:"dk-mt-wp-6 dk-p-wp-3 dk-bg-yellow-50 dk-rounded-md dk-border dk-border-yellow-200",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-flex dk-items-center dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-3"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-full dk-rounded-md"})]})]})]}),n=()=>(0,br.jsx)("div",{className:"dk-fixed dk-inset-0 dk-bg-black dk-bg-opacity-50 dk-flex dk-items-center dk-justify-center",style:{display:"none"},children:(0,br.jsx)("div",{className:"dk-bg-white dk-rounded-lg dk-max-w-xl dk-w-full dk-mx-4",children:(0,br.jsxs)("div",{className:"dk-p-6",children:[(0,br.jsxs)("div",{className:"dk-flex dk-justify-between dk-items-center dk-mb-4",children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-48"}),(0,br.jsx)("div",{className:"dk-w-8 dk-h-8 dk-rounded-full dk-bg-gray-100 dk-flex dk-items-center dk-justify-center",children:(0,br.jsx)(e,{className:"dk-w-4 dk-h-4 dk-rounded"})})]}),(0,br.jsxs)("div",{className:"dk-mb-6",children:[(0,br.jsx)("div",{className:"dk-flex dk-justify-center dk-mb-4",children:(0,br.jsx)(e,{className:"dk-w-16 dk-h-16 dk-rounded-full"})}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-4"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-2"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-full dk-rounded dk-mb-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4"})]}),(0,br.jsxs)("div",{className:"dk-flex dk-justify-end dk-space-x-3",children:[(0,br.jsx)(e,{className:"dk-h-10 dk-w-24 dk-rounded"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-24 dk-rounded"})]})]})})});return(0,br.jsxs)("div",{className:"dokan-kits-admin-page dk-p-6",children:[(0,br.jsx)(t,{}),(0,br.jsx)(a,{}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 lg:dk-grid-cols-3 dk-gap-wp-6 dk-mt-wp-6",children:[(0,br.jsx)(r,{}),(0,br.jsx)("div",{className:"lg:dk-col-span-2",children:(0,br.jsx)(s,{})})]}),(0,br.jsx)(n,{})]})},Ws=()=>{const[e,t]=(0,o.useState)(!0),[a,s]=(0,o.useState)(!1),[n,i]=(0,o.useState)(!1),[d,l]=(0,o.useState)(!1),[c,u]=(0,o.useState)(!1),[m,k]=(0,o.useState)(!1),[h,p]=(0,o.useState)("all"),[f,x]=(0,o.useState)(null),g=(0,o.useRef)(null),[b,y]=(0,o.useState)({active_features_count:0,total_settings_count:0,dokan_version:"",url:""}),{addNotice:w}=$s();if((0,o.useEffect)((()=>{(async()=>{try{t(!0);const e=await Us()({path:"/dokan-kits/v1/dashboard"});if(!e.success)throw new Error(e.message||(0,ua.__)("Invalid response from the server","dokan-kits"));const a=e.data?.statistics||{};y({active_features_count:a.active_features?.value||0,total_settings_count:a.total_features?.value||0,dokan_version:a.dokan_version?.value||(0,ua.__)("Not Detected","dokan-kits"),url:window.location.href})}catch(e){w(e.message||(0,ua.__)("Failed to fetch dashboard data","dokan-kits"),"error")}finally{t(!1)}})()}),[]),e)return(0,br.jsx)(Hs,{});const v=()=>{k(!1),x(null),g.current&&(g.current.value="")},j=()=>{u(!1)};return e?(0,br.jsx)(Hs,{}):(0,br.jsxs)("div",{className:"dokan-kits-admin-page",children:[(0,br.jsx)("div",{className:"dk-admin-card dk-bg-gradient-to-r dk-from-primary-50 dk-to-secondary-50 dk-border-l-4 dk-border-primary-500 dk-mb-wp-6",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-mr-wp-4",children:(0,br.jsx)("img",{src:As,alt:"Dokan Kits",className:"dk-w-16 dk-h-16"})}),(0,br.jsxs)("div",{children:[(0,br.jsx)("h2",{className:"dk-text-xl dk-font-medium dk-text-gray-900",children:(0,ua.__)("Welcome to Dokan Kits","dokan-kits")}),(0,br.jsxs)("p",{className:"dk-mt-1 dk-text-sm dk-text-gray-600",children:[(0,ua.__)("You are running version","dokan-kits")," ",(0,br.jsx)("span",{className:"dk-font-medium",children:Dokan_Kits.version}),".",(0,ua.__)("Enhance your Dokan-powered marketplace with powerful tools and customizations.","dokan-kits")]})]})]})}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 dk-gap-wp-6",children:[(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-3 dk-gap-wp-4",children:[(0,br.jsx)("div",{className:"dk-admin-card dk-border-t-4 dk-border-primary-500 dk-bg-primary-50",children:(0,br.jsxs)("div",{className:"dk-flex dk-justify-between dk-items-center",children:[(0,br.jsxs)("div",{children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-medium",children:(0,ua.__)("Total Features","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-2xl dk-font-bold dk-mt-1",children:b.total_settings_count})]}),(0,br.jsx)("div",{className:"dk-rounded-full dk-w-12 dk-h-12 dk-flex dk-items-center dk-justify-center dk-bg-white dk-border dk-border-gray-200",children:(0,br.jsx)("span",{className:"dashicons dashicons-admin-plugins dk-text-primary-500"})})]})}),(0,br.jsx)("div",{className:"dk-admin-card dk-border-t-4 dk-border-secondary-500 dk-bg-secondary-50",children:(0,br.jsxs)("div",{className:"dk-flex dk-justify-between dk-items-center",children:[(0,br.jsxs)("div",{children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-medium",children:(0,ua.__)("Total Active Features","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-2xl dk-font-bold dk-mt-1",children:b.active_features_count})]}),(0,br.jsx)("div",{className:"dk-rounded-full dk-w-12 dk-h-12 dk-flex dk-items-center dk-justify-center dk-bg-white dk-border dk-border-gray-200",children:(0,br.jsx)("span",{className:"dashicons dashicons-admin-generic dk-text-secondary-500"})})]})}),(0,br.jsx)("div",{className:"dk-admin-card dk-border-t-4 dk-border-green-500 dk-bg-green-50",children:(0,br.jsxs)("div",{className:"dk-flex dk-justify-between dk-items-center",children:[(0,br.jsxs)("div",{children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-medium",children:(0,ua.__)("Dokan Version","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-2xl dk-font-bold dk-mt-1",children:b.dokan_version})]}),(0,br.jsx)("div",{className:"dk-rounded-full dk-w-12 dk-h-12 dk-flex dk-items-center dk-justify-center dk-bg-white dk-border dk-border-gray-200",children:(0,br.jsx)("span",{className:"dashicons dashicons-admin-tools dk-text-green-500"})})]})})]}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 lg:dk-grid-cols-3 dk-gap-wp-6",children:[(0,br.jsxs)("div",{className:"dk-admin-card",children:[(0,br.jsx)("h2",{className:"dk-text-lg dk-font-medium dk-border-b dk-border-gray-200 dk-pb-wp-3 dk-mb-wp-4",children:(0,ua.__)("Settings Management","dokan-kits")}),(0,br.jsxs)("div",{children:[(0,br.jsx)("p",{className:"dk-text-sm dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Manage your Dokan Kits features with these options:","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-space-y-wp-3",children:[(0,br.jsxs)(r.Button,{href:`${Dokan_Kits.adminUrl}?page=dokan-kits#/features`,variant:"primary",className:"dk-admin-button dk-w-full dk-justify-center dk-h-9",children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-settings dk-mr-2"}),(0,ua.__)("Configure Settings","dokan-kits")]}),(0,br.jsxs)(r.Button,{variant:"secondary",onClick:async()=>{try{l(!0),w((0,ua.__)("Preparing export file…","dokan-kits"),"info");const e=await Us()({path:"/dokan-kits/v1/dashboard/export",method:"GET"});if(!e||!e.data)throw new Error((0,ua.__)("No data received from the server.","dokan-kits"));{const t=new Blob([JSON.stringify(e.data.data,null,2)],{type:"application/json"}),a=window.URL.createObjectURL(t),r=document.createElement("a");r.href=a;const s=(new Date).toISOString().split("T")[0];r.download=`dokan-kits-settings-${s}.json`,document.body.appendChild(r),r.click(),window.URL.revokeObjectURL(a),document.body.removeChild(r),w((0,ua.__)("Settings exported successfully.","dokan-kits"),"success")}}catch(e){w(e.message||(0,ua.__)("Failed to export settings. Please try again.","dokan-kits"),"error")}finally{l(!1)}},disabled:d,className:"dk-admin-button dk-admin-button-secondary dk-w-full dk-justify-center dk-h-9",children:[(0,br.jsx)("span",{className:"dashicons dashicons-download dk-mr-2"}),d?(0,ua.__)("Exporting…","dokan-kits"):(0,ua.__)("Export Settings","dokan-kits")]}),(0,br.jsxs)(r.Button,{variant:"secondary",onClick:()=>{k(!0)},className:"dk-admin-button dk-admin-button-secondary dk-w-full dk-justify-center dk-h-9",children:[(0,br.jsx)("span",{className:"dashicons dashicons-upload dk-mr-2"}),(0,ua.__)("Import Settings","dokan-kits")]}),(0,br.jsxs)(r.Button,{variant:"secondary",onClick:()=>{u(!0)},className:"dk-admin-button dk-admin-button-danger dk-w-full dk-justify-center dk-h-9",children:[(0,br.jsx)("span",{className:"dashicons dashicons-image-rotate dk-mr-2"}),(0,ua.__)("Reset Settings","dokan-kits")]})]})]})]}),(0,br.jsxs)("div",{className:"dk-admin-card",children:[(0,br.jsx)("h2",{className:"dk-text-lg dk-font-medium dk-border-b dk-border-gray-200 dk-pb-wp-3 dk-mb-wp-4",children:(0,ua.__)("Documentation & Support","dokan-kits")}),(0,br.jsxs)("div",{children:[(0,br.jsx)("p",{className:"dk-text-sm dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Need help with Dokan Kits? Check out these resources:","dokan-kits")}),(0,br.jsxs)("ul",{className:"dk-space-y-wp-3",children:[(0,br.jsx)("li",{children:(0,br.jsxs)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-flex dk-items-center dk-text-primary-600 dk-hover:text-primary-800",children:[(0,br.jsx)("span",{className:"dk-w-8 dk-h-8 dk-rounded-full dk-bg-primary-100 dk-flex dk-items-center dk-justify-center dk-mr-wp-2",children:(0,br.jsx)("span",{className:"dashicons dashicons-editor-help"})}),(0,ua.__)("Support Forum","dokan-kits")]})}),(0,br.jsx)("li",{children:(0,br.jsxs)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/reviews/#new-post",target:"_blank",rel:"noopener noreferrer",className:"dk-flex dk-items-center dk-text-primary-600 dk-hover:text-primary-800",children:[(0,br.jsx)("span",{className:"dk-w-8 dk-h-8 dk-rounded-full dk-bg-primary-100 dk-flex dk-items-center dk-justify-center dk-mr-wp-2",children:(0,br.jsx)("span",{className:"dashicons dashicons-admin-comments"})}),(0,ua.__)("Submit your feedback","dokan-kits")]})}),(0,br.jsx)("li",{children:(0,br.jsxs)("a",{href:"https://github.com/wpintegrity/feedback/issues",target:"_blank",rel:"noopener noreferrer",className:"dk-flex dk-items-center dk-text-primary-600 dk-hover:text-primary-800",children:[(0,br.jsx)("span",{className:"dk-w-8 dk-h-8 dk-rounded-full dk-bg-primary-100 dk-flex dk-items-center dk-justify-center dk-mr-wp-2",children:(0,br.jsx)("span",{className:"dashicons dashicons-feedback"})}),(0,ua.__)("Feature Idea or Bug Report","dokan-kits")]})})]}),(0,br.jsxs)("div",{className:"dk-mt-wp-6 dk-p-wp-3 dk-bg-yellow-50 dk-rounded-md dk-border dk-border-yellow-200",children:[(0,br.jsxs)("h3",{className:"dk-text-md dk-font-medium dk-text-yellow-800 dk-mb-wp-2",children:[(0,br.jsx)("span",{className:"dashicons dashicons-warning dk-mr-1"}),(0,ua.__)("Need Help?","dokan-kits")]}),(0,br.jsx)("p",{className:"dk-text-sm dk-text-yellow-700 dk-mb-wp-3",children:(0,ua.__)("If you need support or have a feature request, please visit our support forum.","dokan-kits")}),(0,br.jsx)(r.Button,{href:"https://wordpress.org/support/plugin/dokan-kits/#new-topic-0",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-warning dk-w-full dk-justify-center",children:(0,ua.__)("Get Support","dokan-kits")})]})]})]})]})]}),m&&(0,br.jsx)(r.Modal,{title:(0,ua.__)("Import Settings","dokan-kits"),onRequestClose:v,className:"dokan-kits-admin-page dokan-kits-admin-modal dokan-kits-import-modal",children:(0,br.jsxs)("div",{className:"dk-modal-content",children:[(0,br.jsxs)("div",{className:"dk-modal-header",children:[(0,br.jsx)("h2",{className:"dk-modal-title",children:(0,ua.__)("Import Settings","dokan-kits")}),(0,br.jsx)("button",{type:"button",className:"dk-modal-close",onClick:v,"aria-label":(0,ua.__)("Close modal","dokan-kits"),children:(0,br.jsx)("span",{className:"dashicons dashicons-no-alt"})})]}),(0,br.jsxs)("div",{className:"dk-modal-body",children:[(0,br.jsx)("div",{className:"dk-modal-icon dk-bg-primary-50 dk-text-primary-500",children:(0,br.jsx)("span",{className:"dashicons dashicons-upload"})}),(0,br.jsx)("p",{className:"dk-modal-description",children:(0,ua.__)("Select a Dokan Kits settings file to import. This will overwrite your current settings.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-form-field",children:[(0,br.jsx)("label",{htmlFor:"import-file",className:"dk-form-label",children:(0,ua.__)("Settings File","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-file-input-wrapper",children:[(0,br.jsx)("input",{type:"file",id:"import-file",ref:g,accept:".json",onChange:e=>{const t=e.target.files[0];x(t)},className:"dk-file-input"}),(0,br.jsx)("div",{className:"dk-file-input-info",children:f?(0,br.jsx)("span",{className:"dk-file-name",children:f.name}):(0,br.jsx)("span",{className:"dk-file-placeholder",children:(0,ua.__)("Choose a file or drag it here","dokan-kits")})})]}),(0,br.jsx)("p",{className:"dk-form-help",children:(0,ua.__)("Only .json files exported from Dokan Kits are supported.","dokan-kits")})]})]}),(0,br.jsxs)("div",{className:"dk-modal-footer",children:[(0,br.jsx)(r.Button,{variant:"secondary",onClick:v,className:"dk-admin-button dk-admin-button-secondary",children:(0,ua.__)("Cancel","dokan-kits")}),(0,br.jsx)(r.Button,{variant:"primary",isBusy:n,disabled:n||!f,onClick:async()=>{if(f)if(f.name.endsWith(".json"))try{i(!0);const e=new window.FileReader;e.onload=async e=>{try{const t=JSON.parse(e.target.result),a=await Us()({path:"/dokan-kits/v1/dashboard/import",method:"POST",data:{settings:t}});if(!a.success)throw new Error(a.message||(0,ua.__)("Failed to import settings.","dokan-kits"));{w(a.message||(0,ua.__)("Settings imported successfully.","dokan-kits"),"success");const e=await Us()({path:"/dokan-kits/v1/dashboard"});if(e.success){const t=e.data?.statistics||{};y({active_features_count:t.active_features?.value||0,total_settings_count:t.total_features?.value||0,dokan_version:t.dokan_version?.value||(0,ua.__)("Not Detected","dokan-kits"),url:window.location.href})}}i(!1),v()}catch(e){w(e.message||(0,ua.__)("Failed to import settings. Please try again.","dokan-kits"),"error"),i(!1)}},e.onerror=()=>{w((0,ua.__)("Failed to read the file. Please try again.","dokan-kits"),"error"),i(!1)},e.readAsText(f)}catch(e){w(e.message||(0,ua.__)("Failed to import settings. Please try again.","dokan-kits"),"error"),i(!1)}else w((0,ua.__)("Please select a valid JSON file.","dokan-kits"),"error");else w((0,ua.__)("Please select a file to import.","dokan-kits"),"error")},className:"dk-admin-button",children:n?(0,ua.__)("Importing…","dokan-kits"):(0,ua.__)("Import","dokan-kits")})]})]})}),c&&(0,br.jsx)(r.Modal,{title:(0,ua.__)("Reset Settings","dokan-kits"),onRequestClose:j,className:"dokan-kits-admin-page dokan-kits-admin-modal dokan-kits-reset-modal",children:(0,br.jsxs)("div",{className:"dk-modal-content",children:[(0,br.jsxs)("div",{className:"dk-modal-header",children:[(0,br.jsx)("h2",{className:"dk-modal-title",children:(0,ua.__)("Reset Settings","dokan-kits")}),(0,br.jsx)("button",{type:"button",className:"dk-modal-close",onClick:j,"aria-label":(0,ua.__)("Close modal","dokan-kits"),children:(0,br.jsx)("span",{className:"dashicons dashicons-no-alt"})})]}),(0,br.jsxs)("div",{className:"dk-modal-body",children:[(0,br.jsx)("div",{className:"dk-modal-icon dk-bg-red-50 dk-text-red-500",children:(0,br.jsx)("span",{className:"dashicons dashicons-warning"})}),(0,br.jsx)("p",{className:"dk-modal-description dk-text-red-700",children:(0,ua.__)("Are you sure you want to reset Dokan Kits settings? This action cannot be undone.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-form-field",children:[(0,br.jsx)("label",{htmlFor:"reset-scope",className:"dk-form-label",children:(0,ua.__)("Reset Scope","dokan-kits")}),(0,br.jsxs)("select",{id:"reset-scope",className:"dk-form-select",value:h,onChange:e=>p(e.target.value),children:[(0,br.jsx)("option",{value:"all",children:(0,ua.__)("All Settings","dokan-kits")}),b.setting_names&&b.setting_names.map(((e,t)=>(0,br.jsx)("option",{value:e.toLowerCase(),children:e},t)))]})]}),b.setting_names&&b.setting_names.length>0&&(0,br.jsxs)("div",{className:"dk-mt-wp-4",children:[(0,br.jsx)("p",{className:"dk-form-label dk-mb-wp-2",children:(0,ua.__)("Available Settings:","dokan-kits")}),(0,br.jsx)("div",{className:"dk-p-wp-3 dk-bg-gray-50 dk-rounded-md dk-border dk-border-gray-200 dk-max-h-60 dk-overflow-y-auto",children:(0,br.jsx)("div",{className:"dk-flex dk-flex-wrap dk-gap-wp-2",children:b.setting_names.map(((e,t)=>(0,br.jsx)("span",{className:"dk-text-sm dk-text-gray-700 dk-bg-white dk-px-wp-2 dk-py-wp-1 dk-rounded dk-border dk-border-gray-200",children:e},t)))})})]})]}),(0,br.jsxs)("div",{className:"dk-modal-footer",children:[(0,br.jsx)(r.Button,{variant:"secondary",onClick:j,className:"dk-admin-button dk-admin-button-secondary",children:(0,ua.__)("Cancel","dokan-kits")}),(0,br.jsx)(r.Button,{variant:"primary",isBusy:a,disabled:a,onClick:async()=>{try{s(!0);const e=await Us()({path:"/dokan-kits/v1/dashboard/reset",method:"POST",data:{scope:h,confirm:!0}});if(!e.success)throw new Error(e.message||(0,ua.__)("Failed to reset settings.","dokan-kits"));{w(e.message||(0,ua.__)("Settings reset successfully.","dokan-kits"),"success");const t=await Us()({path:"/dokan-kits/v1/dashboard"});if(t.success){const e=t.data?.statistics||{};y({active_features_count:e.active_features?.value||0,total_settings_count:e.total_features?.value||0,dokan_version:e.dokan_version?.value||(0,ua.__)("Not Detected","dokan-kits"),url:window.location.href})}}}catch(e){w(e.message||(0,ua.__)("Failed to reset settings. Please try again.","dokan-kits"),"error")}finally{s(!1),j()}},className:"dk-admin-button dk-admin-button-danger",children:a?(0,ua.__)("Resetting…","dokan-kits"):(0,ua.__)("Reset","dokan-kits")})]})]})})]})},Vs=window.wp.htmlEntities,qs=(e,t,a="=")=>{switch("string"!=typeof t||"true"!==t&&"false"!==t||(t="true"===t),"string"!=typeof t||isNaN(Number(t))||("number"==typeof e||"string"==typeof e&&!isNaN(Number(e)))&&(e=Number(e),t=Number(t)),a){case"=":default:return e===t;case"!=":return e!==t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t;case"contains":return String(e).includes(String(t));case"not_contains":return!String(e).includes(String(t));case"is_empty":return""===e||null==e;case"is_not_empty":return""!==e&&null!=e}},Ks=(e,t)=>{if(!e?.dependencies?.length)return!0;for(const a of e.dependencies){if(a.key&&void 0===t[a.key])return!1;const e=t[a.key];if(!qs(e,a.value,a.comparison))return!1}return!0},Gs=(e,t)=>{const a={};let r=!0;return((e,t)=>{const a=[];for(const r in e){const s=e[r];for(const e in s.sections){const n=s.sections[e];for(const s in n.fields){const o=n.fields[s];o.id||(o.id=s);const i=o.dependency_key||`${r}.${e}.${s}`;void 0===t[i]&&void 0!==o.value&&(t[i]=o.value),Ks(o,t)&&a.push({field:o,path:{tabId:r,sectionId:e,fieldId:s},key:i})}}}return a})(e,t).forEach((({field:e,key:s})=>{const n=((e,t)=>{if(!e)return{isValid:!1,message:"Field not found"};if(e.required&&(""===t||null==t))return{isValid:!1,message:e.title+" is required"};switch(e.variant){case"number":if(""===t&&!e.required)return{isValid:!0,message:""};const a=parseFloat(t);if(isNaN(a))return{isValid:!1,message:e.title+" must be a valid number"};if(void 0!==e.minimum&&a<e.minimum)return{isValid:!1,message:e.title+" must be at least "+e.minimum};if(void 0!==e.maximum&&a>e.maximum)return{isValid:!1,message:e.title+" must be at most "+e.maximum};break;case"select":if(e.options&&e.options.length>0&&!e.options.map((e=>e.value)).includes(t))return{isValid:!1,message:e.title+" has an invalid selection"}}return{isValid:!0,message:""}})(e,t[s]);n.isValid||(a[s]=n.message,r=!1)})),{isValid:r,errors:a}},Ys=e=>{const t={};for(const a in e){const r=e[a];for(const e in r.sections){const s=r.sections[e];for(const r in s.fields){const n=s.fields[r],o=n.dependency_key||`${a}.${e}.${r}`;let i=n.value;if(null==i&&(i=void 0!==n.default?n.default:""),["toggle","checkbox"].includes(n.variant))i=Boolean(!0===i||"true"===i||"1"===i||1===i);else if("number"===n.variant&&""!==i){const e=parseFloat(i);isNaN(e)||(i=e)}else"multiselect"!==n.variant||Array.isArray(i)||(i=i?[i]:[]);t[o]=i}}}return t},Js=window.wp.blockEditor,Xs={toggle:({field:e,value:t,onChange:a})=>{const s=!0===t||"true"===t||"1"===t||1===t;return(0,br.jsx)(r.ToggleControl,{label:e.label,help:e.description,checked:s,onChange:e=>{a(e)},disabled:e.disabled||e.readonly})},text:({field:e,value:t,onChange:a})=>{const s=e.inputType||"text",n=null!=t?String(t):"";return(0,br.jsx)(r.TextControl,{label:e.label,help:e.description,value:n,onChange:a,disabled:e.disabled,readOnly:e.readonly,placeholder:e.placeholder||"",type:s,required:e.required,size:e.size})},select:({field:e,value:t,onChange:a})=>{const s=e.options||[],n=Array.isArray(s)?s.map((e=>"object"==typeof e&&void 0!==e.value?e:{value:e,label:e})):Object.entries(s).map((([e,t])=>({value:e,label:t})));return(0,br.jsx)(r.SelectControl,{label:e.label,help:e.description,value:t||"",options:n,onChange:a,disabled:e.disabled,multiple:e.multiple})},multiselect:({field:e,value:t,onChange:a})=>{const s=e.options||[],n=Array.isArray(s)?s.map((e=>"object"==typeof e&&void 0!==e.value?e:{value:e,label:e})):Object.entries(s).map((([e,t])=>({value:e,label:t})));let o=[];Array.isArray(t)?o=t:t&&(o=[t]);const i=o.map((e=>n.find((t=>t.value===e))||{value:e,label:e}));return(0,br.jsx)(r.CustomSelectControlV2,{label:e.label,help:e.description,options:n,onChange:({selectedItems:e})=>a(e.map((e=>e.value))),value:i,isMultiple:!0,__next40pxDefaultSize:!0,className:"dokan-kits-multiselect-field",disabled:e.disabled})},number:({field:e,value:t,onChange:a})=>{const s=void 0!==e.min?e.min:e.minimum,n=void 0!==e.max?e.max:e.maximum,o=e.step||1,i=null!=t?String(t):"";return(0,br.jsx)(r.TextControl,{type:"number",label:e.label,help:e.description,value:i,onChange:e=>{if(""===e)return void a("");const t=parseFloat(e);if(isNaN(t))return;let r=t;void 0!==s&&t<s&&(r=s),void 0!==n&&t>n&&(r=n),a(r)},min:s,max:n,step:o,disabled:e.disabled,readOnly:e.readonly,placeholder:e.placeholder,className:e.hasError?"dk-has-error":""})},range:({field:e,value:t,onChange:a})=>{const s=void 0!==e.min?e.min:e.minimum,n=void 0!==e.max?e.max:e.maximum,o=e.step||1,i=null!=t?Number(t):"";return(0,br.jsx)(r.RangeControl,{label:e.label,help:e.description,value:i,onChange:a,min:s,max:n,step:o,allowReset:e.allowReset||!1,resetFallbackValue:e.default||s,disabled:e.disabled,withInputField:!0,showTooltip:!0,railColor:e.railColor||void 0,trackColor:e.trackColor||void 0,marks:e.marks||!1,className:e.hasError?"dk-has-error":""})},color:({field:e,value:t,onChange:a})=>{const s=(0,o.useId)(),n=`dokan-kits-color-${e.id||s}`;return(0,br.jsxs)("div",{className:"dokan-kits-color-field",children:[(0,br.jsx)("div",{className:"dokan-kits-color-field-label",children:e.label&&(0,br.jsx)("label",{htmlFor:n,children:e.label})}),(0,br.jsx)(r.ColorPicker,{id:n,color:t||e.default||"#000000",onChangeComplete:e=>{let t;t="string"==typeof e.hex?e.hex:`rgba(${e.rgb.r}, ${e.rgb.g}, ${e.rgb.b}, ${e.rgb.a})`,a(t)},disableAlpha:!0===e.disableAlpha}),e.description&&(0,br.jsx)("p",{className:"dokan-kits-color-field-description",children:e.description})]})},textarea:({field:e,value:t,onChange:a})=>(0,br.jsx)(r.TextareaControl,{label:e.label,help:e.description,value:t||"",onChange:a,disabled:e.disabled,placeholder:e.placeholder||"",rows:e.rows||4}),radio:({field:e,value:t,onChange:a})=>(0,br.jsx)(r.RadioControl,{label:e.label,help:e.description,selected:t||e.default||"",options:e.options||[],onChange:a,disabled:e.disabled}),checkbox:({field:e,value:t,onChange:a})=>{const s=!0===t||"true"===t||"1"===t||1===t;return(0,br.jsx)(r.CheckboxControl,{label:e.label,help:e.description,checked:s,onChange:e=>{a(e)},disabled:e.disabled||e.readonly})},media:({field:e,value:t,onChange:a})=>{const s=e.allowedTypes||["image"],n=(0,o.useId)(),i=`dokan-kits-media-${e.id||n}`,d=`${i}-label`;return(0,br.jsxs)("div",{className:"dokan-kits-media-field",children:[(0,br.jsx)("div",{className:"dokan-kits-media-field-label",children:e.label&&(0,br.jsx)("label",{id:d,htmlFor:i,children:e.label})}),(0,br.jsx)(Js.MediaUploadCheck,{children:(0,br.jsx)(Js.MediaUpload,{onSelect:e=>{a(e.id)},allowedTypes:s,value:t,render:({open:n})=>(0,br.jsx)("div",{className:"dokan-kits-media-upload",id:i,children:t?(0,br.jsxs)("div",{className:"dokan-kits-media-preview",children:[s.includes("image")&&(0,br.jsx)("img",{src:`${e.mediaBaseUrl||""}?id=${t}&size=medium`,alt:""}),(0,br.jsxs)("div",{className:"dokan-kits-media-actions",children:[(0,br.jsx)(r.Button,{onClick:n,variant:"secondary",isSmall:!0,children:(0,ua.__)("Replace","dokan-kits")}),(0,br.jsx)(r.Button,{onClick:()=>a(""),variant:"link",isDestructive:!0,isSmall:!0,children:(0,ua.__)("Remove","dokan-kits")})]})]}):(0,br.jsx)(r.Button,{onClick:n,variant:"secondary","aria-labelledby":d,children:e.buttonText||(0,ua.__)("Choose Media","dokan-kits")})})})}),e.description&&(0,br.jsx)("p",{className:"dokan-kits-media-field-description",children:e.description})]})},code:({field:e,value:t,onChange:a})=>{const r=(0,o.useId)(),s=`dokan-kits-code-${e.id||r}`;return(0,br.jsxs)("div",{className:"dokan-kits-code-field",children:[e.label&&(0,br.jsx)("label",{htmlFor:s,className:"dokan-kits-code-field-label",children:e.label}),(0,br.jsx)("div",{className:"dokan-kits-code-editor",children:(0,br.jsx)("textarea",{id:s,className:"dokan-kits-code-textarea",value:t||"",onChange:e=>a(e.target.value),disabled:e.disabled,placeholder:e.placeholder||"",rows:e.rows||10,spellCheck:"false"})}),e.description&&(0,br.jsx)("p",{className:"dokan-kits-code-field-description",children:e.description})]})},button:({field:e})=>{const[t,a]=(0,o.useState)(!1);return(0,br.jsx)(r.Button,{variant:(()=>{switch(e.button_type){case"primary":default:return"primary";case"secondary":return"secondary";case"tertiary":return"tertiary";case"link":return"link"}})(),size:e.button_size,className:gr("dk-admin-button dk-w-full dk-justify-center",e.classes),icon:e.icon||null,isDestructive:"destructive"===e.button_type,isBusy:t,disabled:e.disabled||t,onClick:()=>{if(!e.confirm_message||e.skipConfirmation||window.confirm(e.confirm_message))switch(e.action){case"ajax":e.ajax_action&&(a(!0),window.jQuery.ajax({url:window.ajaxurl,method:"POST",data:{action:e.ajax_action,nonce:window.Dokan_Kits?.nonce||"",button_id:e.id}}).done((e=>{e.success&&"function"==typeof window.Dokan_Kits?.notify?window.Dokan_Kits.notify({type:"success",message:e.data?.message||"Action completed successfully",isDismissible:!0}):e.success||"function"!=typeof window.Dokan_Kits?.notify||window.Dokan_Kits.notify({type:"error",message:e.data?.message||"Action failed",isDismissible:!0})})).fail((()=>{"function"==typeof window.Dokan_Kits?.notify&&window.Dokan_Kits.notify({type:"error",message:"Failed to complete the action",isDismissible:!0})})).always((()=>{a(!1)})));break;case"link":e.url&&(window.location.href=e.url);break;default:"function"==typeof e.onClick&&e.onClick()}},children:e.button_text||e.label||"Button"})}},Zs={text:"text",textarea:"textarea",select:"select",multiselect:"multiselect",number:"number",checkbox:"checkbox",radio:"radio",color:"color",media:"media",code:"code",toggle:"toggle",button:"button"},Qs=({field:e,value:t,onChange:a})=>{let r=e.type;e.variant&&(r=Zs[e.variant]||"text","number"===e.variant&&"range"===e.display&&(r="range"));const s=Xs[r];if(!s)return(0,br.jsx)("div",{className:"dokan-kits-field-error",children:(0,br.jsxs)("p",{children:[(0,ua.__)("Unknown field type:","dokan-kits"),(0,br.jsx)("code",{children:r})]})});const n={...e,label:e.label||e.title||"",options:e.options||[],placeholder:e.placeholder||"",readonly:e.readonly||!1,disabled:e.disabled||!1,min:e.minimum,max:e.maximum,step:e.step};return(0,br.jsx)(s,{field:n,value:t,onChange:a})},en={text:"text",textarea:"textarea",select:"select",number:"number",checkbox:"checkbox",radio:"radio",color:"color",media:"media",code:"code",toggle:"toggle"},tn=({tabId:e,sectionId:t,fields:a,settings:r,validationErrors:s={},onSettingChange:n})=>{const[i,d]=(0,o.useState)({}),l=(0,o.useRef)({}),c=(0,o.useRef)({}),u=(0,o.useMemo)((()=>Object.values(a).map((a=>{const n=a.dependency_key||`${e}.${t}.${a.id}`;return{field:a,settingKey:n,value:r[n],isVisible:Ks(a,r),hasError:void 0!==s[n],errorMessage:s[n]}}))),[a,r,e,t,s]);return(0,o.useEffect)((()=>{const e={},t={};if(u.forEach((({field:a,isVisible:r})=>{r&&(t[a.id]=!0,l.current[a.id]||(e[a.id]="animate-field-enter"))})),Object.keys(e).length>0){d((t=>({...t,...e})));const t=Object.keys(e);setTimeout((()=>{d((e=>{const a={...e};return t.forEach((e=>{delete a[e]})),a}))}),500)}l.current=t}),[u]),(0,o.useEffect)((()=>{const e={};if(u.forEach((({field:t,settingKey:a,hasError:r})=>{r&&!c.current[a]&&(e[t.id]="dk-shake")})),Object.keys(e).length>0){d((t=>({...t,...e})));const t=Object.keys(e);setTimeout((()=>{d((e=>{const a={...e};return t.forEach((e=>{delete a[e]})),a}))}),800)}const t={};Object.entries(s).forEach((([e,a])=>{t[e]=a})),c.current=t}),[s,u]),a&&0!==Object.keys(a).length?(0,br.jsx)("div",{className:"dokan-kits-settings-fields",children:u.map((({field:e,settingKey:t,value:a,isVisible:r,hasError:s,errorMessage:o})=>{if(!r)return null;const d=(l=e.variant,en[l]||"text");var l;const c=i[e.id]||"";return(0,br.jsxs)("div",{className:`dokan-kits-field-container ${s?"dk-has-error":""} ${c}`,children:[(0,br.jsx)(Qs,{field:{...e,type:d,label:(0,Vs.decodeEntities)(e.title),description:(0,Vs.decodeEntities)(e.description),hasError:s,errorMessage:o},value:a,onChange:e=>{((e,t)=>{n(e,t)})(t,e)}}),s&&(0,br.jsx)("div",{className:"dk-text-red-500 dk-text-sm dk-mt-1",children:o})]},e.id)}))}):(0,br.jsx)("p",{children:(0,ua.__)("No fields in this section.","dokan-kits")})},an=({tabId:e,structure:t,settings:a,validationErrors:s={},onSettingChange:n,className:o="",emptyMessage:i=null})=>t?t.sections&&Object.keys(t.sections).length>0?(0,br.jsx)("div",{className:gr(`dokan-kits-tab-content dokan-kits-tab-${e}`,o,"dk-mt-1"),children:Object.keys(t.sections).map((o=>{const i=t.sections[o],d=Object.keys(s).some((t=>t.startsWith(`${e}.${o}.`)||Object.values(i.fields).some((e=>e.dependency_key&&s[e.dependency_key]))));return(0,br.jsxs)(r.Card,{className:gr("dokan-kits-settings-section dk-mb-wp-6 last:dk-mb-0",{"dk-border-red-300":d}),children:[(0,br.jsxs)(r.CardHeader,{className:"dk-block dk-p-4 dk-bg-white dk-border-b dk-border-gray-200",children:[(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-gap-2",children:[(0,br.jsx)("h3",{className:"dk-text-base dk-font-medium",children:(0,Vs.decodeEntities)(i.title)}),i.badge&&(0,br.jsx)("span",{className:"dk-text-xs dk-px-2 dk-py-0.5 dk-rounded-full dk-font-medium "+("primary"===i.badge.type?"dk-bg-blue-100 dk-text-blue-800":"success"===i.badge.type?"dk-bg-green-100 dk-text-green-800":"warning"===i.badge.type?"dk-bg-yellow-100 dk-text-yellow-800":"danger"===i.badge.type?"dk-bg-red-100 dk-text-red-800":"info"===i.badge.type?"dk-bg-indigo-100 dk-text-indigo-800":"dk-bg-gray-100 dk-text-gray-800"),children:(0,Vs.decodeEntities)(i.badge.text)})]}),i.description&&(0,br.jsx)("p",{className:"dk-text-sm dk-text-gray-600 dk-mt-1",children:(0,Vs.decodeEntities)(i.description)})]}),(0,br.jsx)(r.CardBody,{children:(0,br.jsx)(tn,{tabId:e,sectionId:o,fields:i.fields,settings:a,validationErrors:s,onSettingChange:n})})]},o)}))}):(0,br.jsx)(r.Card,{className:"dk-bg-gray-50",children:(0,br.jsx)(r.CardBody,{children:(0,br.jsx)("p",{className:"dk-text-center dk-text-gray-500",children:i||(0,ua.__)("No features available for this tab.","dokan-kits")})})}):(0,br.jsx)(r.Card,{className:"dk-bg-gray-50",children:(0,br.jsx)(r.CardBody,{children:(0,br.jsx)("p",{className:"dk-text-center dk-text-gray-500",children:(0,ua.__)("Tab structure not found.","dokan-kits")})})}),rn=()=>{const e=({className:e})=>(0,br.jsx)("div",{className:`dk-animate-pulse dk-bg-gray-200 dk-rounded ${e}`}),t=()=>(0,br.jsx)("div",{className:"dk-flex dk-border-b dk-border-gray-200 dk-mb-wp-4",children:(0,br.jsx)("div",{className:"dk-flex dk-overflow-x-auto dk-no-scrollbar",children:Array(3).fill().map(((t,a)=>(0,br.jsx)("div",{className:"dk-pb-wp-3 dk-px-wp-4 dk-whitespace-nowrap "+(0===a?"dk-border-b-2 dk-border-primary-500":""),children:(0,br.jsx)(e,{className:"dk-h-6 dk-w-32"})},a)))})}),a=()=>(0,br.jsx)("div",{className:"dk-border-b dk-border-gray-200 dk-py-wp-4",children:(0,br.jsxs)("div",{className:"dk-flex dk-flex-col md:dk-flex-row dk-items-start md:dk-items-center dk-justify-between",children:[(0,br.jsxs)("div",{className:"dk-flex-grow",children:[(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-gap-wp-3",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-40 dk-mb-wp-1"}),(0,br.jsx)(e,{className:"dk-h-5 dk-w-16 dk-rounded-full"})]}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-max-w-2xl dk-mt-wp-1"})]}),(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-gap-wp-2 dk-mt-wp-2 md:dk-mt-0",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-12 dk-rounded-full"}),(0,br.jsx)(e,{className:"dk-h-8 dk-w-8 dk-rounded-full"})]})]})}),s=()=>(0,br.jsxs)(r.Card,{className:"dk-mt-wp-4",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsx)(e,{className:"dk-h-7 dk-w-64"})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("div",{className:"dk-space-y-wp-6",children:Array(3).fill().map(((t,a)=>(0,br.jsxs)("div",{className:"dk-space-y-wp-4",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-48"}),Array(2).fill().map(((t,a)=>(0,br.jsxs)("div",{className:"dk-mb-wp-4",children:[(0,br.jsx)(e,{className:"dk-h-5 dk-w-40 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-full dk-rounded"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4 dk-mt-wp-1"})]},a)))]},a)))}),(0,br.jsxs)("div",{className:"dk-flex dk-justify-end dk-gap-wp-2 dk-mt-wp-6 dk-pt-wp-4 dk-border-t dk-border-gray-200",children:[(0,br.jsx)(e,{className:"dk-h-10 dk-w-24 dk-rounded"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-24 dk-rounded"})]})]})]}),n=()=>(0,br.jsxs)("div",{className:"dk-mb-wp-6",children:[(0,br.jsx)(r.Card,{className:"dk-mb-wp-6",children:(0,br.jsx)(r.CardBody,{children:(0,br.jsxs)("div",{className:"dk-flex dk-flex-col md:dk-flex-row dk-items-start md:dk-items-center dk-justify-between dk-gap-wp-4",children:[(0,br.jsxs)("div",{children:[(0,br.jsx)(e,{className:"dk-h-7 dk-w-64 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-max-w-2xl"})]}),(0,br.jsxs)("div",{className:"dk-flex dk-gap-wp-2",children:[(0,br.jsx)(e,{className:"dk-h-10 dk-w-32 dk-rounded"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-32 dk-rounded"})]})]})})}),(0,br.jsx)("div",{className:"dk-mb-wp-6",children:(0,br.jsx)(r.Card,{children:(0,br.jsx)(r.CardBody,{children:Array(5).fill().map(((e,t)=>(0,br.jsx)(a,{},t)))})})}),(0,br.jsx)(s,{})]});return(0,br.jsxs)("div",{className:"dokan-kits-features-page dk-p-6",children:[(0,br.jsx)("div",{className:"dk-mb-wp-6",children:(0,br.jsx)(e,{className:"dk-h-12 dk-w-full dk-rounded"})}),(0,br.jsx)(t,{}),(0,br.jsx)(n,{})]})},sn=e=>{let t=void 0!==e.value?e.value:void 0!==e.default?e.default:"";t=((e,t,a="")=>{if(null==e&&(e=a),["toggle","checkbox"].includes(t))return Boolean(!0===e||"true"===e||"1"===e||1===e);if("number"===t){if(""===e||null==e)return"";const t=parseFloat(e);if(!isNaN(t))return t;if(""!==a&&null!=a){const e=parseFloat(a);return isNaN(e)?"":e}return""}return"multiselect"!==t||Array.isArray(e)?e:e?[e]:[]})(t,e.variant,e.default);const a=[];return e.dependencies&&Array.isArray(e.dependencies)&&e.dependencies.forEach((e=>{const t=(e=>{if(!e||!e.key)return null;const t={...e};return t.comparison||(t.comparison="="),"string"==typeof t.value&&("true"===t.value?t.value=!0:"false"===t.value?t.value=!1:isNaN(Number(t.value))||[">","<",">=","<="].includes(t.comparison)&&(t.value=Number(t.value))),t})(e);t&&a.push(t)})),{id:e.id,title:e.title||"",description:e.description||"",variant:e.variant||"text",value:t,default:e.default||"",placeholder:e.placeholder||"",readonly:e.readonly||!1,disabled:e.disabled||!1,dependencies:a,dependency_key:e.dependency_key||"",required:e.required||!1,options:e.options||[],minimum:e.minimum,maximum:e.maximum,step:e.step,size:e.size}},nn=(e,t,a)=>{if(!e||!t)return e;const r={...e},s=((e,t)=>{if(!e||!t)return null;for(const a in e){const r=e[a];for(const e in r.sections){const s=r.sections[e];for(const r in s.fields){const n=s.fields[r];if((n.dependency_key||`${a}.${e}.${r}`)===t)return{field:n,path:{tabId:a,sectionId:e,fieldId:r}}}}}return null})(r,t);if(s){const{path:e}=s;r[e.tabId].sections[e.sectionId].fields[e.fieldId]={...r[e.tabId].sections[e.sectionId].fields[e.fieldId],value:a}}return r},on=(e=null,t=()=>{})=>{const[a,r]=(0,o.useState)({}),[s,n]=(0,o.useState)({}),[i,d]=(0,o.useState)(!0),l=(0,o.useCallback)(((e,a)=>{n((t=>({...t,[e]:a}))),"function"==typeof t&&t(e,a),r((t=>nn(t,e,a)))}),[t]),c=(0,o.useCallback)((e=>{e&&"object"==typeof e&&(n((t=>({...t,...e}))),"function"==typeof t&&Object.entries(e).forEach((([e,a])=>{t(e,a)})),r((t=>((e,t)=>{if(!e||!t||"object"!=typeof t)return e;let a={...e};return Object.entries(t).forEach((([e,t])=>{a=nn(a,e,t)})),a})(t,e))))}),[t]);return(0,o.useEffect)((()=>{(()=>{if(void 0===window.Dokan_Kits)return void d(!1);const t=(e=>{const t={};if(!e?.children?.length)return console.warn("Invalid structure data: missing children"),t;try{e.children.forEach((e=>{e.id&&"section"===e.type&&e.display&&(t[e.id]={id:e.id,title:e.title||"",icon:e.icon||"",description:e.description||"",sections:{}},e.children?.length&&e.children.forEach((a=>{a.id&&"subsection"===a.type&&a.display&&(t[e.id].sections[a.id]={id:a.id,title:a.title||"",description:a.description||"",badge:a.badge||null,fields:{}},a.children?.length&&a.children.forEach((r=>{r.id&&"field"===r.type&&r.display&&(t[e.id].sections[a.id].fields[r.id]=sn(r))})))})))}))}catch(e){console.error("Error parsing structure:",e)}return t})(window.Dokan_Kits.features||{});r(t);const a=Ys(t);if(e&&Object.keys(e).length>0){const a=((e,t)=>{const a=Ys(e);if(!t||!t.data)return a;const r={...a},s=t.data;for(const t in e){const a=e[t];if(!s[t])continue;const n=s[t];for(const e in a.sections){const s=a.sections[e];for(const a in s.fields){if(!n[e])continue;const o=s.fields[a],i=o.dependency_key||`${t}.${e}.${a}`;if(!n[e][a])continue;let d=n[e][a];if(["toggle","checkbox"].includes(o.variant))d=Boolean(!0===d||"true"===d||"1"===d||1===d);else if("number"===o.variant&&""!==d){const e=parseFloat(d);isNaN(e)||(d=e)}else"multiselect"!==o.variant||Array.isArray(d)||(d=d?[d]:[]);r[i]=d}}}return r})(t,{data:e});n(a)}else n(a);d(!1)})()}),[e]),{structure:a,settings:s,isLoading:i,updateSetting:l,updateSettings:c}},dn={duration:5e3,position:"top-right",style:{background:"transparent",boxShadow:"none",padding:0}},ln=(e,t,a=Ps,r={})=>{const s={...dn,...r,id:e};let n=s.duration||5e3;return a===Ts&&(n=s.duration||8e3),gs.custom((e=>(0,br.jsx)(Ds,{t:e,message:t,type:a,onClose:()=>gs.dismiss(e.id)})),{...s,duration:n})},cn={},un=({tab:e,structure:t,settings:a,validationErrors:r,onSettingChange:s})=>{const n=e.name;if(cn[n]){const e=cn[n];return(0,br.jsx)(e,{structure:t[n],settings:a,validationErrors:r,onSettingChange:s})}return(0,br.jsx)(an,{tabId:n,structure:t[n],settings:a,validationErrors:r,onSettingChange:s})},mn=()=>{const{addNotice:e,clearNotices:t}=$s(),[a,s]=(0,o.useState)(null),[n,i]=(0,o.useState)(!0),[d,l]=(0,o.useState)({});(0,o.useEffect)((()=>{(async()=>{try{const e=await Us()({path:"/dokan-kits/v1/settings"});e.data&&e.data.settings&&s(e.data.settings),i(!1)}catch(t){e(t.message||(0,ua.__)("Failed to load settings. Please refresh the page.","dokan-kits"),Ts),i(!1)}})()}),[e]);const c=(0,o.useCallback)(((e,t)=>{l((a=>({...a,[e]:t})))}),[]),u=(0,o.useCallback)((async()=>{try{const e=await Us()({path:"/dokan-kits/v1/settings",method:"POST",data:{settings:d}});if(e.success)return e;throw new Error(e.message||(0,ua.__)("Failed to save settings","dokan-kits"))}catch(e){throw e}}),[d]),{structure:m,settings:k,isLoading:h,updateSetting:p}=on(a,c),{isSaving:f,validationErrors:x,saveForm:g}=((e,t,a)=>{const[r,s]=(0,o.useState)(t||{}),[n,i]=(0,o.useState)(!1),[d,l]=(0,o.useState)(null),[c,u]=(0,o.useState)(!1),[m,k]=(0,o.useState)({}),h=(0,o.useCallback)(((e,t)=>{s((a=>({...a,[e]:t})))}),[]),p=(0,o.useCallback)((e=>{e&&"object"==typeof e&&s((t=>({...t,...e})))}),[]),f=(0,o.useCallback)((()=>{s(t||{}),k({}),l(null),u(!1)}),[t]),x=(0,o.useCallback)((()=>{l(null),u(!1)}),[]),g=(0,o.useCallback)((()=>{if(!e)return!0;const{isValid:t,errors:a}=Gs(e,r);return k(a),t||(l((0,ua.__)("Please fix the validation errors before saving.","dokan-kits")),u(!0)),t}),[e,r]),b=(0,o.useCallback)((async()=>{if(!g())return!1;k({}),i(!0),l(null),u(!1);try{const e=await a(r);return i(!1),l(e.message),u(!e.success),setTimeout((()=>{l(null)}),3e3),e.success}catch(e){return i(!1),l((0,ua.__)("Failed to save form data.","dokan-kits")),u(!0),!1}}),[g,a,r]);return{values:r,isSaving:n,message:d,isError:c,validationErrors:m,updateValue:h,updateValues:p,saveForm:b,resetForm:f,clearNotifications:x,validateForm:g}})(m,k,u),b=(0,o.useCallback)((async()=>{if(t(),Object.keys(x).length>0)return e((0,ua.__)("Please fix the validation errors before saving.","dokan-kits"),Ts,{duration:8e3}),Object.values(x).forEach(((t,a)=>{setTimeout((()=>{e(t,Ts,{duration:6e3})}),500*(a+1))})),!1;const a=((e,t={})=>gs.custom((t=>(0,br.jsx)(Ds,{t,message:e,type:"info",onClose:()=>gs.dismiss(t.id),showCloseButton:!1})),{...dn,duration:1/0,...t,id:t.id||`loading-${Date.now()}`}))((0,ua.__)("Saving your changes…","dokan-kits"));try{const e=await g();return e?ln(a,(0,ua.__)("Settings saved successfully!","dokan-kits"),Ps):ln(a,(0,ua.__)("Failed to save settings. Please try again.","dokan-kits"),Ts),e}catch(e){return ln(a,e.message||(0,ua.__)("An unexpected error occurred while saving.","dokan-kits"),Ts),!1}}),[e,t,x,g]);if(h||n)return(0,br.jsx)(rn,{});const y=Object.keys(m).map((e=>({name:e,title:(0,Vs.decodeEntities)(m[e].title),className:`dokan-kits-tab-${e}`})));return(0,br.jsx)("div",{className:"dk-max-w-full dk-mx-auto dk-py-wp-5",children:(0,br.jsxs)(r.Card,{className:"dk-shadow-sm",children:[(0,br.jsx)(r.CardHeader,{className:"dk-border-b dk-border-gray-200",children:(0,br.jsx)("h2",{className:"dk-text-xl dk-font-semibold dk-m-0",children:(0,ua.__)("Manage Features","dokan-kits")})}),(0,br.jsx)(r.CardBody,{children:(0,br.jsx)(r.TabPanel,{activeClass:"dk-text-primary-600 dk-border dk-border-solid dk-border-b-2 dk-border-primary-500 dk-bg-gray-50",tabs:y,children:e=>(0,br.jsx)(un,{tab:e,structure:m,settings:k,validationErrors:x,onSettingChange:p})})}),(0,br.jsx)(r.CardFooter,{className:"dk-sticky dk-bottom-0 dk-border-t dk-border-gray-200 dk-bg-gray-50",children:(0,br.jsx)(r.Button,{variant:"primary",isBusy:f,onClick:b,disabled:h||f,className:"dk-w-full dk-justify-center hover:!dk-bg-primary-800 focus-visible:!dk-bg-primary-800 focus:!dk-ring-primary-800",children:f?(0,ua.__)("Saving Changes…","dokan-kits"):(0,ua.__)("Save Changes","dokan-kits")})})]})})},kn=({className:e})=>(0,br.jsxs)("div",{className:gr("dk-min-h-[400px] dk-flex dk-flex-col dk-items-center dk-justify-center dk-p-wp-8 dk-text-center",e),children:[(0,br.jsx)("div",{className:"dk-flex dk-justify-center dk-mb-wp-6",children:(0,br.jsxs)("div",{className:"dk-inline-flex dk-flex-col dk-items-center dk-justify-center",children:[(0,br.jsx)("div",{className:"dk-text-8xl dk-font-bold dk-text-primary-200 dk-mb-wp-4",children:"404"}),(0,br.jsx)("div",{className:"dk-inline-flex dk-items-center dk-justify-center dk-w-20 dk-h-20 dk-rounded-full dk-bg-blue-100 dk-border-4 dk-border-blue-200 dk-shadow-inner",children:(0,br.jsx)("span",{className:"dashicons dashicons-marker dk-text-4xl dk-text-blue-600"})})]})}),(0,br.jsx)("h1",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-3",children:(0,ua.__)("Page Not Found","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-max-w-lg dk-text-gray-600 dk-mb-wp-6",children:[(0,br.jsx)("p",{className:"dk-mb-wp-3",children:(0,ua.__)("We couldn't find the page you're looking for.","dokan-kits")}),(0,br.jsx)("p",{children:(0,ua.__)("It might have been moved, deleted, or perhaps you entered an incorrect URL.","dokan-kits")})]}),(0,br.jsxs)("div",{className:"dk-flex dk-flex-col md:dk-flex-row dk-items-center dk-space-y-wp-4 md:dk-space-y-0 md:dk-space-x-wp-4",children:[(0,br.jsxs)(sa,{to:"/",className:gr("dk-admin-button dk-bg-primary-600 hover:dk-bg-primary-700 dk-text-white dk-shadow-md hover:dk-shadow-lg dk-transition dk-duration-200 dk-flex dk-items-center"),children:[(0,br.jsx)("span",{className:"dashicons dashicons-dashboard dk-mr-wp-2"}),(0,ua.__)("Go to Dashboard","dokan-kits")]}),(0,br.jsxs)(sa,{to:"/features",className:gr("dk-admin-button dk-admin-button-secondary dk-shadow-md hover:dk-shadow-lg dk-transition dk-duration-200 dk-flex dk-items-center"),children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-settings dk-mr-wp-2"}),(0,ua.__)("Go to Features","dokan-kits")]})]}),(0,br.jsx)("div",{className:"dk-mt-wp-8 dk-pt-wp-6 dk-border-t dk-border-gray-200 dk-max-w-md",children:(0,br.jsxs)("div",{className:"dk-flex dk-justify-center dk-space-x-wp-6",children:[(0,br.jsxs)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:gr("dk-text-primary-600 hover:dk-text-primary-800 dk-flex dk-flex-col dk-items-center"),children:[(0,br.jsx)("span",{className:"dashicons dashicons-sos dk-text-xl dk-mb-wp-1"}),(0,br.jsx)("span",{className:"dk-text-sm",children:(0,ua.__)("Support","dokan-kits")})]}),(0,br.jsxs)("a",{href:"https://wordpress.org/plugins/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:gr("dk-text-primary-600 hover:dk-text-primary-800 dk-flex dk-flex-col dk-items-center"),children:[(0,br.jsx)("span",{className:"dashicons dashicons-book dk-text-xl dk-mb-wp-1"}),(0,br.jsx)("span",{className:"dk-text-sm",children:(0,ua.__)("Documentation","dokan-kits")})]}),(0,br.jsxs)("a",{href:"https://wordpress.org/plugins/dokan-kits/#developers",target:"_blank",rel:"noopener noreferrer",className:gr("dk-text-primary-600 hover:dk-text-primary-800 dk-flex dk-flex-col dk-items-center"),children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-plugins dk-text-xl dk-mb-wp-1"}),(0,br.jsx)("span",{className:"dk-text-sm",children:(0,ua.__)("Plugin Info","dokan-kits")})]})]})})]}),hn=()=>{const e=({className:e})=>(0,br.jsx)("div",{className:`dk-animate-pulse dk-bg-gray-200 dk-rounded ${e}`}),t=()=>(0,br.jsxs)("div",{className:"dk-mb-wp-8 dk-text-center",children:[(0,br.jsx)(e,{className:"dk-mx-auto dk-h-10 dk-w-1/4 dk-mb-wp-3"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-5 dk-w-2/3 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-mx-auto dk-h-5 dk-w-1/2 dk-mb-wp-2"})]}),a=({cardCount:t=2})=>(0,br.jsxs)("div",{className:"dk-mb-wp-8",children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-1/4 dk-mb-wp-4"}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6",children:Array(t).fill().map(((t,a)=>(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-6 dk-mr-wp-2"}),(0,br.jsx)(e,{className:"dk-h-6 dk-w-2/3"})]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4 dk-mb-wp-2"})]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(e,{className:"dk-h-10 dk-w-36"})})]},a)))})]}),s=()=>(0,br.jsx)("div",{className:"dk-mt-wp-10 dk-p-wp-6 dk-bg-gray-100 dk-rounded-lg dk-border dk-border-gray-200",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-start",children:[(0,br.jsx)(e,{className:"dk-h-8 dk-w-8 dk-mr-wp-4"}),(0,br.jsxs)("div",{children:[(0,br.jsx)(e,{className:"dk-h-6 dk-w-1/4 dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-full dk-mb-wp-2"}),(0,br.jsx)(e,{className:"dk-h-4 dk-w-3/4 dk-mb-wp-3"}),(0,br.jsxs)("div",{className:"dk-flex dk-gap-wp-4",children:[(0,br.jsx)(e,{className:"dk-h-10 dk-w-32"}),(0,br.jsx)(e,{className:"dk-h-10 dk-w-40"})]})]})]})});return(0,br.jsxs)("div",{className:"dokan-kits-tools-page",children:[(0,br.jsx)(t,{}),(0,br.jsx)(a,{cardCount:2}),(0,br.jsx)(a,{cardCount:1}),(0,br.jsx)(a,{cardCount:1}),(0,br.jsx)(a,{cardCount:2}),(0,br.jsx)(s,{})]})},pn=()=>{const[e,t]=(0,o.useState)(!0),[a,s]=(0,o.useState)(null),[n,i]=(0,o.useState)(null),[d,l]=(0,o.useState)({}),[c,u]=(0,o.useState)(null),[m,k]=(0,o.useState)({recreateTables:!1,migrateSettings:!1,optimizeTables:!1,runDiagnostics:!1,downloadLogs:!1}),{addNotice:h}=$s(),p=(0,o.useCallback)((async()=>{try{const e=await Us()({path:"/dokan-kits/v1/tools/migration/status",method:"GET"});e.success&&s(e.data)}catch(e){}finally{t(!1)}}),[]);(0,o.useEffect)((()=>{p()}),[p]);const f=async(e,t,a=!1)=>{if(a||!["database/recreate","database/optimize"].includes(t)){k((t=>({...t,[e]:!0})));try{const a=await Us()({path:`/dokan-kits/v1/tools/${t}`,method:"POST"});if(!a.success){const e=a.data||{};throw{message:a.message||(0,ua.__)("Failed to complete operation.","dokan-kits"),code:e.code||"unknown_error",status:e.status||400,data:e}}l((t=>({...t,[e]:{success:!0,message:a.message,data:a.data,timestamp:(new Date).toISOString()}}))),"runDiagnostics"===e&&a.data&&u(a.data),h(a.message||(0,ua.__)("Operation completed successfully.","dokan-kits"),"success"),"migrate-settings"===t&&p()}catch(t){const a=t.message||(0,ua.__)("An unexpected error occurred.","dokan-kits"),r=t.code||"unknown_error",s=t.data||{};l((t=>({...t,[e]:{success:!1,message:a,code:r,data:s,timestamp:(new Date).toISOString()}}))),h(a,"error")}finally{k((t=>({...t,[e]:!1})))}}else i({tool:e,action:t})},x=e=>{const t=d[e];if(!t)return null;const a=t.success,r=new Date(t.timestamp).toLocaleString();return(0,br.jsxs)("div",{className:"dk-mt-2 dk-p-3 dk-rounded dk-text-sm "+(a?"dk-bg-green-50 dk-text-green-700 dk-border dk-border-green-200":"dk-bg-red-50 dk-text-red-700 dk-border dk-border-red-200"),children:[(0,br.jsxs)("div",{className:"dk-flex dk-items-center dk-justify-between dk-mb-2",children:[(0,br.jsx)("span",{className:"dk-font-medium",children:a?"✓ "+(0,ua.__)("Success","dokan-kits"):"✗ "+(0,ua.__)("Failed","dokan-kits")}),(0,br.jsx)("span",{className:"dk-text-xs dk-opacity-75",children:r})]}),!a&&t.code&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mb-2 dk-text-red-600",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Error Code:","dokan-kits")})," ",t.code]}),t.message&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mb-2",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Message:","dokan-kits")})," ",t.message]}),t.data&&t.data.tables&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mb-1",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Tables affected:","dokan-kits")})," ",t.data.tables.length,t.data.tables.length>0&&(0,br.jsxs)("div",{className:"dk-mt-1 dk-text-xs dk-opacity-75",children:[t.data.tables.slice(0,3).join(", "),t.data.tables.length>3&&(0,ua.__)("and more…","dokan-kits")]})]}),t.data&&t.data.versions&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mb-1",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Migrations executed:","dokan-kits")})," ",t.data.versions.length]}),t.data&&t.data.optimized&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mb-1",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Tables optimized:","dokan-kits")})," ",t.data.optimized.length,t.data.failed&&t.data.failed.length>0&&(0,br.jsxs)("div",{className:"dk-text-red-600",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Failed:","dokan-kits")})," ",t.data.failed.length]})]}),t.data&&t.data.file_name&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mb-1",children:[(0,br.jsx)("strong",{children:(0,ua.__)("File:","dokan-kits")})," ",t.data.file_name," (",t.data.file_size,")"]}),!a&&t.data&&t.data.validation_errors&&(0,br.jsxs)("div",{className:"dk-text-xs dk-mt-2 dk-p-2 dk-bg-red-100 dk-rounded",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Validation Errors:","dokan-kits")}),(0,br.jsx)("ul",{className:"dk-list-disc dk-list-inside dk-mt-1",children:Object.entries(t.data.validation_errors).map((([e,t])=>(0,br.jsxs)("li",{children:[(0,br.jsxs)("strong",{children:[e,":"]})," ",t]},e)))})]})]})};return e?(0,br.jsx)(hn,{}):(0,br.jsxs)("div",{className:"dokan-kits-tools-page",children:[n&&(0,br.jsx)(r.Modal,{title:(0,ua.__)("Confirm Database Operation","dokan-kits"),onRequestClose:()=>i(null),className:"dokan-kits-admin-page dokan-kits-admin-modal dokan-kits-tools-confirm-modal",children:(0,br.jsxs)("div",{className:"dk-modal-content",children:[(0,br.jsxs)("div",{className:"dk-modal-header",children:[(0,br.jsx)("h2",{className:"dk-modal-title",children:(0,ua.__)("Confirm Database Operation","dokan-kits")}),(0,br.jsx)("button",{type:"button",className:"dk-modal-close",onClick:()=>i(null),"aria-label":(0,ua.__)("Close modal","dokan-kits"),children:(0,br.jsx)("span",{className:"dashicons dashicons-no-alt"})})]}),(0,br.jsxs)("div",{className:"dk-modal-body",children:[(0,br.jsx)("div",{className:"dk-modal-icon dk-bg-red-50 dk-text-red-500",children:(0,br.jsx)("span",{className:"dashicons dashicons-warning"})}),(0,br.jsx)("p",{className:"dk-modal-description dk-text-red-700",children:(0,ua.__)("This action will modify your database structure. Please ensure you have a backup before proceeding.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-form-field",children:[(0,br.jsx)("label",{htmlFor:"precautions-info",className:"dk-form-label",children:(0,ua.__)("Recommended precautions:","dokan-kits")}),(0,br.jsx)("input",{type:"hidden",id:"precautions-info"}),(0,br.jsx)("div",{className:"dk-p-wp-3 dk-bg-yellow-50 dk-rounded-md dk-border dk-border-yellow-200",children:(0,br.jsxs)("ul",{className:"dk-text-sm dk-text-yellow-700 dk-list-disc dk-list-inside dk-space-y-1",children:[(0,br.jsx)("li",{children:(0,ua.__)("Create a full database backup","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Ensure no other processes are accessing the database","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Run this operation during low-traffic periods","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Monitor your site after the operation completes","dokan-kits")})]})})]}),(0,br.jsxs)("div",{className:"dk-form-field",children:[(0,br.jsx)("label",{htmlFor:"operation-details",className:"dk-form-label",children:(0,ua.__)("Operation Details:","dokan-kits")}),(0,br.jsx)("input",{type:"hidden",id:"operation-details"}),(0,br.jsxs)("div",{className:"dk-p-wp-3 dk-bg-gray-50 dk-rounded-md dk-border dk-border-gray-200",children:[(0,br.jsxs)("p",{className:"dk-text-sm dk-text-gray-700",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Action:","dokan-kits")})," ",n.action.replace("-"," ").replace(/\b\w/g,(e=>e.toUpperCase()))]}),(0,br.jsxs)("p",{className:"dk-text-sm dk-text-gray-700 dk-mt-1",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Risk Level:","dokan-kits")}),(0,br.jsxs)("span",{className:"dk-text-red-600 dk-font-medium",children:[" ",(0,ua.__)("High - Database Structure Changes","dokan-kits")]})]})]})]})]}),(0,br.jsxs)("div",{className:"dk-modal-footer",children:[(0,br.jsx)(r.Button,{variant:"secondary",onClick:()=>i(null),className:"dk-admin-button dk-admin-button-secondary",children:(0,ua.__)("Cancel","dokan-kits")}),(0,br.jsx)(r.Button,{variant:"primary",onClick:()=>{if(n){const{tool:e,action:t}=n;i(null),f(e,t,!0)}},className:"dk-admin-button dk-admin-button-danger",children:(0,ua.__)("Yes, I understand the risks","dokan-kits")})]})]})}),(0,br.jsx)(r.Card,{className:"dk-mb-wp-6",children:(0,br.jsxs)(r.CardBody,{className:"dk-text-center dk-py-wp-8",children:[(0,br.jsx)("img",{src:As,alt:"Dokan Kits",className:"dk-mx-auto dk-h-24 dk-w-auto dk-mb-wp-4"}),(0,br.jsx)("h1",{className:"dk-text-3xl dk-font-bold dk-text-gray-900 dk-mb-wp-3",children:(0,ua.__)("Tools & Utilities","dokan-kits")}),(0,br.jsx)("p",{className:"dk-max-w-2xl dk-mx-auto dk-text-lg dk-text-gray-600 dk-mb-wp-3",children:(0,ua.__)("Manage advanced Dokan Kits maintenance and migration tasks. Use these tools for troubleshooting, database management, and data migration.","dokan-kits")}),(0,br.jsx)("p",{className:"dk-max-w-2xl dk-mx-auto dk-text-base dk-text-gray-500",children:(0,ua.__)("These utilities help you maintain and optimize your Dokan Kits installation for better performance and reliability.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-mt-wp-6 dk-flex dk-flex-wrap dk-justify-center dk-gap-wp-4",children:[(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-blue-100 dk-text-blue-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-admin-tools dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Maintenance","dokan-kits")]}),(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-green-100 dk-text-green-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-database dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Database","dokan-kits")]}),(0,br.jsxs)("span",{className:"dk-inline-flex dk-items-center dk-px-wp-3 dk-py-wp-1 dk-rounded-full dk-text-sm dk-font-medium dk-bg-purple-100 dk-text-purple-800",children:[(0,br.jsx)("span",{className:"dashicons dashicons-performance dk-mr-wp-1 dk-text-sm"}),(0,ua.__)("Optimization","dokan-kits")]})]})]})}),(()=>{if(!a)return null;const{needs_migration:e,is_running:t,migration_history:s}=a;return t?(0,br.jsxs)(r.Notice,{status:"warning",isDismissible:!1,className:"dk-mb-4",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Migration in Progress","dokan-kits")}),(0,br.jsx)("p",{children:(0,ua.__)("A migration is currently running. Please wait for it to complete before running other tools.","dokan-kits")})]}):e?(0,br.jsxs)(r.Notice,{status:"info",isDismissible:!1,className:"dk-mb-4",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Migration Required","dokan-kits")}),(0,br.jsx)("p",{children:(0,ua.__)("Your database needs to be migrated to the latest version. Please run the migration tool below.","dokan-kits")})]}):(0,br.jsxs)(r.Notice,{status:"success",isDismissible:!1,className:"dk-mb-4",children:[(0,br.jsx)("strong",{children:(0,ua.__)("Up to Date","dokan-kits")}),(0,br.jsxs)("p",{children:[(0,ua.__)("All migrations are current.","dokan-kits"),s&&s.length>0&&(0,br.jsx)("span",{className:"dk-ml-2 dk-text-sm",children:(0,ua.__)("Last migration completed successfully.","dokan-kits")})]})]})})(),(0,br.jsxs)("div",{className:"dk-mb-wp-8",children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Database Tools","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6",children:[(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-md",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-database dk-mr-wp-2 dk-text-primary-600"}),(0,ua.__)("Database Tables","dokan-kits")]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Recreate missing or corrupted database tables. This will create new tables and verify their structure without affecting existing data.","dokan-kits")}),x("recreateTables")]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(r.Button,{variant:"primary",className:"dk-admin-button",isBusy:m.recreateTables,disabled:m.recreateTables,onClick:()=>f("recreateTables","database/recreate"),children:m.recreateTables?(0,ua.__)("Processing…","dokan-kits"):(0,ua.__)("Recreate Tables","dokan-kits")})})]}),(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-md",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-performance dk-mr-wp-2 dk-text-primary-600"}),(0,ua.__)("Optimize Tables","dokan-kits")]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Repair and optimize database tables to improve performance and fix potential data corruption issues. This may take several minutes.","dokan-kits")}),x("optimizeTables")]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(r.Button,{variant:"primary",className:"dk-admin-button",isBusy:m.optimizeTables,disabled:m.optimizeTables,onClick:()=>f("optimizeTables","database/optimize"),children:m.optimizeTables?(0,ua.__)("Optimizing…","dokan-kits"):(0,ua.__)("Optimize Tables","dokan-kits")})})]})]})]}),(0,br.jsxs)("div",{className:"dk-mb-wp-8",children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Data Migration","dokan-kits")}),(0,br.jsx)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6",children:(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-md",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-migrate dk-mr-wp-2 dk-text-secondary-600"}),(0,ua.__)("Migrate Settings","dokan-kits")]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Migrate legacy Dokan Kits options to the new settings structure. This is required when upgrading from older versions.","dokan-kits")}),a&&a.needs_migration&&(0,br.jsx)("div",{className:"dk-p-3 dk-bg-yellow-50 dk-border dk-border-yellow-200 dk-rounded dk-text-sm dk-text-yellow-800 dk-mb-4",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-warning dk-mr-2"}),(0,br.jsxs)("div",{children:[(0,br.jsx)("strong",{children:(0,ua.__)("Migration Required","dokan-kits")}),(0,br.jsx)("p",{className:"dk-mt-1",children:(0,ua.__)("Your database needs to be migrated to work with the current version.","dokan-kits")})]})]})}),x("migrateSettings")]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(r.Button,{variant:a&&a.needs_migration?"primary":"secondary",className:a&&a.needs_migration?"dk-admin-button":"dk-admin-button dk-admin-button-secondary",isBusy:m.migrateSettings,disabled:m.migrateSettings||a&&a.is_running,onClick:()=>f("migrateSettings","migration/run"),children:m.migrateSettings?(0,ua.__)("Migrating…","dokan-kits"):(0,ua.__)("Run Migration","dokan-kits")})})]})})]}),(0,br.jsxs)("div",{className:"dk-mb-wp-8",children:[(0,br.jsx)("h2",{className:"dk-text-2xl dk-font-bold dk-text-gray-900 dk-mb-wp-4",children:(0,ua.__)("Troubleshooting","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-1 md:dk-grid-cols-2 dk-gap-wp-6",children:[(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-md",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-chart-bar dk-mr-wp-2 dk-text-primary-600"}),(0,ua.__)("System Diagnostics","dokan-kits")]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Run comprehensive diagnostic tests to identify potential issues with your environment, dependencies, and configuration.","dokan-kits")}),x("runDiagnostics"),(()=>{if(!c)return null;const{wordpress:e,php:t,dokan_kits:a,system_check:r}=c;return(0,br.jsxs)("div",{className:"dk-mt-2 dk-p-3 dk-bg-blue-50 dk-border dk-border-blue-200 dk-rounded dk-text-sm",children:[(0,br.jsx)("div",{className:"dk-font-medium dk-text-blue-800 dk-mb-2",children:(0,ua.__)("System Status Overview","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-grid dk-grid-cols-2 dk-gap-2 dk-text-xs",children:[e&&(0,br.jsxs)("div",{children:[(0,br.jsx)("strong",{children:(0,ua.__)("WordPress:","dokan-kits")})," ",e.version]}),t&&(0,br.jsxs)("div",{children:[(0,br.jsx)("strong",{children:(0,ua.__)("PHP:","dokan-kits")})," ",t.version]}),a&&(0,br.jsxs)("div",{children:[(0,br.jsx)("strong",{children:(0,ua.__)("Plugin:","dokan-kits")})," ",a.version]}),r&&(0,br.jsxs)("div",{className:r.pass?"dk-text-green-600":"dk-text-red-600",children:[(0,br.jsx)("strong",{children:(0,ua.__)("System Check:","dokan-kits")})," ",r.pass?(0,ua.__)("Pass","dokan-kits"):(0,ua.__)("Fail","dokan-kits")]})]})]})})()]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(r.Button,{variant:"primary",className:"dk-admin-button",isBusy:m.runDiagnostics,disabled:m.runDiagnostics,onClick:()=>f("runDiagnostics","diagnostics/run"),children:m.runDiagnostics?(0,ua.__)("Running Diagnostics…","dokan-kits"):(0,ua.__)("Run System Check","dokan-kits")})})]}),(0,br.jsxs)(r.Card,{className:"dk-flex-1 dk-flex dk-flex-col dk-transition dk-duration-300 dk-ease-in-out hover:dk-shadow-md",children:[(0,br.jsx)(r.CardHeader,{children:(0,br.jsxs)("h3",{className:"dk-text-xl dk-font-semibold dk-text-gray-900 dk-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-media-text dk-mr-wp-2 dk-text-primary-600"}),(0,ua.__)("Debug Logs","dokan-kits")]})}),(0,br.jsxs)(r.CardBody,{children:[(0,br.jsx)("p",{className:"dk-text-gray-600 dk-mb-wp-4",children:(0,ua.__)("Generate and download comprehensive debug logs including system information, configuration, and error details for support purposes.","dokan-kits")}),x("downloadLogs")]}),(0,br.jsx)(r.CardFooter,{className:"dk-bg-gray-50 dk-border-t dk-border-gray-200",children:(0,br.jsx)(r.Button,{variant:"primary",className:"dk-admin-button",isBusy:m.downloadLogs,disabled:m.downloadLogs,onClick:async()=>{k((e=>({...e,downloadLogs:!0})));try{const e=await Us()({path:"/dokan-kits/v1/tools/download-logs",method:"POST"});if(!e.success||!e.data){const t=e.data||{};throw{message:e.message||(0,ua.__)("Failed to prepare log file.","dokan-kits"),code:t.code||"log_download_failed",status:t.status||400,data:t}}{const{file_url:t,file_name:a}=e.data,r=document.createElement("a");r.href=t,r.download=a,r.target="_blank",document.body.appendChild(r),r.click(),document.body.removeChild(r),l((t=>({...t,downloadLogs:{success:!0,message:e.message,data:e.data,timestamp:(new Date).toISOString()}}))),h((0,ua.__)("Log file prepared for download successfully.","dokan-kits"),"success")}}catch(e){const t=e.message||(0,ua.__)("Failed to download logs.","dokan-kits"),a=e.code||"log_download_failed",r=e.data||{};l((e=>({...e,downloadLogs:{success:!1,message:t,code:a,data:r,timestamp:(new Date).toISOString()}}))),h(t,"error")}finally{k((e=>({...e,downloadLogs:!1})))}},children:m.downloadLogs?(0,ua.__)("Preparing Download…","dokan-kits"):(0,ua.__)("Download Debug Logs","dokan-kits")})})]})]})]}),(0,br.jsx)("div",{className:"dk-mt-wp-10 dk-p-wp-6 dk-bg-yellow-50 dk-rounded-lg dk-border dk-border-yellow-200",children:(0,br.jsxs)("div",{className:"dk-flex dk-items-start",children:[(0,br.jsx)("div",{className:"dk-flex-shrink-0 dk-mr-wp-4",children:(0,br.jsx)("span",{className:"dashicons dashicons-info-outline dk-text-2xl dk-text-yellow-600"})}),(0,br.jsxs)("div",{children:[(0,br.jsx)("h3",{className:"dk-text-lg dk-font-semibold dk-text-yellow-800 dk-mb-wp-2",children:(0,ua.__)("Need Help?","dokan-kits")}),(0,br.jsx)("p",{className:"dk-text-yellow-700 dk-mb-wp-3",children:(0,ua.__)("If you encounter issues while using these tools or need additional support, please visit our support forum or documentation. When contacting support, include your debug logs for faster assistance.","dokan-kits")}),(0,br.jsxs)("div",{className:"dk-flex dk-flex-wrap dk-gap-wp-3",children:[(0,br.jsxs)("a",{href:"https://wordpress.org/support/plugin/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-warning dk-inline-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-sos dk-mr-1"}),(0,ua.__)("Get Support","dokan-kits")]}),(0,br.jsxs)("a",{href:"https://wordpress.org/plugins/dokan-kits/",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-secondary dk-inline-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-book dk-mr-1"}),(0,ua.__)("Documentation","dokan-kits")]}),(0,br.jsxs)("a",{href:"https://github.com/getdokan/dokan-kits/issues",target:"_blank",rel:"noopener noreferrer",className:"dk-admin-button dk-admin-button-secondary dk-inline-flex dk-items-center",children:[(0,br.jsx)("span",{className:"dashicons dashicons-tickets-alt dk-mr-1"}),(0,ua.__)("Report Issue","dokan-kits")]})]}),(0,br.jsxs)("div",{className:"dk-mt-wp-4 dk-p-3 dk-bg-yellow-100 dk-rounded dk-border dk-border-yellow-300",children:[(0,br.jsx)("h4",{className:"dk-font-medium dk-text-yellow-800 dk-mb-2",children:(0,ua.__)("Before contacting support:","dokan-kits")}),(0,br.jsxs)("ul",{className:"dk-text-sm dk-text-yellow-700 dk-list-disc dk-list-inside dk-space-y-1",children:[(0,br.jsx)("li",{children:(0,ua.__)("Run system diagnostics to identify common issues","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Download debug logs to include with your support request","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Check if migrations are up to date","dokan-kits")}),(0,br.jsx)("li",{children:(0,ua.__)("Try recreating database tables if experiencing data issues","dokan-kits")})]})]})]})]})})]})},fn=ea([{path:"/",element:(0,br.jsx)(Os,{}),errorElement:(0,br.jsx)(yr,{}),children:[{index:!0,element:(0,br.jsx)(Ws,{})},{path:"features",element:(0,br.jsx)(mn,{})},{path:"about",element:(0,br.jsx)(Is,{})},{path:"tools",element:(0,br.jsx)(pn,{})}]},{path:"*",element:(0,br.jsx)(kn,{})}]);n()((()=>{const e=document.getElementById("dokan-kits-admin-root");if(!e)return;e.classList.add("dokan-kits-admin-page");const t=(0,o.createRoot)(e),a=window.Dokan_Kits?.initialPath||"/",s=ea(fn.routes,{initialEntries:[a]});t.render((0,br.jsx)(i.StrictMode,{children:(0,br.jsx)(r.SlotFillProvider,{children:(0,br.jsx)(Ls,{children:(0,br.jsx)(ca,{router:s})})})}))}))})();
  • dokan-kits/trunk/dokan-kits.php

    r3320185 r3321393  
    1212 * Plugin URI:      https://wordpress.org/plugins/dokan-kits
    1313 * Description:     The Helper Toolkits plugin for Dokan is a feature-packed add-on designed to streamline and enhance the functionality of your Dokan-powered multi-vendor marketplace.
    14  * Version:         3.0.2
     14 * Version:         3.0.3
    1515 * Author:          WPIntegrity
    1616 * Author URI:      https://wpintegrity.com/
     
    3737
    3838// Define plugin constants.
    39 define( 'DOKAN_KITS_VERSION', '3.0.2' );
     39define( 'DOKAN_KITS_VERSION', '3.0.3' );
    4040define( 'DOKAN_KITS_FILE', __FILE__ );
    4141define( 'DOKAN_KITS_BASENAME', plugin_basename( __FILE__ ) );
     
    4747
    4848// Composer autoloader.
    49 if ( ! file_exists( DOKAN_KITS_PLUGIN_PATH . 'vendor/autoload.php' ) ) {
     49if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) ||
     50    ! file_exists( __DIR__ . '/freemius/start.php' ) ||
     51    ! file_exists( __DIR__ . '/class-dokan-kits.php' ) ) {
    5052    return;
    5153}
    5254
    53 require_once DOKAN_KITS_PLUGIN_PATH . 'vendor/autoload.php';
     55require_once __DIR__ . '/vendor/autoload.php';
    5456
    5557/**
    5658 * Include file for loading the Dokan_Kits class.
    5759 */
    58 require_once DOKAN_KITS_PLUGIN_PATH . 'class-dokan-kits.php';
     60require_once __DIR__ . '/class-dokan-kits.php';
    5961
    6062/**
  • dokan-kits/trunk/includes/Admin/Assets.php

    r3320185 r3321393  
    103103        // Get plugin data for front-end components.
    104104        $plugin_data = array(
     105            'isDebugMode' => defined( 'WP_DEBUG' ) && defined( 'SCRIPT_DEBUG' ) && WP_DEBUG && SCRIPT_DEBUG,
    105106            'ajaxUrl'     => admin_url( 'admin-ajax.php' ),
    106107            'apiRoot'     => esc_url_raw( rest_url( 'dokan-kits/v1' ) ),
  • dokan-kits/trunk/includes/Core/Data/Models/Settings.php

    r3317042 r3321393  
    141141     * @return WC_DateTime|NULL object if the date is set or null if there is no date.
    142142     */
    143     public function get_date_created( string $context = 'view' ): ?WC_DateTime {
     143    public function get_date_created( string $context = 'view' ) {
    144144        return $this->get_prop( 'date_created', $context );
    145145    }
     
    152152     * @return WC_DateTime|NULL object if the date is set or null if there is no date.
    153153     */
    154     public function get_date_modified( string $context = 'view' ): ?WC_DateTime {
     154    public function get_date_modified( string $context = 'view' ) {
    155155        return $this->get_prop( 'date_modified', $context );
    156156    }
  • dokan-kits/trunk/includes/Core/Data/Stores/SettingsDataStore.php

    r3320185 r3321393  
    440440     * Prepare value from database for use
    441441     *
    442      * @param string $value Value from database.
     442     * @param string|array $value Value from database.
    443443     *
    444444     * @return mixed
    445445     */
    446     protected function prepare_value_from_db( string $value ) {
     446    protected function prepare_value_from_db( $value ) {
    447447        if ( is_serialized( $value ) ) {
    448448            $prepared_value = maybe_unserialize( $value );
     
    469469     * Check if a string is JSON
    470470     *
    471      * @param string $string_data String to check.
     471     * @param string|array $string_data String to check.
    472472     *
    473473     * @return bool
    474474     */
    475     protected function is_json( string $string_data ): bool {
    476         if ( empty( $string_data ) ) {
     475    protected function is_json( $string_data ): bool {
     476        if ( empty( $string_data ) || ! is_string( $string_data ) ) {
    477477            return false;
    478478        }
     
    621621                'limit'   => -1,
    622622                'offset'  => 0,
    623                 'in'      => array(), // Array of setting names to filter by
     623                'in'      => array(),
    624624            )
    625625        );
     
    633633         * @param SettingsDataStore $this Data store instance
    634634         */
    635         $args = apply_filters( 'dokan_kits_settings_get_all_args', $args, $this );
    636 
    637         $cache_key     = 'settings_all_' . md5( wp_json_encode( $args ) );
    638         $settings_data = wp_cache_get( $cache_key, $this->cache_group );
    639 
    640         if ( false === $settings_data ) {
     635        $args = (array) apply_filters( 'dokan_kits_settings_get_all_args', $args, $this );
     636
     637        $cache_key = 'settings_all_' . md5( wp_json_encode( $args ) );
     638        $results  = wp_cache_get( $cache_key, $this->cache_group );
     639
     640        if ( false === $results ) {
    641641            $query  = "SELECT * FROM {$this->table_name}";
    642642            $where  = array();
     
    669669            // Prepare the query if we have values to inject
    670670            if ( ! empty( $values ) ) {
    671                 $query = $wpdb->prepare( $query, $values );
    672             }
    673 
    674             $settings_data = $wpdb->get_results( $query );
    675 
    676             wp_cache_set( $cache_key, $settings_data, $this->cache_group );
     671                $query = $wpdb->prepare( $query, $values ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
     672            }
     673
     674            $results = $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
     675
     676            wp_cache_set( $cache_key, $results, $this->cache_group );
    677677        }
    678678
     
    681681                return new Settings( (array) $data );
    682682            },
    683             $settings_data
     683            $results
    684684        );
    685685
     
    691691         * @param array<Settings>   $settings_objects Settings objects
    692692         * @param array             $args             Query arguments
    693          * @param array             $settings_data    Settings data from the database
     693         * @param array             $results          Settings data from the database
    694694         * @param SettingsDataStore $this             Data store instance
    695695         */
    696         return apply_filters( 'dokan_kits_settings_get_all', $settings_objects, $args, $settings_data, $this );
     696        return apply_filters( 'dokan_kits_settings_get_all', $settings_objects, $args, $results, $this );
    697697    }
    698698
     
    784784              UNIQUE KEY name (name)
    785785            ) $collate;
    786            
     786
    787787            CREATE TABLE {$wpdb->prefix}dokan_kits_settingsmeta (
    788788              `meta_id` bigint(20) unsigned NOT NULL auto_increment,
     
    870870     */
    871871    public function update_db_version(): void {
    872         // Try to get existing setting
    873         $settings = $this->get_settings_by_name( 'system' );
     872        $new_values = array();
     873        $settings   = $this->get_settings_by_name( 'system' );
    874874        if ( null === $settings ) {
    875875            $settings = dokan_kits_get_container()->get( Settings::class );
    876876            $settings->set_name( 'system' );
    877877        } else {
    878             $new_values = $settings->get_value() ?? array();
    879         }
     878            $new_values = $settings->get_value();
     879        }
     880
     881        $new_values = maybe_unserialize( $new_values );
    880882
    881883        // Add the new value to the existing value
     
    888890    }
    889891
     892    /**
     893     * Get the array of allowed settings groups that can be modified
     894     *
     895     * @since  3.0.0
     896     *
     897     * @return array<string> Array of allowed settings groups
     898     */
    890899    public function get_allowed_groups(): array {
     900        /**
     901         * Get the array of allowed settings groups that can be modified.
     902         *
     903         * @since  3.0.0
     904         *
     905         * @return array<string> Array of setting group names including:
     906         *                       'product' - Product related settings
     907         *                       'vendor' - Vendor related settings
     908         *                       'cart' - Cart related settings
     909         *                       'shipping' - Shipping related settings
     910         *
     911         * @filter dokan_kits_settings_allowed_groups
     912         */
    891913        return apply_filters( 'dokan_kits_settings_allowed_groups', array( 'product', 'vendor', 'cart', 'shipping' ) );
    892914    }
  • dokan-kits/trunk/includes/REST/Controllers/Controller.php

    r3320185 r3321393  
    1414 * Abstract REST Controller
    1515 *
    16  * Base class for all REST controllers
     16 * Base class for all REST controllers with consistent patterns
    1717 *
    1818 * @package DokanKits\REST\Controllers
     19 * @since   3.0.1
    1920 */
    2021abstract class Controller extends WP_REST_Controller {
     
    5859    public function admin_permissions_check( WP_REST_Request $request ) {
    5960        return ( new Authentication() )->validate( $request, true );
     61    }
     62
     63    /**
     64     * Check if the current user is a vendor
     65     *
     66     * @since 3.0.1
     67     *
     68     * @param WP_REST_Request $request Full details about the request.
     69     *
     70     * @return bool|WP_Error True if the user is vendor, WP_Error if not.
     71     */
     72    public function vendor_permissions_check( WP_REST_Request $request ) {
     73        return ( new Authentication() )->check_vendor( $request );
     74    }
     75
     76    /**
     77     * Check if the current user has specific capability
     78     *
     79     * @since 3.0.1
     80     *
     81     * @param WP_REST_Request $request    Full details about the request.
     82     * @param string          $capability Required capability.
     83     *
     84     * @return bool|WP_Error True if the user has capability, WP_Error if not.
     85     */
     86    public function capability_permissions_check( WP_REST_Request $request, string $capability ) {
     87        return ( new Authentication() )->check_capability( $request, $capability );
     88    }
     89
     90    /**
     91     * Check if the current user owns the resource
     92     *
     93     * @since 3.0.1
     94     *
     95     * @param WP_REST_Request $request        Full details about the request.
     96     * @param int             $resource_owner Resource owner user ID.
     97     *
     98     * @return bool|WP_Error True if the user owns resource, WP_Error if not.
     99     */
     100    public function ownership_permissions_check( WP_REST_Request $request, int $resource_owner ) {
     101        return ( new Authentication() )->check_ownership( $request, $resource_owner );
    60102    }
    61103
     
    105147        return ApiResponse::error( $message, $code, $status, $data );
    106148    }
     149
     150    /**
     151     * Handle exceptions in a standardized way
     152     *
     153     * @since 3.0.1
     154     *
     155     * @param \Throwable $exception The exception to handle.
     156     * @param string     $context   Context where the exception occurred.
     157     *
     158     * @return WP_Error Standardized error response.
     159     */
     160    protected function handle_exception( \Throwable $exception, string $context = '' ): WP_Error {
     161        // Log the exception
     162        dokan_kits_logger()->error(
     163            // translators: 1. Current class, 2. Error message.
     164            sprintf( 'Exception in %s: %s', $context ?: static::class, $exception->getMessage() ),
     165            array(
     166                'exception' => $exception,
     167                'context'   => $context,
     168                'file'      => $exception->getFile(),
     169                'line'      => $exception->getLine(),
     170            )
     171        );
     172
     173        return ApiResponse::from_exception( $exception );
     174    }
     175
     176    /**
     177     * Sanitize and validate pagination parameters
     178     *
     179     * @since 3.0.1
     180     *
     181     * @param WP_REST_Request $request The request object.
     182     *
     183     * @return array Sanitized pagination parameters.
     184     */
     185    protected function get_pagination_params( WP_REST_Request $request ): array {
     186        $per_page = $request->get_param( 'per_page' );
     187        $page     = $request->get_param( 'page' );
     188        $offset   = $request->get_param( 'offset' );
     189
     190        // Sanitize per_page
     191        $per_page = absint( $per_page );
     192        if ( $per_page < 1 ) {
     193            $per_page = 10; // Default
     194        }
     195        if ( $per_page > 100 ) {
     196            $per_page = 100; // Maximum
     197        }
     198
     199        // Sanitize page
     200        $page = absint( $page );
     201        if ( $page < 1 ) {
     202            $page = 1;
     203        }
     204
     205        // Calculate offset if not provided
     206        if ( null === $offset ) {
     207            $offset = ( $page - 1 ) * $per_page;
     208        } else {
     209            $offset = absint( $offset );
     210        }
     211
     212        return array(
     213            'per_page' => $per_page,
     214            'page'     => $page,
     215            'offset'   => $offset,
     216        );
     217    }
     218
     219    /**
     220     * Add pagination headers to response
     221     *
     222     * @since 3.0.1
     223     *
     224     * @param WP_REST_Response $response    The response object.
     225     * @param WP_REST_Request  $request     The request object.
     226     * @param int              $total_items Total number of items.
     227     * @param int              $per_page    Items per page.
     228     * @param int              $page        Current page.
     229     *
     230     * @return void
     231     */
     232    protected function add_pagination_headers( WP_REST_Response $response, WP_REST_Request $request, int $total_items, int $per_page, int $page ): void {
     233        $total_pages = ceil( $total_items / $per_page );
     234
     235        $response->header( 'X-WP-Total', $total_items );
     236        $response->header( 'X-WP-TotalPages', $total_pages );
     237
     238        // Add link headers for navigation
     239        $base_url = add_query_arg( $request->get_query_params(), rest_url( $this->namespace . '/' . $this->rest_base ) );
     240
     241        $links = array();
     242
     243        if ( $page > 1 ) {
     244            $links['prev'] = add_query_arg( 'page', $page - 1, $base_url );
     245        }
     246
     247        if ( $page < $total_pages ) {
     248            $links['next'] = add_query_arg( 'page', $page + 1, $base_url );
     249        }
     250
     251        if ( ! empty( $links ) ) {
     252            $link_header = array();
     253            foreach ( $links as $rel => $url ) {
     254                $link_header[] = sprintf( '<%s>; rel="%s"', esc_url( $url ), $rel );
     255            }
     256            $response->header( 'Link', implode( ', ', $link_header ) );
     257        }
     258    }
     259
     260    /**
     261     * Sanitize text input
     262     *
     263     * @since 3.0.1
     264     *
     265     * @param mixed $value The value to sanitize.
     266     *
     267     * @return string Sanitized text.
     268     */
     269    protected function sanitize_text( $value ): string {
     270        return sanitize_text_field( (string) $value );
     271    }
     272
     273    /**
     274     * Sanitize key input
     275     *
     276     * @since 3.0.1
     277     *
     278     * @param mixed $value The value to sanitize.
     279     *
     280     * @return string Sanitized key.
     281     */
     282    protected function sanitize_key( $value ): string {
     283        return sanitize_key( (string) $value );
     284    }
     285
     286    /**
     287     * Sanitize integer input
     288     *
     289     * @since 3.0.1
     290     *
     291     * @param mixed $value   The value to sanitize.
     292     * @param int   $default Default value if invalid.
     293     *
     294     * @return int Sanitized integer.
     295     */
     296    protected function sanitize_int( $value, int $default = 0 ): int {
     297        $int = absint( $value );
     298        return $int > 0 ? $int : $default;
     299    }
     300
     301    /**
     302     * Sanitize boolean input
     303     *
     304     * @since 3.0.1
     305     *
     306     * @param mixed $value The value to sanitize.
     307     *
     308     * @return bool Sanitized boolean.
     309     */
     310    protected function sanitize_bool( $value ): bool {
     311        return rest_sanitize_boolean( $value );
     312    }
     313
     314    /**
     315     * Sanitize array input
     316     *
     317     * @since 3.0.1
     318     *
     319     * @param mixed $value    The value to sanitize.
     320     * @param array $defaults Default array if invalid.
     321     *
     322     * @return array Sanitized array.
     323     */
     324    protected function sanitize_array( $value, array $defaults = array() ): array {
     325        if ( ! is_array( $value ) ) {
     326            return $defaults;
     327        }
     328
     329        return array_map( 'sanitize_text_field', $value );
     330    }
     331
     332    /**
     333     * Get standard collection parameters
     334     *
     335     * @since 3.0.1
     336     *
     337     * @return array Standard collection parameters.
     338     */
     339    protected function get_standard_collection_params(): array {
     340        return array(
     341            'page'     => array(
     342                'description' => __( 'Current page of the collection.', 'dokan-kits' ),
     343                'type'        => 'integer',
     344                'default'     => 1,
     345                'minimum'     => 1,
     346            ),
     347            'per_page' => array(
     348                'description' => __( 'Maximum number of items to be returned in result set.', 'dokan-kits' ),
     349                'type'        => 'integer',
     350                'default'     => 10,
     351                'minimum'     => 1,
     352                'maximum'     => 100,
     353            ),
     354            'search'   => array(
     355                'description' => __( 'Limit results to those matching a string.', 'dokan-kits' ),
     356                'type'        => 'string',
     357            ),
     358            'orderby'  => array(
     359                'description' => __( 'Sort collection by attribute.', 'dokan-kits' ),
     360                'type'        => 'string',
     361                'default'     => 'id',
     362            ),
     363            'order'    => array(
     364                'description' => __( 'Order sort attribute ascending or descending.', 'dokan-kits' ),
     365                'type'        => 'string',
     366                'default'     => 'ASC',
     367                'enum'        => array( 'ASC', 'DESC' ),
     368            ),
     369        );
     370    }
     371
     372    /**
     373     * Get standard response schema properties
     374     *
     375     * @since 3.0.1
     376     *
     377     * @return array Standard response schema properties.
     378     */
     379    protected function get_standard_response_schema(): array {
     380        return array(
     381            'success' => array(
     382                'description' => __( 'Whether the request was successful.', 'dokan-kits' ),
     383                'type'        => 'boolean',
     384                'context'     => array( 'view', 'edit' ),
     385                'readonly'    => true,
     386            ),
     387            'message' => array(
     388                'description' => __( 'Human-readable message describing the result.', 'dokan-kits' ),
     389                'type'        => 'string',
     390                'context'     => array( 'view', 'edit' ),
     391                'readonly'    => true,
     392            ),
     393            'data'    => array(
     394                'description' => __( 'Response data.', 'dokan-kits' ),
     395                'type'        => 'object',
     396                'context'     => array( 'view', 'edit' ),
     397            ),
     398        );
     399    }
     400
     401    /**
     402     * Prepare a standard error response for invalid resource ID
     403     *
     404     * @since 3.0.1
     405     *
     406     * @param string $resource_type Resource type (e.g., 'setting', 'user').
     407     * @param mixed  $resource_id   Resource ID that was invalid.
     408     *
     409     * @return WP_Error Error response.
     410     */
     411    protected function invalid_resource_id_error( string $resource_type, $resource_id ): WP_Error {
     412        return $this->error(
     413            sprintf(
     414            /* translators: 1: resource type, 2: resource ID */
     415                __( 'Invalid %1$s ID: %2$s', 'dokan-kits' ),
     416                $resource_type,
     417                $resource_id
     418            ),
     419            'invalid_' . $resource_type . '_id',
     420            400
     421        );
     422    }
     423
     424    /**
     425     * Prepare a standard error response for resource not found
     426     *
     427     * @since 3.0.1
     428     *
     429     * @param string $resource_type Resource type (e.g., 'setting', 'user').
     430     * @param mixed  $resource_id   Resource ID that was not found.
     431     *
     432     * @return WP_Error Error response.
     433     */
     434    protected function resource_not_found_error( string $resource_type, $resource_id ): WP_Error {
     435        return $this->error(
     436            sprintf(
     437            /* translators: 1: resource type, 2: resource ID */
     438                __( '%1$s not found: %2$s', 'dokan-kits' ),
     439                ucfirst( $resource_type ),
     440                $resource_id
     441            ),
     442            $resource_type . '_not_found',
     443            404
     444        );
     445    }
     446
     447    /**
     448     * Prepare a standard error response for missing required parameter
     449     *
     450     * @since 3.0.1
     451     *
     452     * @param string $parameter_name Parameter name that is missing.
     453     *
     454     * @return WP_Error Error response.
     455     */
     456    protected function missing_parameter_error( string $parameter_name ): WP_Error {
     457        return $this->error(
     458            sprintf(
     459            /* translators: %s: parameter name */
     460                __( 'Missing required parameter: %s', 'dokan-kits' ),
     461                $parameter_name
     462            ),
     463            'missing_parameter',
     464            400
     465        );
     466    }
     467
     468    /**
     469     * Prepare a standard success message for resource operation
     470     *
     471     * @since 3.0.1
     472     *
     473     * @param string $resource_type Resource type (e.g., 'setting', 'user').
     474     * @param string $operation     Operation performed (e.g., 'created', 'updated', 'deleted').
     475     * @param mixed  $resource_id   Resource ID (optional).
     476     *
     477     * @return string Success message.
     478     */
     479    protected function get_operation_success_message( string $resource_type, string $operation, $resource_id = null ): string {
     480        if ( $resource_id ) {
     481            return sprintf(
     482            /* translators: 1: resource type, 2: resource ID, 3: operation */
     483                __( '%1$s "%2$s" %3$s successfully.', 'dokan-kits' ),
     484                ucfirst( $resource_type ),
     485                $resource_id,
     486                $operation
     487            );
     488        }
     489
     490        return sprintf(
     491        /* translators: 1: resource type, 2: operation */
     492            __( '%1$s %2$s successfully.', 'dokan-kits' ),
     493            ucfirst( $resource_type ),
     494            $operation
     495        );
     496    }
    107497}
  • dokan-kits/trunk/includes/REST/Controllers/Version1/DashboardController.php

    r3320185 r3321393  
    1313use DokanKits\Features\Feature;
    1414use DokanKits\REST\Controllers\Controller;
     15use Exception;
    1516use WP_Error;
    1617use WP_REST_Request;
     
    3233     */
    3334    protected $rest_base = 'dashboard';
     35
     36    /**
     37     * Settings data store instance.
     38     *
     39     * @var SettingsDataStore
     40     */
     41    private $data_store;
     42
     43    /**
     44     * Constructor.
     45     *
     46     * @since 3.0.0
     47     */
     48    public function __construct() {
     49        $this->data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
     50    }
    3451
    3552    /**
     
    5067                    'callback'            => array( $this, 'get_dashboard_data' ),
    5168                    'permission_callback' => array( $this, 'admin_permissions_check' ),
    52                     'args'                => $this->get_dashboard_args(),
     69                    'args'                => $this->get_dashboard_params(),
    5370                ),
    54                 'schema' => array( $this, 'get_item_schema' ),
     71                'schema' => array( $this, 'get_dashboard_schema' ),
    5572            )
    5673        );
     
    6582                    'callback'            => array( $this, 'get_statistics' ),
    6683                    'permission_callback' => array( $this, 'admin_permissions_check' ),
    67                     'args'                => $this->get_statistics_args(),
     84                    'args'                => $this->get_statistics_params(),
    6885                ),
    6986                'schema' => array( $this, 'get_statistics_schema' ),
     
    8097                    'callback'            => array( $this, 'export_settings' ),
    8198                    'permission_callback' => array( $this, 'admin_permissions_check' ),
    82                     'args'                => $this->get_export_args(),
     99                    'args'                => $this->get_export_params(),
    83100                ),
    84101                'schema' => array( $this, 'get_export_schema' ),
     
    95112                    'callback'            => array( $this, 'import_settings' ),
    96113                    'permission_callback' => array( $this, 'admin_permissions_check' ),
    97                     'args'                => $this->get_import_args(),
     114                    'args'                => $this->get_import_params(),
    98115                ),
    99116                'schema' => array( $this, 'get_import_schema' ),
     
    110127                    'callback'            => array( $this, 'reset_settings' ),
    111128                    'permission_callback' => array( $this, 'admin_permissions_check' ),
    112                     'args'                => $this->get_reset_args(),
     129                    'args'                => $this->get_reset_params(),
    113130                ),
    114131                'schema' => array( $this, 'get_reset_schema' ),
     
    124141     * @param WP_REST_Request $request Full details about the request.
    125142     *
    126      * @return WP_REST_Response|WP_Error
     143     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    127144     */
    128145    public function get_dashboard_data( WP_REST_Request $request ) {
     
    137154            do_action( 'dokan_kits_before_get_dashboard_data', $request );
    138155
    139             $include_statistics = $request->get_param( 'include_statistics' );
    140             $include_plugin     = $request->get_param( 'include_plugin' );
    141 
    142             // Get settings data
    143             $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
    144             $settings   = $data_store->get_all( array( 'in' => $data_store->get_allowed_groups() ) );
     156            // Get request parameters
     157            $include_statistics = $this->sanitize_bool( $request->get_param( 'include_statistics' ) );
     158            $include_plugin     = $this->sanitize_bool( $request->get_param( 'include_plugin' ) );
    145159
    146160            // Prepare base response data
    147             $response_data = array(
    148                 'settings_count' => count( $settings ),
    149                 'last_updated'   => current_time( 'mysql' ),
    150             );
     161            $response_data = $this->prepare_base_dashboard_data();
    151162
    152163            // Add statistics if requested
    153164            if ( $include_statistics ) {
    154                 $response_data['statistics'] = $this->get_statistics_data( $settings );
     165                $response_data['statistics'] = $this->get_statistics_data();
    155166            }
    156167
     
    166177             *
    167178             * @param array           $response_data The dashboard data.
    168              * @param Settings[]      $settings      The settings data.
    169179             * @param WP_REST_Request $request       The request object.
    170180             */
    171             $response_data = apply_filters( 'dokan_kits_dashboard_data', $response_data, $settings, $request );
     181            $response_data = apply_filters( 'dokan_kits_dashboard_data', $response_data, $request );
    172182
    173183            /**
     
    181191            do_action( 'dokan_kits_after_get_dashboard_data', $response_data, $request );
    182192
    183             return $this->success( $response_data, __( 'Dashboard data retrieved successfully.', 'dokan-kits' ) );
    184 
    185         } catch ( \Exception $e ) {
    186             return new WP_Error(
    187                 'dokan_kits_dashboard_error',
    188                 __( 'Failed to retrieve dashboard data: ', 'dokan-kits' ) . $e->getMessage(),
    189                 array( 'status' => 500 )
     193            return $this->success(
     194                $response_data,
     195                __( 'Dashboard data retrieved successfully.', 'dokan-kits' )
    190196            );
     197
     198        } catch ( Exception $e ) {
     199            return $this->handle_exception( $e, 'get_dashboard_data' );
    191200        }
    192201    }
     
    199208     * @param WP_REST_Request $request Full details about the request.
    200209     *
    201      * @return WP_REST_Response|WP_Error
     210     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    202211     */
    203212    public function get_statistics( WP_REST_Request $request ) {
    204213        try {
    205             $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
    206             $settings   = $data_store->get_all( array( 'in' => $data_store->get_allowed_groups() ) );
    207 
    208             $statistics = $this->get_statistics_data( $settings );
    209 
    210             return $this->success( $statistics, __( 'Statistics retrieved successfully.', 'dokan-kits' ) );
    211 
    212         } catch ( \Exception $e ) {
    213             return new WP_Error(
    214                 'dokan_kits_statistics_error',
    215                 __( 'Failed to retrieve statistics: ', 'dokan-kits' ) . $e->getMessage(),
    216                 array( 'status' => 500 )
     214            /**
     215             * Action fired before getting statistics.
     216             *
     217             * @since 3.0.0
     218             *
     219             * @param WP_REST_Request $request The request object.
     220             */
     221            do_action( 'dokan_kits_before_get_statistics', $request );
     222
     223            $refresh = $this->sanitize_bool( $request->get_param( 'refresh' ) );
     224
     225            // Get statistics data
     226            $statistics = $this->get_statistics_data( $refresh );
     227
     228            /**
     229             * Filter the statistics data.
     230             *
     231             * @since 3.0.0
     232             *
     233             * @param array           $statistics The statistics data.
     234             * @param WP_REST_Request $request    The request object.
     235             */
     236            $statistics = apply_filters( 'dokan_kits_statistics_data', $statistics, $request );
     237
     238            /**
     239             * Action fired after getting statistics.
     240             *
     241             * @since 3.0.0
     242             *
     243             * @param array           $statistics The statistics data.
     244             * @param WP_REST_Request $request    The request object.
     245             */
     246            do_action( 'dokan_kits_after_get_statistics', $statistics, $request );
     247
     248            return $this->success(
     249                $statistics,
     250                __( 'Statistics retrieved successfully.', 'dokan-kits' )
    217251            );
     252
     253        } catch ( Exception $e ) {
     254            return $this->handle_exception( $e, 'get_statistics' );
    218255        }
    219256    }
     
    226263     * @param WP_REST_Request $request Full details about the request.
    227264     *
    228      * @return WP_REST_Response|WP_Error
     265     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    229266     */
    230267    public function export_settings( WP_REST_Request $request ) {
    231268        try {
    232             // Validate request
    233             $validation = $this->validate(
    234                 $request,
    235                 array(
    236                     'format' => 'string|in:json,array',
    237                     'groups' => 'array',
    238                 )
    239             );
    240 
    241             if ( is_wp_error( $validation ) ) {
    242                 return $validation;
    243             }
    244 
    245269            /**
    246270             * Action fired before exporting settings.
     
    252276            do_action( 'dokan_kits_before_export_settings', $request );
    253277
    254             $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
    255 
    256             $format = $request->get_param( 'format' ) ?? 'array';
    257             $groups = $request->get_param( 'groups' ) ?? $data_store->get_allowed_groups();
    258 
    259             // Validate groups
    260             $allowed_groups = $data_store->get_allowed_groups();
     278            // Get and validate parameters
     279            $format = $this->sanitize_text( $request->get_param( 'format' ) );
     280            $groups = $this->sanitize_array( $request->get_param( 'groups' ) );
     281
     282            // Validate format
     283            if ( ! in_array( $format, array( 'json', 'array' ), true ) ) {
     284                return $this->error(
     285                    __( 'Invalid export format. Allowed formats: json, array', 'dokan-kits' ),
     286                    'invalid_export_format',
     287                    400
     288                );
     289            }
     290
     291            // Validate and filter groups
     292            $allowed_groups = $this->data_store->get_allowed_groups();
    261293            $groups         = array_intersect( $groups, $allowed_groups );
    262294
     
    264296                return $this->error(
    265297                    __( 'No valid groups specified for export.', 'dokan-kits' ),
    266                     'dokan_kits_export_invalid_groups',
     298                    'no_valid_groups',
    267299                    400
    268300                );
    269301            }
    270             $settings = $data_store->get_all( array( 'in' => $groups ) );
    271 
    272             $export_data = array();
    273             foreach ( $settings as $setting ) {
    274                 $export_data[ $setting->get_name() ] = $setting->get_value();
    275             }
     302
     303            // Export settings
     304            $export_result = $this->export_settings_data( $groups, $format );
    276305
    277306            /**
     
    280309             * @since 3.0.0
    281310             *
    282              * @param array           $export_data The export data.
    283              * @param Settings[]      $settings    The settings data.
    284              * @param WP_REST_Request $request     The request object.
    285              */
    286             $export_data = apply_filters( 'dokan_kits_export_settings_data', $export_data, $settings, $request );
    287 
    288             // Format data based on request
    289             if ( 'json' === $format ) {
    290                 $formatted_data = wp_json_encode( $export_data, JSON_PRETTY_PRINT );
    291             } else {
    292                 $formatted_data = $export_data;
    293             }
     311             * @param array           $export_result The export result.
     312             * @param array           $groups        The exported groups.
     313             * @param string          $format        The export format.
     314             * @param WP_REST_Request $request       The request object.
     315             */
     316            $export_result = apply_filters( 'dokan_kits_export_settings_result', $export_result, $groups, $format, $request );
    294317
    295318            /**
     
    298321             * @since 3.0.0
    299322             *
    300              * @param mixed           $formatted_data The formatted export data.
    301              * @param WP_REST_Request $request        The request object.
    302              */
    303             do_action( 'dokan_kits_after_export_settings', $formatted_data, $request );
     323             * @param array           $export_result The export result.
     324             * @param WP_REST_Request $request       The request object.
     325             */
     326            do_action( 'dokan_kits_after_export_settings', $export_result, $request );
    304327
    305328            return $this->success(
    306                 array(
    307                     'data'      => $formatted_data,
    308                     'format'    => $format,
    309                     'groups'    => $groups,
    310                     'count'     => count( $export_data ),
    311                     'timestamp' => current_time( 'mysql' ),
    312                 ),
    313                 __( 'Settings exported successfully.', 'dokan-kits' )
     329                $export_result,
     330                sprintf(
     331                /* translators: %d: Number of settings exported */
     332                    _n(
     333                        '%d setting exported successfully.',
     334                        '%d settings exported successfully.',
     335                        $export_result['count'],
     336                        'dokan-kits'
     337                    ),
     338                    $export_result['count']
     339                )
    314340            );
    315341
    316         } catch ( \Exception $e ) {
    317             return new WP_Error(
    318                 'dokan_kits_export_error',
    319                 __( 'Failed to export settings: ', 'dokan-kits' ) . $e->getMessage(),
    320                 array( 'status' => 500 )
    321             );
     342        } catch ( Exception $e ) {
     343            return $this->handle_exception( $e, 'export_settings' );
    322344        }
    323345    }
     
    330352     * @param WP_REST_Request $request Full details about the request.
    331353     *
    332      * @return WP_REST_Response|WP_Error
     354     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    333355     */
    334356    public function import_settings( WP_REST_Request $request ) {
    335357        try {
    336             // Validate request
    337             $validation = $this->validate(
    338                 $request,
    339                 array(
    340                     'settings' => 'required|array',
    341                 )
    342             );
    343 
    344             if ( is_wp_error( $validation ) ) {
    345                 return $validation;
    346             }
    347 
    348358            /**
    349359             * Action fired before importing settings.
     
    355365            do_action( 'dokan_kits_before_import_settings', $request );
    356366
     367            // Get and validate parameters
    357368            $settings_data = $request->get_param( 'settings' );
    358             $overwrite     = $request->get_param( 'overwrite' ) ?? true;
    359 
    360             if ( empty( $settings_data ) ) {
    361                 return $this->error(
    362                     __( 'No settings data provided.', 'dokan-kits' ),
    363                     'dokan_kits_import_no_data',
    364                     400
    365                 );
    366             }
    367 
    368             // Limit the number of settings to prevent abuse
     369            $overwrite     = $this->sanitize_bool( $request->get_param( 'overwrite' ) );
     370
     371            if ( empty( $settings_data ) || ! is_array( $settings_data ) ) {
     372                return $this->missing_parameter_error( 'settings' );
     373            }
     374
     375            // Validate settings count to prevent abuse
    369376            if ( count( $settings_data ) > 100 ) {
    370377                return $this->error(
    371378                    __( 'Too many settings provided. Maximum 100 settings allowed.', 'dokan-kits' ),
    372                     'dokan_kits_import_too_many',
     379                    'too_many_settings',
    373380                    400
    374381                );
    375382            }
    376383
    377             $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
    378             $errors     = array();
    379             $imported   = array();
    380 
    381             foreach ( $settings_data as $name => $value ) {
    382                 try {
    383                     // Validate setting name
    384                     if ( ! is_string( $name ) || empty( $name ) ) {
    385                         $errors[ $name ] = __( 'Invalid setting name.', 'dokan-kits' );
    386                         continue;
    387                     }
    388 
    389                     // Sanitize setting name
    390                     $name = sanitize_key( $name );
    391 
    392                     $setting = $data_store->get_settings_by_name( $name );
    393 
    394                     if ( null === $setting ) {
    395                         $setting = dokan_kits_get_container()->get( Settings::class );
    396                         $setting->set_name( $name );
    397                     } elseif ( ! $overwrite ) {
    398                         // Skip existing settings if not overwriting
    399                         continue;
    400                     }
    401 
    402                     // Sanitize and validate value
    403                     if ( is_array( $value ) ) {
    404                         $value = array_map( 'wc_clean', $value );
    405                     } else {
    406                         $value = wc_clean( $value );
    407                     }
    408 
    409                     $setting->set_value( $value );
    410                     $setting->save();
    411 
    412                     $imported[] = $name;
    413 
    414                 } catch ( \Exception $e ) {
    415                     $errors[ $name ] = $e->getMessage();
    416                 }
    417             }
     384            // Import settings
     385            $import_result = $this->import_settings_data( $settings_data, $overwrite );
     386
     387            /**
     388             * Filter the import result.
     389             *
     390             * @since 3.0.0
     391             *
     392             * @param array           $import_result The import result.
     393             * @param array           $settings_data The imported settings data.
     394             * @param bool            $overwrite     Whether to overwrite existing settings.
     395             * @param WP_REST_Request $request       The request object.
     396             */
     397            $import_result = apply_filters( 'dokan_kits_import_settings_result', $import_result, $settings_data, $overwrite, $request );
    418398
    419399            /**
     
    422402             * @since 3.0.0
    423403             *
    424              * @param array           $imported The imported settings.
    425              * @param array           $errors   The import errors.
    426              * @param WP_REST_Request $request  The request object.
    427              */
    428             do_action( 'dokan_kits_after_import_settings', $imported, $errors, $request );
    429 
    430             if ( ! empty( $errors ) ) {
     404             * @param array           $import_result The import result.
     405             * @param WP_REST_Request $request       The request object.
     406             */
     407            do_action( 'dokan_kits_after_import_settings', $import_result, $request );
     408
     409            // Return response based on results
     410            if ( ! empty( $import_result['errors'] ) && empty( $import_result['imported'] ) ) {
     411                // All imports failed
     412                return $this->error(
     413                    __( 'All settings failed to import.', 'dokan-kits' ),
     414                    'all_imports_failed',
     415                    400,
     416                    $import_result
     417                );
     418            }
     419
     420            if ( ! empty( $import_result['errors'] ) ) {
     421                // Partial success
    431422                return $this->error(
    432423                    __( 'Some settings failed to import.', 'dokan-kits' ),
    433                     'dokan_kits_import_partial_failure',
    434                     400,
    435                     array(
    436                         'errors'   => $errors,
    437                         'imported' => $imported,
    438                     )
     424                    'partial_import_failure',
     425                    207, // Multi-Status
     426                    $import_result
    439427                );
    440428            }
    441429
     430            // All imports successful
    442431            return $this->success(
    443                 array(
    444                     'imported'  => $imported,
    445                     'total'     => count( $imported ),
    446                     'overwrite' => $overwrite,
    447                 ),
     432                $import_result,
    448433                sprintf(
    449434                /* translators: %d: Number of settings imported */
     
    451436                        '%d setting imported successfully.',
    452437                        '%d settings imported successfully.',
    453                         count( $imported ),
     438                        count( $import_result['imported'] ),
    454439                        'dokan-kits'
    455440                    ),
    456                     count( $imported )
     441                    count( $import_result['imported'] )
    457442                )
    458443            );
    459444
    460         } catch ( \Exception $e ) {
    461             return new WP_Error(
    462                 'dokan_kits_import_error',
    463                 __( 'Failed to import settings: ', 'dokan-kits' ) . $e->getMessage(),
    464                 array( 'status' => 500 )
    465             );
     445        } catch ( Exception $e ) {
     446            return $this->handle_exception( $e, 'import_settings' );
    466447        }
    467448    }
     
    474455     * @param WP_REST_Request $request Full details about the request.
    475456     *
    476      * @return WP_REST_Response|WP_Error
     457     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    477458     */
    478459    public function reset_settings( WP_REST_Request $request ) {
    479460        try {
    480             // Validate request
    481             $validation = $this->validate(
    482                 $request,
    483                 array(
    484                     'scope'   => 'string|in:all,product,vendor,cart,shipping',
    485                     'confirm' => 'required|boolean',
    486                 )
    487             );
    488 
    489             if ( is_wp_error( $validation ) ) {
    490                 return $validation;
    491             }
    492 
    493461            /**
    494462             * Action fired before resetting settings.
     
    500468            do_action( 'dokan_kits_before_reset_settings', $request );
    501469
    502             $scope   = $request->get_param( 'scope' ) ?? 'all';
    503             $confirm = $request->get_param( 'confirm' );
     470            // Get and validate parameters
     471            $scope   = $this->sanitize_text( $request->get_param( 'scope' ) );
     472            $confirm = $this->sanitize_bool( $request->get_param( 'confirm' ) );
    504473
    505474            if ( ! $confirm ) {
    506475                return $this->error(
    507476                    __( 'Please confirm that you want to reset the settings.', 'dokan-kits' ),
    508                     'dokan_kits_confirmation_required',
     477                    'confirmation_required',
    509478                    400
    510479                );
    511480            }
    512481
    513             $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
    514 
    515             if ( 'all' === $scope ) {
    516                 $data_store->reset_by_names( $data_store->get_allowed_groups() );
    517                 $message = __( 'All settings have been reset to defaults.', 'dokan-kits' );
    518             } else {
    519                 $data_store->reset_by_name( $scope );
    520                 /* translators: %s: settings group name */
    521                 $message = sprintf( __( '%s settings have been reset to defaults.', 'dokan-kits' ), ucfirst( $scope ) );
    522             }
     482            // Validate scope
     483            $allowed_scopes = array( 'all', 'product', 'vendor', 'cart', 'shipping' );
     484            if ( ! in_array( $scope, $allowed_scopes, true ) ) {
     485                return $this->error(
     486                    sprintf(
     487                    /* translators: %s: allowed scopes */
     488                        __( 'Invalid scope. Allowed scopes: %s', 'dokan-kits' ),
     489                        implode( ', ', $allowed_scopes )
     490                    ),
     491                    'invalid_scope',
     492                    400
     493                );
     494            }
     495
     496            // Reset settings
     497            $reset_result = $this->reset_settings_data( $scope );
     498
     499            /**
     500             * Filter the reset result.
     501             *
     502             * @since 3.0.0
     503             *
     504             * @param array           $reset_result The reset result.
     505             * @param string          $scope        The reset scope.
     506             * @param WP_REST_Request $request      The request object.
     507             */
     508            $reset_result = apply_filters( 'dokan_kits_reset_settings_result', $reset_result, $scope, $request );
    523509
    524510            /**
     
    527513             * @since 3.0.0
    528514             *
    529              * @param string          $scope   The reset scope.
    530              * @param WP_REST_Request $request The request object.
    531              */
    532             do_action( 'dokan_kits_after_reset_settings', $scope, $request );
     515             * @param array           $reset_result The reset result.
     516             * @param string          $scope        The reset scope.
     517             * @param WP_REST_Request $request      The request object.
     518             */
     519            do_action( 'dokan_kits_after_reset_settings', $reset_result, $scope, $request );
    533520
    534521            return $this->success(
    535                 array(
    536                     'scope'     => $scope,
    537                     'timestamp' => current_time( 'mysql' ),
    538                 ),
    539                 $message
     522                $reset_result,
     523                $reset_result['message']
    540524            );
    541525
    542         } catch ( \Exception $e ) {
    543             return new WP_Error(
    544                 'dokan_kits_reset_error',
    545                 __( 'Failed to reset settings: ', 'dokan-kits' ) . $e->getMessage(),
    546                 array( 'status' => 500 )
    547             );
     526        } catch ( Exception $e ) {
     527            return $this->handle_exception( $e, 'reset_settings' );
    548528        }
    549529    }
    550530
    551531    /**
     532     * Prepare base dashboard data.
     533     *
     534     * @since 3.0.0
     535     *
     536     * @return array Base dashboard data.
     537     */
     538    private function prepare_base_dashboard_data(): array {
     539        $settings = $this->data_store->get_all( array( 'in' => $this->data_store->get_allowed_groups() ) );
     540
     541        return array(
     542            'settings_count' => count( $settings ),
     543            'last_updated'   => current_time( 'mysql' ),
     544        );
     545    }
     546
     547    /**
    552548     * Get statistics data.
    553549     *
    554550     * @since 3.0.0
    555551     *
    556      * @param Settings[] $settings Settings data.
    557      *
    558      * @return array
    559      */
    560     protected function get_statistics_data( array $settings ): array {
     552     * @param bool $refresh Whether to refresh cached data.
     553     *
     554     * @return array Statistics data.
     555     */
     556    private function get_statistics_data( bool $refresh = false ): array {
     557        // Check cache first (if not refreshing)
     558        if ( ! $refresh ) {
     559            $cached_stats = wp_cache_get( 'dokan_kits_dashboard_stats', 'dokan-kits' );
     560            if ( false !== $cached_stats ) {
     561                return $cached_stats;
     562            }
     563        }
     564
     565        $settings        = $this->data_store->get_all( array( 'in' => $this->data_store->get_allowed_groups() ) );
    561566        $total_features  = 0;
    562567        $active_features = 0;
     
    613618         * @param Settings[] $settings   The settings data.
    614619         */
    615         return apply_filters( 'dokan_kits_dashboard_statistics', $statistics, $settings );
     620        $statistics = apply_filters( 'dokan_kits_dashboard_statistics', $statistics, $settings );
     621
     622        // Cache the statistics for 5 minutes
     623        wp_cache_set( 'dokan_kits_dashboard_stats', $statistics, 'dokan-kits', 5 * MINUTE_IN_SECONDS );
     624
     625        return $statistics;
    616626    }
    617627
     
    621631     * @since 3.0.0
    622632     *
    623      * @return array
    624      */
    625     protected function get_plugin_data(): array {
     633     * @return array Plugin data.
     634     */
     635    private function get_plugin_data(): array {
    626636        $plugin_data = array(
    627637            'version'     => defined( 'DOKAN_KITS_VERSION' ) ? DOKAN_KITS_VERSION : '1.0.0',
    628638            'name'        => 'Dokan Kits',
    629639            'description' => __( 'Enhance your Dokan-powered marketplace with powerful tools and customizations.', 'dokan-kits' ),
    630             'url'         => 'https://example.com/dokan-kits',
    631             'author'      => 'Your Company',
     640            'url'         => 'https://wpintegrity.com/products/dokan-kits/',
     641            'author'      => 'WPIntegrity',
    632642            'text_domain' => 'dokan-kits',
    633643        );
     
    644654
    645655    /**
    646      * Get dashboard endpoint arguments.
    647      *
    648      * @since 3.0.0
    649      *
    650      * @return array
    651      */
    652     protected function get_dashboard_args(): array {
     656     * Export settings data.
     657     *
     658     * @since 3.0.0
     659     *
     660     * @param array  $groups Groups to export.
     661     * @param string $format Export format.
     662     *
     663     * @return array Export result.
     664     */
     665    private function export_settings_data( array $groups, string $format ): array {
     666        $settings = $this->data_store->get_all( array( 'in' => $groups ) );
     667
     668        $export_data = array();
     669        foreach ( $settings as $setting ) {
     670            $export_data[ $setting->get_name() ] = $setting->get_value();
     671        }
     672
     673        /**
     674         * Filter the export data.
     675         *
     676         * @since 3.0.0
     677         *
     678         * @param array      $export_data The export data.
     679         * @param Settings[] $settings    The settings data.
     680         * @param array      $groups      The exported groups.
     681         */
     682        $export_data = apply_filters( 'dokan_kits_export_settings_data', $export_data, $settings, $groups );
     683
     684        // Format data based on request
     685        if ( 'json' === $format ) {
     686            $formatted_data = wp_json_encode( $export_data, JSON_PRETTY_PRINT );
     687        } else {
     688            $formatted_data = $export_data;
     689        }
     690
     691        return array(
     692            'data'      => $formatted_data,
     693            'format'    => $format,
     694            'groups'    => $groups,
     695            'count'     => count( $export_data ),
     696            'timestamp' => current_time( 'mysql' ),
     697        );
     698    }
     699
     700    /**
     701     * Import settings data.
     702     *
     703     * @since 3.0.0
     704     *
     705     * @param array $settings_data Settings data to import.
     706     * @param bool  $overwrite     Whether to overwrite existing settings.
     707     *
     708     * @return array Import result.
     709     */
     710    private function import_settings_data( array $settings_data, bool $overwrite ): array {
     711        $errors   = array();
     712        $imported = array();
     713
     714        foreach ( $settings_data as $name => $value ) {
     715            try {
     716                // Validate setting name
     717                if ( ! is_string( $name ) || empty( $name ) ) {
     718                    $errors[ $name ] = __( 'Invalid setting name.', 'dokan-kits' );
     719                    continue;
     720                }
     721
     722                // Sanitize setting name
     723                $name = $this->sanitize_key( $name );
     724
     725                $setting = $this->data_store->get_settings_by_name( $name );
     726
     727                if ( null === $setting ) {
     728                    $setting = dokan_kits_get_container()->get( Settings::class );
     729                    $setting->set_name( $name );
     730                } elseif ( ! $overwrite ) {
     731                    // Skip existing settings if not overwriting
     732                    continue;
     733                }
     734
     735                // Sanitize and validate value
     736                if ( is_array( $value ) ) {
     737                    $value = array_map( 'wc_clean', $value );
     738                } else {
     739                    $value = wc_clean( $value );
     740                }
     741
     742                $setting->set_value( $value );
     743                $setting->save();
     744
     745                $imported[] = $name;
     746
     747            } catch ( Exception $e ) {
     748                $errors[ $name ] = $e->getMessage();
     749            }
     750        }
     751
     752        return array(
     753            'imported'  => $imported,
     754            'errors'    => $errors,
     755            'total'     => count( $imported ),
     756            'overwrite' => $overwrite,
     757        );
     758    }
     759
     760    /**
     761     * Reset settings data.
     762     *
     763     * @since 3.0.0
     764     *
     765     * @param string $scope Reset scope.
     766     *
     767     * @return array Reset result.
     768     */
     769    private function reset_settings_data( string $scope ): array {
     770        if ( 'all' === $scope ) {
     771            $this->data_store->reset_by_names( $this->data_store->get_allowed_groups() );
     772            $message = __( 'All settings have been reset to defaults.', 'dokan-kits' );
     773        } else {
     774            $this->data_store->reset_by_name( $scope );
     775            /* translators: %s: settings group name */
     776            $message = sprintf( __( '%s settings have been reset to defaults.', 'dokan-kits' ), ucfirst( $scope ) );
     777        }
     778
     779        return array(
     780            'scope'     => $scope,
     781            'message'   => $message,
     782            'timestamp' => current_time( 'mysql' ),
     783        );
     784    }
     785
     786    /**
     787     * Get dashboard endpoint parameters.
     788     *
     789     * @since 3.0.0
     790     *
     791     * @return array Dashboard parameters.
     792     */
     793    private function get_dashboard_params(): array {
    653794        return array(
    654795            'include_statistics' => array(
     
    666807
    667808    /**
    668      * Get statistics endpoint arguments.
    669      *
    670      * @since 3.0.0
    671      *
    672      * @return array
    673      */
    674     protected function get_statistics_args(): array {
     809     * Get statistics endpoint parameters.
     810     *
     811     * @since 3.0.0
     812     *
     813     * @return array Statistics parameters.
     814     */
     815    private function get_statistics_params(): array {
    675816        return array(
    676817            'refresh' => array(
     
    683824
    684825    /**
    685      * Get export endpoint arguments.
    686      *
    687      * @since 3.0.0
    688      *
    689      * @return array
    690      */
    691     protected function get_export_args(): array {
    692         $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
     826     * Get export endpoint parameters.
     827     *
     828     * @since 3.0.0
     829     *
     830     * @return array Export parameters.
     831     */
     832    private function get_export_params(): array {
     833        $allowed_groups = $this->data_store->get_allowed_groups();
    693834
    694835        return array(
     
    704845                'items'       => array(
    705846                    'type' => 'string',
    706                     'enum' => $data_store->get_allowed_groups(),
     847                    'enum' => $allowed_groups,
    707848                ),
    708                 'default'     => $data_store->get_allowed_groups(),
    709             ),
    710         );
    711     }
    712 
    713     /**
    714      * Get import endpoint arguments.
    715      *
    716      * @since 3.0.0
    717      *
    718      * @return array
    719      */
    720     protected function get_import_args(): array {
     849                'default'     => $allowed_groups,
     850            ),
     851        );
     852    }
     853
     854    /**
     855     * Get import endpoint parameters.
     856     *
     857     * @since 3.0.0
     858     *
     859     * @return array Import parameters.
     860     */
     861    private function get_import_params(): array {
    721862        return array(
    722863            'settings'  => array(
    723                 'description' => __( 'Settings data to import.', 'dokan-kits' ),
     864                'description' => __( 'Settings data to import as key-value pairs.', 'dokan-kits' ),
    724865                'type'        => 'object',
    725866                'required'    => true,
     867                'properties'  => array(
     868                    'additionalProperties' => array(
     869                        'type' => array( 'string', 'number', 'boolean', 'array', 'object' ),
     870                    ),
     871                ),
    726872            ),
    727873            'overwrite' => array(
     
    734880
    735881    /**
    736      * Get reset endpoint arguments.
    737      *
    738      * @since 3.0.0
    739      *
    740      * @return array
    741      */
    742     protected function get_reset_args(): array {
     882     * Get reset endpoint parameters.
     883     *
     884     * @since 3.0.0
     885     *
     886     * @return array Reset parameters.
     887     */
     888    private function get_reset_params(): array {
    743889        return array(
    744890            'scope'   => array(
     
    757903
    758904    /**
    759      * Get item schema.
    760      *
    761      * @since 3.0.0
    762      *
    763      * @return array
    764      */
    765     public function get_item_schema() {
    766         if ( $this->schema ) {
    767             return $this->add_additional_fields_schema( $this->schema );
    768         }
    769 
    770         $schema = array(
     905     * Get dashboard schema.
     906     *
     907     * @since 3.0.0
     908     *
     909     * @return array Dashboard schema.
     910     */
     911    public function get_dashboard_schema(): array {
     912        return array(
    771913            '$schema'    => 'http://json-schema.org/draft-04/schema#',
    772914            'title'      => 'dokan_kits_dashboard',
    773915            'type'       => 'object',
    774             'properties' => array(
    775                 'success' => array(
    776                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
    777                     'type'        => 'boolean',
    778                     'context'     => array( 'view', 'edit' ),
    779                     'readonly'    => true,
    780                 ),
    781                 'message' => array(
    782                     'description' => __( 'Message describing the result of the operation.', 'dokan-kits' ),
    783                     'type'        => 'string',
    784                     'context'     => array( 'view', 'edit' ),
    785                     'readonly'    => true,
    786                 ),
    787                 'data'    => array(
    788                     'description' => __( 'Dashboard data.', 'dokan-kits' ),
    789                     'type'        => 'object',
    790                     'context'     => array( 'view', 'edit' ),
    791                     'readonly'    => true,
    792                     'properties'  => array(
    793                         'settings_count' => array(
    794                             'description' => __( 'Number of configured settings.', 'dokan-kits' ),
    795                             'type'        => 'integer',
    796                         ),
    797                         'last_updated'   => array(
    798                             'description' => __( 'Last updated timestamp.', 'dokan-kits' ),
    799                             'type'        => 'string',
    800                             'format'      => 'date-time',
    801                         ),
    802                         'statistics'     => array(
    803                             'description' => __( 'Dashboard statistics.', 'dokan-kits' ),
    804                             'type'        => 'object',
    805                         ),
    806                         'plugin'         => array(
    807                             'description' => __( 'Plugin information.', 'dokan-kits' ),
    808                             'type'        => 'object',
    809                         ),
    810                         'features'       => array(
    811                             'description' => __( 'Features information.', 'dokan-kits' ),
    812                             'type'        => 'object',
     916            'properties' => array_merge(
     917                $this->get_standard_response_schema(),
     918                array(
     919                    'data' => array(
     920                        'description' => __( 'Dashboard data.', 'dokan-kits' ),
     921                        'type'        => 'object',
     922                        'properties'  => array(
     923                            'settings_count' => array(
     924                                'description' => __( 'Number of configured settings.', 'dokan-kits' ),
     925                                'type'        => 'integer',
     926                                'minimum'     => 0,
     927                            ),
     928                            'last_updated'   => array(
     929                                'description' => __( 'Last updated timestamp.', 'dokan-kits' ),
     930                                'type'        => 'string',
     931                                'format'      => 'date-time',
     932                            ),
     933                            'statistics'     => array(
     934                                'description' => __( 'Dashboard statistics.', 'dokan-kits' ),
     935                                'type'        => 'object',
     936                            ),
     937                            'plugin'         => array(
     938                                'description' => __( 'Plugin information.', 'dokan-kits' ),
     939                                'type'        => 'object',
     940                            ),
    813941                        ),
    814942                    ),
    815                 ),
    816             ),
    817         );
    818 
    819         $this->schema = $schema;
    820 
    821         return $this->add_additional_fields_schema( $this->schema );
     943                )
     944            ),
     945        );
    822946    }
    823947
     
    827951     * @since 3.0.0
    828952     *
    829      * @return array
     953     * @return array Statistics schema.
    830954     */
    831955    public function get_statistics_schema(): array {
     
    834958            'title'      => 'dokan_kits_statistics',
    835959            'type'       => 'object',
    836             'properties' => array(
    837                 'success' => array(
    838                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
    839                     'type'        => 'boolean',
    840                 ),
    841                 'message' => array(
    842                     'description' => __( 'Message describing the result.', 'dokan-kits' ),
    843                     'type'        => 'string',
    844                 ),
    845                 'data'    => array(
    846                     'description' => __( 'Statistics data.', 'dokan-kits' ),
    847                     'type'        => 'object',
    848                 ),
     960            'properties' => array_merge(
     961                $this->get_standard_response_schema(),
     962                array(
     963                    'data' => array(
     964                        'description'          => __( 'Statistics data with metrics and their metadata.', 'dokan-kits' ),
     965                        'type'                 => 'object',
     966                        'additionalProperties' => array(
     967                            'type'       => 'object',
     968                            'properties' => array(
     969                                'value'       => array(
     970                                    'description' => __( 'Statistic value.', 'dokan-kits' ),
     971                                    'type'        => array( 'string', 'number' ),
     972                                ),
     973                                'label'       => array(
     974                                    'description' => __( 'Human-readable label.', 'dokan-kits' ),
     975                                    'type'        => 'string',
     976                                ),
     977                                'description' => array(
     978                                    'description' => __( 'Detailed description.', 'dokan-kits' ),
     979                                    'type'        => 'string',
     980                                ),
     981                                'icon'        => array(
     982                                    'description' => __( 'Icon class or identifier.', 'dokan-kits' ),
     983                                    'type'        => 'string',
     984                                ),
     985                                'color'       => array(
     986                                    'description' => __( 'Color theme or class.', 'dokan-kits' ),
     987                                    'type'        => 'string',
     988                                ),
     989                            ),
     990                        ),
     991                    ),
     992                )
    849993            ),
    850994        );
     
    8561000     * @since 3.0.0
    8571001     *
    858      * @return array
     1002     * @return array Export schema.
    8591003     */
    8601004    public function get_export_schema(): array {
     
    8631007            'title'      => 'dokan_kits_export',
    8641008            'type'       => 'object',
    865             'properties' => array(
    866                 'success' => array(
    867                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
    868                     'type'        => 'boolean',
    869                 ),
    870                 'message' => array(
    871                     'description' => __( 'Message describing the result.', 'dokan-kits' ),
    872                     'type'        => 'string',
    873                 ),
    874                 'data'    => array(
    875                     'description' => __( 'Export data.', 'dokan-kits' ),
    876                     'type'        => 'object',
    877                     'properties'  => array(
    878                         'data'      => array(
    879                             'description' => __( 'Exported settings data.', 'dokan-kits' ),
    880                             'type'        => array( 'object', 'string' ),
    881                         ),
    882                         'format'    => array(
    883                             'description' => __( 'Export format used.', 'dokan-kits' ),
    884                             'type'        => 'string',
    885                         ),
    886                         'groups'    => array(
    887                             'description' => __( 'Settings groups exported.', 'dokan-kits' ),
    888                             'type'        => 'array',
    889                             'items'       => array( 'type' => 'string' ),
    890                         ),
    891                         'count'     => array(
    892                             'description' => __( 'Number of exported settings.', 'dokan-kits' ),
    893                             'type'        => 'integer',
    894                         ),
    895                         'timestamp' => array(
    896                             'description' => __( 'Export timestamp.', 'dokan-kits' ),
    897                             'type'        => 'string',
    898                             'format'      => 'date-time',
     1009            'properties' => array_merge(
     1010                $this->get_standard_response_schema(),
     1011                array(
     1012                    'data' => array(
     1013                        'description' => __( 'Export data.', 'dokan-kits' ),
     1014                        'type'        => 'object',
     1015                        'properties'  => array(
     1016                            'data'      => array(
     1017                                'description' => __( 'Exported settings data.', 'dokan-kits' ),
     1018                                'type'        => array( 'object', 'string' ),
     1019                            ),
     1020                            'format'    => array(
     1021                                'description' => __( 'Export format used.', 'dokan-kits' ),
     1022                                'type'        => 'string',
     1023                                'enum'        => array( 'json', 'array' ),
     1024                            ),
     1025                            'groups'    => array(
     1026                                'description' => __( 'Settings groups exported.', 'dokan-kits' ),
     1027                                'type'        => 'array',
     1028                                'items'       => array( 'type' => 'string' ),
     1029                            ),
     1030                            'count'     => array(
     1031                                'description' => __( 'Number of exported settings.', 'dokan-kits' ),
     1032                                'type'        => 'integer',
     1033                                'minimum'     => 0,
     1034                            ),
     1035                            'timestamp' => array(
     1036                                'description' => __( 'Export timestamp.', 'dokan-kits' ),
     1037                                'type'        => 'string',
     1038                                'format'      => 'date-time',
     1039                            ),
    8991040                        ),
    9001041                    ),
    901                 ),
     1042                )
    9021043            ),
    9031044        );
     
    9091050     * @since 3.0.0
    9101051     *
    911      * @return array
     1052     * @return array Import schema.
    9121053     */
    9131054    public function get_import_schema(): array {
     
    9161057            'title'      => 'dokan_kits_import',
    9171058            'type'       => 'object',
    918             'properties' => array(
    919                 'success' => array(
    920                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
    921                     'type'        => 'boolean',
    922                 ),
    923                 'message' => array(
    924                     'description' => __( 'Message describing the result.', 'dokan-kits' ),
    925                     'type'        => 'string',
    926                 ),
    927                 'data'    => array(
    928                     'description' => __( 'Import data.', 'dokan-kits' ),
    929                     'type'        => 'object',
    930                     'properties'  => array(
    931                         'imported'  => array(
    932                             'description' => __( 'List of imported settings.', 'dokan-kits' ),
    933                             'type'        => 'array',
    934                             'items'       => array( 'type' => 'string' ),
    935                         ),
    936                         'total'     => array(
    937                             'description' => __( 'Total number of imported settings.', 'dokan-kits' ),
    938                             'type'        => 'integer',
    939                         ),
    940                         'overwrite' => array(
    941                             'description' => __( 'Whether existing settings were overwritten.', 'dokan-kits' ),
    942                             'type'        => 'boolean',
     1059            'properties' => array_merge(
     1060                $this->get_standard_response_schema(),
     1061                array(
     1062                    'data' => array(
     1063                        'description' => __( 'Import result data.', 'dokan-kits' ),
     1064                        'type'        => 'object',
     1065                        'properties'  => array(
     1066                            'imported'  => array(
     1067                                'description' => __( 'List of successfully imported settings.', 'dokan-kits' ),
     1068                                'type'        => 'array',
     1069                                'items'       => array( 'type' => 'string' ),
     1070                            ),
     1071                            'errors'    => array(
     1072                                'description'          => __( 'Import errors by setting name.', 'dokan-kits' ),
     1073                                'type'                 => 'object',
     1074                                'additionalProperties' => array( 'type' => 'string' ),
     1075                            ),
     1076                            'total'     => array(
     1077                                'description' => __( 'Total number of successfully imported settings.', 'dokan-kits' ),
     1078                                'type'        => 'integer',
     1079                                'minimum'     => 0,
     1080                            ),
     1081                            'overwrite' => array(
     1082                                'description' => __( 'Whether existing settings were overwritten.', 'dokan-kits' ),
     1083                                'type'        => 'boolean',
     1084                            ),
    9431085                        ),
    9441086                    ),
    945                 ),
     1087                )
    9461088            ),
    9471089        );
     
    9531095     * @since 3.0.0
    9541096     *
    955      * @return array
     1097     * @return array Reset schema.
    9561098     */
    9571099    public function get_reset_schema(): array {
     
    9601102            'title'      => 'dokan_kits_reset',
    9611103            'type'       => 'object',
    962             'properties' => array(
    963                 'success' => array(
    964                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
    965                     'type'        => 'boolean',
    966                 ),
    967                 'message' => array(
    968                     'description' => __( 'Message describing the result.', 'dokan-kits' ),
    969                     'type'        => 'string',
    970                 ),
    971                 'data'    => array(
    972                     'description' => __( 'Reset data.', 'dokan-kits' ),
    973                     'type'        => 'object',
    974                     'properties'  => array(
    975                         'scope'     => array(
    976                             'description' => __( 'Scope of settings that were reset.', 'dokan-kits' ),
    977                             'type'        => 'string',
    978                         ),
    979                         'timestamp' => array(
    980                             'description' => __( 'Reset timestamp.', 'dokan-kits' ),
    981                             'type'        => 'string',
    982                             'format'      => 'date-time',
     1104            'properties' => array_merge(
     1105                $this->get_standard_response_schema(),
     1106                array(
     1107                    'data' => array(
     1108                        'description' => __( 'Reset operation result.', 'dokan-kits' ),
     1109                        'type'        => 'object',
     1110                        'properties'  => array(
     1111                            'scope'     => array(
     1112                                'description' => __( 'Scope of settings that were reset.', 'dokan-kits' ),
     1113                                'type'        => 'string',
     1114                                'enum'        => array( 'all', 'product', 'vendor', 'cart', 'shipping' ),
     1115                            ),
     1116                            'message'   => array(
     1117                                'description' => __( 'Detailed reset result message.', 'dokan-kits' ),
     1118                                'type'        => 'string',
     1119                            ),
     1120                            'timestamp' => array(
     1121                                'description' => __( 'Reset operation timestamp.', 'dokan-kits' ),
     1122                                'type'        => 'string',
     1123                                'format'      => 'date-time',
     1124                            ),
    9831125                        ),
    9841126                    ),
    985                 ),
     1127                )
    9861128            ),
    9871129        );
  • dokan-kits/trunk/includes/REST/Controllers/Version1/SettingsController.php

    r3320185 r3321393  
    33 * Settings API Controller
    44 *
     5 * @since   3.0.0
    56 * @package DokanKits\REST\Controllers\Version1
    6  * @since 3.0.0
    77 */
    88
     
    2121 * Settings API Controller class.
    2222 *
    23  * Handles API endpoints for managing plugin settings.
     23 * Handles API endpoints for managing plugin settings with consistent response patterns.
    2424 *
    2525 * @since 3.0.0
     
    3434
    3535    /**
     36     * Settings data store instance.
     37     *
     38     * @var SettingsDataStore
     39     */
     40    private $data_store;
     41
     42    /**
     43     * Constructor.
     44     *
     45     * @since 3.0.0
     46     */
     47    public function __construct() {
     48        $this->data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
     49    }
     50
     51    /**
    3652     * Register routes.
    3753     *
     
    4157     */
    4258    public function register_routes() {
     59        // Collection endpoint: GET /settings, POST /settings
    4360        register_rest_route(
    4461            $this->namespace,
     
    5572                    'callback'            => array( $this, 'update_settings' ),
    5673                    'permission_callback' => array( $this, 'admin_permissions_check' ),
    57                     'args'                => $this->get_update_params(),
     74                    'args'                => $this->get_bulk_update_params(),
    5875                ),
    5976                'schema' => array( $this, 'get_item_schema' ),
    6077            )
    6178        );
     79
     80        // Single setting endpoint: GET /settings/{setting_name}, PUT /settings/{setting_name}
     81        register_rest_route(
     82            $this->namespace,
     83            '/' . $this->rest_base . '/(?P<setting_name>[a-zA-Z0-9._-]+)',
     84            array(
     85                array(
     86                    'methods'             => WP_REST_Server::READABLE,
     87                    'callback'            => array( $this, 'get_setting' ),
     88                    'permission_callback' => array( $this, 'admin_permissions_check' ),
     89                    'args'                => $this->get_single_setting_params(),
     90                ),
     91                array(
     92                    'methods'             => WP_REST_Server::EDITABLE,
     93                    'callback'            => array( $this, 'update_setting' ),
     94                    'permission_callback' => array( $this, 'admin_permissions_check' ),
     95                    'args'                => $this->get_single_update_params(),
     96                ),
     97                'schema' => array( $this, 'get_single_setting_schema' ),
     98            )
     99        );
    62100    }
    63101
     
    69107     * @param WP_REST_Request $request Full details about the request.
    70108     *
    71      * @return WP_REST_Response|WP_Error
     109     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    72110     */
    73111    public function get_settings( WP_REST_Request $request ) {
     
    82120            do_action( 'dokan_kits_before_get_settings', $request );
    83121
    84             $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
    85 
    86             $args = array(
    87                 'orderby' => $request->get_param( 'orderby' ) ?? 'name',
    88                 'order'   => $request->get_param( 'order' ) ?? 'ASC',
    89                 'limit'   => $request->get_param( 'per_page' ) ?? -1,
    90                 'offset'  => $request->get_param( 'offset' ) ?? 0,
    91                 'in'      => $data_store->get_allowed_groups(),
     122            // Get query parameters
     123            $query_args = $this->prepare_query_args( $request );
     124
     125            // Fetch settings from data store
     126            $settings = $this->data_store->get_all( $query_args );
     127
     128            // Prepare response data
     129            $response_data = $this->prepare_settings_for_response( $settings, $request );
     130
     131            /**
     132             * Filter the settings collection response data.
     133             *
     134             * @since 3.0.0
     135             *
     136             * @param array           $response_data The response data.
     137             * @param Settings[]      $settings      The settings objects.
     138             * @param WP_REST_Request $request       The request object.
     139             */
     140            $response_data = apply_filters( 'dokan_kits_rest_settings_collection_data', $response_data, $settings, $request );
     141
     142            /**
     143             * Action fired after getting settings.
     144             *
     145             * @since 3.0.0
     146             *
     147             * @param array           $response_data The response data.
     148             * @param WP_REST_Request $request       The request object.
     149             */
     150            do_action( 'dokan_kits_after_get_settings', $response_data, $request );
     151
     152            return $this->success(
     153                $response_data,
     154                sprintf(
     155                /* translators: %d: Number of settings retrieved */
     156                    _n(
     157                        '%d setting retrieved successfully.',
     158                        '%d settings retrieved successfully.',
     159                        count( $settings ),
     160                        'dokan-kits'
     161                    ),
     162                    count( $settings )
     163                )
    92164            );
    93165
    94             // Filter by group if provided
    95             $group = $request->get_param( 'group' );
    96             if ( ! empty( $group ) ) {
    97                 if ( is_string( $group ) ) {
    98                     $args['in'] = array( $group );
    99                 } elseif ( is_array( $group ) ) {
    100                     $args['in'] = array_intersect( $group, $data_store->get_allowed_groups() );
    101                 }
    102             }
    103 
    104             // Filter by search if provided
    105             $search = $request->get_param( 'search' );
    106             if ( ! empty( $search ) ) {
    107                 $args['search'] = sanitize_text_field( $search );
    108             }
    109             $settings = $data_store->get_all( $args );
    110 
    111             $data = array();
    112             foreach ( $settings as $setting ) {
    113                 $item                  = $this->prepare_setting_for_response( $setting, $request );
    114                 $data[ $item['name'] ] = $item['value'];
    115             }
    116 
    117             /**
    118              * Filter the settings data.
    119              *
    120              * @since 3.0.0
    121              *
    122              * @param array           $data     The settings data.
    123              * @param Settings[]      $settings The settings objects.
    124              * @param WP_REST_Request $request  The request object.
    125              */
    126             $data = apply_filters( 'dokan_kits_rest_settings_data', $data, $settings, $request );
    127 
    128             /**
    129              * Action fired after getting settings.
    130              *
    131              * @since 3.0.0
    132              *
    133              * @param array           $data    The settings data.
    134              * @param WP_REST_Request $request The request object.
    135              */
    136             do_action( 'dokan_kits_after_get_settings', $data, $request );
    137 
    138             return $this->success(
    139                 array(
    140                     'settings' => $data,
    141                     'count'    => count( $data ),
    142                 ),
    143                 __( 'Settings retrieved successfully.', 'dokan-kits' )
    144             );
    145 
    146166        } catch ( \Exception $e ) {
    147             return new WP_Error(
    148                 'dokan_kits_settings_error',
    149                 __( 'Failed to retrieve settings: ', 'dokan-kits' ) . $e->getMessage(),
    150                 array( 'status' => 500 )
    151             );
     167            return $this->handle_exception( $e, 'get_settings' );
    152168        }
    153169    }
     
    160176     * @param WP_REST_Request $request Full details about the request.
    161177     *
    162      * @return WP_REST_Response|WP_Error
     178     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    163179     */
    164180    public function get_setting( WP_REST_Request $request ) {
    165181        try {
    166             $name = sanitize_key( $request->get_param( 'name' ) );
    167 
    168             if ( empty( $name ) ) {
     182            $setting_name = $this->sanitize_setting_name( $request->get_param( 'setting_name' ) );
     183
     184            if ( empty( $setting_name ) ) {
    169185                return $this->error(
    170                     __( 'Setting name is required.', 'dokan-kits' ),
    171                     'dokan_kits_setting_name_required',
     186                    __( 'Setting name is required and must be valid.', 'dokan-kits' ),
     187                    'invalid_setting_name',
    172188                    400
    173189                );
    174190            }
    175191
    176             $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
    177             $setting    = $data_store->get_settings_by_name( $name );
     192            /**
     193             * Action fired before getting a single setting.
     194             *
     195             * @since 3.0.0
     196             *
     197             * @param string          $setting_name The setting name.
     198             * @param WP_REST_Request $request      The request object.
     199             */
     200            do_action( 'dokan_kits_before_get_single_setting', $setting_name, $request );
     201
     202            // Validate setting name format and access
     203            $validation_result = $this->validate_setting_access( $setting_name );
     204            if ( is_wp_error( $validation_result ) ) {
     205                return $validation_result;
     206            }
     207
     208            // Get setting from data store
     209            $setting = $this->data_store->get_settings_by_name( $setting_name );
    178210
    179211            if ( null === $setting ) {
     
    182214                    /* translators: %s: setting name */
    183215                        __( 'Setting "%s" not found.', 'dokan-kits' ),
    184                         $name
     216                        $setting_name
    185217                    ),
    186                     'dokan_kits_setting_not_found',
     218                    'setting_not_found',
    187219                    404
    188220                );
    189221            }
    190222
    191             $data = $this->prepare_setting_for_response( $setting, $request );
    192 
    193             return $this->success( $data, __( 'Setting retrieved successfully.', 'dokan-kits' ) );
     223            // Prepare response data
     224            $response_data = $this->prepare_single_setting_for_response( $setting, $request );
     225
     226            /**
     227             * Filter the single setting response data.
     228             *
     229             * @since 3.0.0
     230             *
     231             * @param array           $response_data The response data.
     232             * @param Settings        $setting       The setting object.
     233             * @param WP_REST_Request $request       The request object.
     234             */
     235            $response_data = apply_filters( 'dokan_kits_rest_single_setting_data', $response_data, $setting, $request );
     236
     237            /**
     238             * Action fired after getting a single setting.
     239             *
     240             * @since 3.0.0
     241             *
     242             * @param array           $response_data The response data.
     243             * @param string          $setting_name  The setting name.
     244             * @param WP_REST_Request $request       The request object.
     245             */
     246            do_action( 'dokan_kits_after_get_single_setting', $response_data, $setting_name, $request );
     247
     248            return $this->success(
     249                $response_data,
     250                sprintf(
     251                /* translators: %s: setting name */
     252                    __( 'Setting "%s" retrieved successfully.', 'dokan-kits' ),
     253                    $setting_name
     254                )
     255            );
    194256
    195257        } catch ( \Exception $e ) {
    196             return new WP_Error(
    197                 'dokan_kits_setting_error',
    198                 __( 'Failed to retrieve setting: ', 'dokan-kits' ) . $e->getMessage(),
    199                 array( 'status' => 500 )
    200             );
     258            return $this->handle_exception( $e, 'get_setting' );
    201259        }
    202260    }
     
    209267     * @param WP_REST_Request $request Full details about the request.
    210268     *
    211      * @return WP_REST_Response|WP_Error
     269     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    212270     */
    213271    public function update_settings( WP_REST_Request $request ) {
     
    222280            do_action( 'dokan_kits_before_update_settings', $request );
    223281
    224             $params = $request->get_params();
    225 
    226             // Handle JSON body if available
    227             if ( empty( $params ) && $request->get_body() ) {
    228                 try {
    229                     $params = json_decode( $request->get_body(), true, 512, JSON_THROW_ON_ERROR );
    230                 } catch ( JsonException $e ) {
    231                     return $this->error(
    232                         __( 'Invalid JSON data provided.', 'dokan-kits' ),
    233                         'dokan_kits_invalid_json',
    234                         400
    235                     );
    236                 }
    237             }
    238 
    239             $settings_data = $params['settings'] ?? array();
     282            // Get and validate settings data
     283            $settings_data = $this->get_request_settings_data( $request );
    240284
    241285            if ( empty( $settings_data ) ) {
    242286                return $this->error(
    243287                    __( 'No settings data provided.', 'dokan-kits' ),
    244                     'dokan_kits_no_settings_data',
     288                    'no_settings_data',
    245289                    400
    246290                );
    247291            }
    248292
    249             // Validate settings count to prevent abuse
    250             if ( count( $settings_data ) > 100 ) {
    251                 return $this->error(
    252                     __( 'Too many settings provided. Maximum 100 settings per request.', 'dokan-kits' ),
    253                     'dokan_kits_too_many_settings',
    254                     400
    255                 );
    256             }
    257 
     293            // Process each setting
    258294            $results = array();
    259295            $errors  = array();
    260296
    261             foreach ( $settings_data as $name => $value ) {
    262                 try {
    263                     $result = $this->update_single_setting( $name, $value );
    264 
    265                     if ( is_wp_error( $result ) ) {
    266                         $errors[ $name ] = $result->get_error_message();
    267                     } else {
    268                         $results[ $name ] = $value;
    269                     }
    270                 } catch ( \Exception $e ) {
    271                     $errors[ $name ] = $e->getMessage();
     297            foreach ( $settings_data as $setting_name => $setting_value ) {
     298                $update_result = $this->update_single_setting_internal( $setting_name, $setting_value );
     299
     300                if ( is_wp_error( $update_result ) ) {
     301                    $errors[ $setting_name ] = $update_result->get_error_message();
     302                } else {
     303                    $results[ $setting_name ] = $setting_value;
    272304                }
    273305            }
     306
     307            // Prepare response
     308            $response_data = array(
     309                'updated' => $results,
     310                'errors'  => $errors,
     311                'total'   => count( $results ),
     312            );
     313
     314            /**
     315             * Filter the bulk update response data.
     316             *
     317             * @since 3.0.0
     318             *
     319             * @param array           $response_data The response data.
     320             * @param array           $results       Successfully updated settings.
     321             * @param array           $errors        Update errors.
     322             * @param WP_REST_Request $request       The request object.
     323             */
     324            $response_data = apply_filters( 'dokan_kits_rest_bulk_update_data', $response_data, $results, $errors, $request );
    274325
    275326            /**
     
    284335            do_action( 'dokan_kits_after_update_settings', $results, $errors, $request );
    285336
     337            // Return response based on results
     338            if ( ! empty( $errors ) && empty( $results ) ) {
     339                // All updates failed
     340                return $this->error(
     341                    __( 'All settings failed to update.', 'dokan-kits' ),
     342                    'all_updates_failed',
     343                    400,
     344                    $response_data
     345                );
     346            }
     347
    286348            if ( ! empty( $errors ) ) {
     349                // Partial success
    287350                return $this->error(
    288351                    __( 'Some settings failed to update.', 'dokan-kits' ),
    289                     'dokan_kits_settings_update_error',
    290                     400,
    291                     array(
    292                         'errors'  => $errors,
    293                         'updated' => $results,
    294                     )
     352                    'partial_update_failure',
     353                    207, // Multi-Status
     354                    $response_data
    295355                );
    296356            }
    297357
     358            // All updates successful
    298359            return $this->success(
    299                 array(
    300                     'updated' => $results,
    301                     'count'   => count( $results ),
    302                 ),
     360                $response_data,
    303361                sprintf(
    304362                /* translators: %d: Number of settings updated */
     
    314372
    315373        } catch ( \Exception $e ) {
    316             return new WP_Error(
    317                 'dokan_kits_settings_update_error',
    318                 __( 'Failed to update settings: ', 'dokan-kits' ) . $e->getMessage(),
    319                 array( 'status' => 500 )
     374            return $this->handle_exception( $e, 'update_settings' );
     375        }
     376    }
     377
     378    /**
     379     * Update a single setting.
     380     *
     381     * @since 3.0.0
     382     *
     383     * @param WP_REST_Request $request Full details about the request.
     384     *
     385     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
     386     */
     387    public function update_setting( WP_REST_Request $request ) {
     388        try {
     389            $setting_name  = $this->sanitize_setting_name( $request->get_param( 'setting_name' ) );
     390            $setting_value = $request->get_param( 'value' );
     391
     392            if ( empty( $setting_name ) ) {
     393                return $this->error(
     394                    __( 'Setting name is required and must be valid.', 'dokan-kits' ),
     395                    'invalid_setting_name',
     396                    400
     397                );
     398            }
     399
     400            /**
     401             * Action fired before updating a single setting.
     402             *
     403             * @since 3.0.0
     404             *
     405             * @param string          $setting_name  The setting name.
     406             * @param mixed           $setting_value The setting value.
     407             * @param WP_REST_Request $request       The request object.
     408             */
     409            do_action( 'dokan_kits_before_update_single_setting', $setting_name, $setting_value, $request );
     410
     411            // Update the setting
     412            $update_result = $this->update_single_setting_internal( $setting_name, $setting_value );
     413
     414            if ( is_wp_error( $update_result ) ) {
     415                return $update_result;
     416            }
     417
     418            // Get the updated setting for response
     419            $updated_setting = $this->data_store->get_settings_by_name( $setting_name );
     420            if ( ! $updated_setting instanceof Settings ) {
     421                return $this->error(
     422                    __( 'Failed to retrieve updated setting.', 'dokan-kits' ),
     423                );
     424            }
     425
     426            $response_data = $this->prepare_single_setting_for_response( $updated_setting, $request );
     427
     428            /**
     429             * Filter the single setting update response data.
     430             *
     431             * @since 3.0.0
     432             *
     433             * @param array           $response_data The response data.
     434             * @param Settings        $setting       The updated setting object.
     435             * @param WP_REST_Request $request       The request object.
     436             */
     437            $response_data = apply_filters( 'dokan_kits_rest_single_setting_update_data', $response_data, $updated_setting, $request );
     438
     439            /**
     440             * Action fired after updating a single setting.
     441             *
     442             * @since 3.0.0
     443             *
     444             * @param array           $response_data The response data.
     445             * @param string          $setting_name  The setting name.
     446             * @param mixed           $setting_value The setting value.
     447             * @param WP_REST_Request $request       The request object.
     448             */
     449            do_action( 'dokan_kits_after_update_single_setting', $response_data, $setting_name, $setting_value, $request );
     450
     451            return $this->success(
     452                $response_data,
     453                sprintf(
     454                /* translators: %s: setting name */
     455                    __( 'Setting "%s" updated successfully.', 'dokan-kits' ),
     456                    $setting_name
     457                )
    320458            );
    321         }
    322     }
    323 
    324     /**
    325      * Update a single setting internally.
    326      *
    327      * @since 3.0.0
    328      *
    329      * @param string $name  Setting name.
    330      * @param mixed  $value Setting value.
    331      *
    332      * @return bool|WP_Error True on success, WP_Error on failure.
    333      */
    334     private function update_single_setting( string $name, $value ) {
    335         // Validate setting name format
    336         if ( empty( $name ) ) {
    337             return new WP_Error(
    338                 'dokan_kits_invalid_setting_name',
    339                 __( 'Invalid setting name.', 'dokan-kits' ),
    340                 array( 'status' => 400 )
    341             );
    342         }
    343 
    344         // Parse setting name (group.section.option)
    345         $parts = explode( '.', $name, 3 );
    346         if ( count( $parts ) < 3 ) {
    347             return new WP_Error(
    348                 'dokan_kits_invalid_setting_format',
    349                 __( 'Invalid setting name format. Expected: group.section.option', 'dokan-kits' ),
    350                 array( 'status' => 400 )
    351             );
    352         }
    353 
    354         [ $group_name, $section_name, $option_name ] = $parts;
    355 
    356         // Sanitize setting components
    357         $group_name   = sanitize_key( $group_name );
    358         $section_name = sanitize_key( $section_name );
    359         $option_name  = sanitize_key( $option_name );
    360 
    361         $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
    362 
    363         if ( ! in_array( $group_name, $data_store->get_allowed_groups(), true ) ) {
    364             return new WP_Error(
    365                 'dokan_kits_invalid_group',
    366                 sprintf(
    367                 /* translators: %1$s: group name, %2$s: allowed groups */
    368                     __( 'Invalid group "%1$s". Allowed groups: %2$s', 'dokan-kits' ),
    369                     $group_name,
    370                     implode( ', ', $data_store->get_allowed_groups() )
    371                 ),
    372                 array( 'status' => 400 )
    373             );
    374         }
    375 
    376         // Sanitize value
    377         $sanitized_value = $this->sanitize_setting_value( $value );
    378 
    379         // Update the setting
    380         $updated = dokan_kits_update_setting( $group_name, $section_name, $option_name, $sanitized_value );
    381 
    382         if ( ! $updated ) {
    383             return new WP_Error(
    384                 'dokan_kits_setting_update_failed',
    385                 __( 'Failed to update setting.', 'dokan-kits' ),
    386                 array( 'status' => 500 )
    387             );
     459
     460        } catch ( \Exception $e ) {
     461            return $this->handle_exception( $e, 'update_setting' );
     462        }
     463    }
     464
     465    /**
     466     * Prepare query arguments for settings retrieval.
     467     *
     468     * @since 3.0.0
     469     *
     470     * @param WP_REST_Request $request The request object.
     471     *
     472     * @return array Query arguments.
     473     */
     474    private function prepare_query_args( WP_REST_Request $request ): array {
     475        $args = array(
     476            'orderby' => sanitize_text_field( $request->get_param( 'orderby' ) ),
     477            'order'   => strtoupper( sanitize_text_field( $request->get_param( 'order' ) ) ),
     478            'limit'   => (int) $request->get_param( 'per_page' ),
     479            'offset'  => absint( $request->get_param( 'offset' ) ),
     480            'in'      => $this->data_store->get_allowed_groups(),
     481        );
     482
     483        // Ensure valid order
     484        if ( ! in_array( $args['order'], array( 'ASC', 'DESC' ), true ) ) {
     485            $args['order'] = 'ASC';
     486        }
     487
     488        // Filter by group if provided
     489        $group = $request->get_param( 'group' );
     490        if ( ! empty( $group ) ) {
     491            if ( is_string( $group ) ) {
     492                $args['in'] = array( $group );
     493            } elseif ( is_array( $group ) ) {
     494                $args['in'] = array_intersect( $group, $this->data_store->get_allowed_groups() );
     495            }
     496        }
     497
     498        // Filter by search if provided
     499        $search = $request->get_param( 'search' );
     500        if ( ! empty( $search ) ) {
     501            $args['search'] = sanitize_text_field( $search );
    388502        }
    389503
    390504        /**
    391          * Action fired after a single setting is updated.
     505         * Filter the query arguments for settings retrieval.
    392506         *
    393507         * @since 3.0.0
    394508         *
    395          * @param string $name  Setting name.
    396          * @param mixed  $value Setting value.
     509         * @param array           $args    Query arguments.
     510         * @param WP_REST_Request $request The request object.
    397511         */
    398         do_action( 'dokan_kits_after_update_single_setting', $name, $sanitized_value );
    399 
    400         return true;
    401     }
    402 
    403     /**
    404      * Sanitize setting value.
    405      *
    406      * @since 3.0.0
    407      *
    408      * @param mixed $value Setting value.
    409      *
    410      * @return mixed Sanitized value.
    411      */
    412     private function sanitize_setting_value( $value ) {
    413         if ( is_array( $value ) ) {
    414             return array_map( array( $this, 'sanitize_setting_value' ), $value );
    415         }
    416 
    417         if ( is_string( $value ) ) {
    418             return wc_clean( $value );
    419         }
    420 
    421         if ( is_bool( $value ) || is_numeric( $value ) ) {
    422             return $value;
    423         }
    424 
    425         // For other types, convert to string and clean
    426         return wc_clean( (string) $value );
    427     }
    428 
    429     /**
    430      * Prepare a setting object for API response.
    431      *
    432      * @since 3.0.0
    433      *
    434      * @param Settings        $setting Setting object.
    435      * @param WP_REST_Request $request Request object.
    436      *
    437      * @return array
    438      */
    439     private function prepare_setting_for_response( Settings $setting, WP_REST_Request $request ): array {
     512        return apply_filters( 'dokan_kits_rest_settings_query_args', $args, $request );
     513    }
     514
     515    /**
     516     * Prepare settings for response.
     517     *
     518     * @since 3.0.0
     519     *
     520     * @param Settings[]      $settings The settings objects.
     521     * @param WP_REST_Request $request  The request object.
     522     *
     523     * @return array Prepared settings data.
     524     */
     525    private function prepare_settings_for_response( array $settings, WP_REST_Request $request ): array {
     526        $data = array();
     527
     528        foreach ( $settings as $setting ) {
     529            $item_data                  = $this->prepare_single_setting_for_response( $setting, $request );
     530            $data[ $item_data['name'] ] = $item_data['value'];
     531        }
     532
     533        return array(
     534            'settings' => $data,
     535            'count'    => count( $data ),
     536        );
     537    }
     538
     539    /**
     540     * Prepare single setting for response.
     541     *
     542     * @since 3.0.0
     543     *
     544     * @param Settings        $setting The setting object.
     545     * @param WP_REST_Request $request The request object.
     546     *
     547     * @return array Prepared setting data.
     548     */
     549    private function prepare_single_setting_for_response( Settings $setting, WP_REST_Request $request ): array {
    440550        $data = array(
    441             'id'    => $setting->get_id(),
    442551            'name'  => $setting->get_name(),
    443552            'value' => $setting->get_value(),
     
    457566
    458567    /**
     568     * Get settings data from request.
     569     *
     570     * @since 3.0.0
     571     *
     572     * @param WP_REST_Request $request The request object.
     573     *
     574     * @return array Settings data.
     575     * @throws JsonException When JSON parsing fails.
     576     */
     577    private function get_request_settings_data( WP_REST_Request $request ): array {
     578        $params = $request->get_params();
     579
     580        // Handle JSON body if available
     581        if ( empty( $params ) && $request->get_body() ) {
     582            $params = json_decode( $request->get_body(), true, 512, JSON_THROW_ON_ERROR );
     583        }
     584
     585        return $params['settings'] ?? array();
     586    }
     587
     588    /**
     589     * Update a single setting internally.
     590     *
     591     * @since 3.0.0
     592     *
     593     * @param string $setting_name  The setting name.
     594     * @param mixed  $setting_value The setting value.
     595     *
     596     * @return true|WP_Error True on success, WP_Error on failure.
     597     */
     598    private function update_single_setting_internal( string $setting_name, $setting_value ) {
     599        // Sanitize setting name
     600        $setting_name = $this->sanitize_setting_name( $setting_name );
     601
     602        if ( empty( $setting_name ) ) {
     603            return $this->error(
     604                __( 'Invalid setting name.', 'dokan-kits' ),
     605                'invalid_setting_name',
     606                400
     607            );
     608        }
     609
     610        // Validate setting access
     611        $validation_result = $this->validate_setting_access( $setting_name );
     612        if ( is_wp_error( $validation_result ) ) {
     613            return $validation_result;
     614        }
     615
     616        // Parse setting name parts
     617        $setting_parts = $this->parse_setting_name( $setting_name );
     618        if ( is_wp_error( $setting_parts ) ) {
     619            return $setting_parts;
     620        }
     621
     622        // Sanitize value
     623        $sanitized_value = $this->sanitize_setting_value( $setting_value );
     624
     625        error_log( '$setting_parts: ' . print_r( $setting_parts, true ) );
     626
     627        // Update the setting
     628        $updated = dokan_kits_update_setting(
     629            $setting_parts['group'],
     630            $setting_parts['section'],
     631            $setting_parts['option'],
     632            $sanitized_value
     633        );
     634
     635        if ( ! $updated ) {
     636            return $this->error(
     637                __( 'Failed to update setting.', 'dokan-kits' ),
     638                'setting_update_failed',
     639                500
     640            );
     641        }
     642
     643        /**
     644         * Action fired after a single setting is updated.
     645         *
     646         * @since 3.0.0
     647         *
     648         * @param string $setting_name  Setting name.
     649         * @param mixed  $setting_value Setting value.
     650         */
     651        do_action( 'dokan_kits_setting_updated', $setting_name, $sanitized_value );
     652
     653        return true;
     654    }
     655
     656    /**
     657     * Sanitize setting name.
     658     *
     659     * @since 3.0.0
     660     *
     661     * @param string $setting_name The setting name.
     662     *
     663     * @return string Sanitized setting name.
     664     */
     665    private function sanitize_setting_name( string $setting_name ): string {
     666        return preg_replace( '/[^a-zA-Z0-9._-]/', '', $setting_name );
     667    }
     668
     669    /**
     670     * Validate setting access.
     671     *
     672     * @since 3.0.0
     673     *
     674     * @param string $setting_name The setting name.
     675     *
     676     * @return true|WP_Error True if valid, WP_Error otherwise.
     677     */
     678    private function validate_setting_access( string $setting_name ) {
     679        // Parse setting name to validate format
     680        $setting_parts = $this->parse_setting_name( $setting_name );
     681        if ( is_wp_error( $setting_parts ) ) {
     682            return $setting_parts;
     683        }
     684
     685        // Check if group is allowed
     686        $allowed_groups = $this->data_store->get_allowed_groups();
     687        if ( ! in_array( $setting_parts['group'], $allowed_groups, true ) ) {
     688            return $this->error(
     689                sprintf(
     690                /* translators: 1: group name, 2: allowed groups */
     691                    __( 'Invalid group "%1$s". Allowed groups: %2$s', 'dokan-kits' ),
     692                    $setting_parts['group'],
     693                    implode( ', ', $allowed_groups )
     694                ),
     695                'invalid_group',
     696                400
     697            );
     698        }
     699
     700        /**
     701         * Filter setting access validation.
     702         *
     703         * @since 3.0.0
     704         *
     705         * @param bool   $access        Whether access is allowed.
     706         * @param string $setting_name  The setting name.
     707         * @param array  $setting_parts Parsed setting parts.
     708         */
     709        $access_allowed = apply_filters( 'dokan_kits_rest_setting_access', true, $setting_name, $setting_parts );
     710
     711        if ( ! $access_allowed ) {
     712            return $this->error(
     713                sprintf(
     714                /* translators: %s: setting name */
     715                    __( 'Access denied for setting "%s".', 'dokan-kits' ),
     716                    $setting_name
     717                ),
     718                'setting_access_denied',
     719                403
     720            );
     721        }
     722
     723        return true;
     724    }
     725
     726    /**
     727     * Parse setting name into components.
     728     *
     729     * @since 3.0.0
     730     *
     731     * @param string $setting_name The setting name.
     732     *
     733     * @return array|WP_Error Parsed components or error.
     734     */
     735    private function parse_setting_name( string $setting_name ) {
     736        $parts = explode( '.', $setting_name, 3 );
     737
     738        if ( count( $parts ) < 3 ) {
     739            return $this->error(
     740                __( 'Invalid setting name format. Expected: group.section.option', 'dokan-kits' ),
     741                'invalid_setting_format',
     742                400
     743            );
     744        }
     745
     746        return array(
     747            'group'   => sanitize_key( $parts[0] ),
     748            'section' => sanitize_key( $parts[1] ),
     749            'option'  => sanitize_key( $parts[2] ),
     750        );
     751    }
     752
     753    /**
     754     * Sanitize setting value.
     755     *
     756     * @since 3.0.0
     757     *
     758     * @param mixed $value Setting value.
     759     *
     760     * @return mixed Sanitized value.
     761     */
     762    private function sanitize_setting_value( $value ) {
     763        if ( is_array( $value ) ) {
     764            return array_map( array( $this, 'sanitize_setting_value' ), $value );
     765        }
     766
     767        if ( is_string( $value ) ) {
     768            return wc_clean( $value );
     769        }
     770
     771        if ( is_bool( $value ) || is_numeric( $value ) ) {
     772            return $value;
     773        }
     774
     775        // For other types, convert to string and clean
     776        return wc_clean( (string) $value );
     777    }
     778
     779    /**
     780     * Handle exceptions in a standardized way.
     781     *
     782     * @since 3.0.0
     783     *
     784     * @param \Throwable $exception The exception.
     785     * @param string     $context   The context.
     786     *
     787     * @return WP_Error Error response.
     788     */
     789    protected function handle_exception( \Throwable $exception, string $context = '' ): WP_Error {
     790        // Log the exception
     791        dokan_kits_logger()->error(
     792            sprintf( 'Exception in SettingsController::%s: %s', $context, $exception->getMessage() ),
     793            array(
     794                'exception' => $exception,
     795                'context'   => $context,
     796            )
     797        );
     798
     799        // Handle specific exception types
     800        if ( $exception instanceof JsonException ) {
     801            return $this->error(
     802                __( 'Invalid JSON data provided.', 'dokan-kits' ),
     803                'invalid_json',
     804                400
     805            );
     806        }
     807
     808        // Generic server error
     809        return $this->error(
     810            sprintf(
     811            /* translators: %s: context */
     812                __( 'Failed to %s: An unexpected error occurred.', 'dokan-kits' ),
     813                str_replace( '_', ' ', $context )
     814            ),
     815            'internal_error',
     816            500
     817        );
     818    }
     819
     820    /**
    459821     * Get the query params for collections.
    460822     *
    461823     * @since 3.0.0
    462824     *
    463      * @return array
     825     * @return array Collection parameters.
    464826     */
    465827    public function get_collection_params(): array {
    466         $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
     828        $allowed_groups = $this->data_store->get_allowed_groups();
    467829
    468830        return array(
     
    496858                'items'       => array(
    497859                    'type' => 'string',
    498                     'enum' => $data_store->get_allowed_groups(),
     860                    'enum' => $allowed_groups,
    499861                ),
    500862            ),
     
    507869
    508870    /**
    509      * Get update params.
    510      *
    511      * @since 3.0.0
    512      *
    513      * @return array
    514      */
    515     public function get_update_params(): array {
     871     * Get parameters for single setting retrieval.
     872     *
     873     * @since 3.0.0
     874     *
     875     * @return array Single setting parameters.
     876     */
     877    public function get_single_setting_params(): array {
     878        return array(
     879            'setting_name' => array(
     880                'description' => __( 'Setting name in format: group.section.option', 'dokan-kits' ),
     881                'type'        => 'string',
     882                'required'    => true,
     883                'pattern'     => '^[a-zA-Z0-9._-]+',
     884            ),
     885        );
     886    }
     887
     888    /**
     889     * Get parameters for bulk settings update.
     890     *
     891     * @since 3.0.0
     892     *
     893     * @return array Bulk update parameters.
     894     */
     895    public function get_bulk_update_params(): array {
    516896        return array(
    517897            'settings' => array(
    518                 'description' => __( 'Settings data to update.', 'dokan-kits' ),
     898                'description' => __( 'Settings data to update as key - value pairs . ', 'dokan - kits' ),
    519899                'type'        => 'object',
    520900                'required'    => true,
    521             ),
    522         );
    523     }
    524 
    525     /**
    526      * Get item schema.
    527      *
    528      * @since 3.0.0
    529      *
    530      * @return array
     901                'properties'  => array(
     902                    'additionalProperties' => array(
     903                        'type' => array( 'string', 'number', 'boolean', 'array', 'object' ),
     904                    ),
     905                ),
     906            ),
     907        );
     908    }
     909
     910    /**
     911     * Get parameters for single setting update.
     912     *
     913     * @since 3.0.0
     914     *
     915     * @return array Single update parameters.
     916     */
     917    public function get_single_update_params(): array {
     918        return array(
     919            'setting_name' => array(
     920                'description' => __( 'Setting name in format: group . section . option', 'dokan - kits' ),
     921                'type'        => 'string',
     922                'required'    => true,
     923                'pattern'     => ' ^ [ a - zA - Z0 - 9._ -]+',
     924            ),
     925            'value'        => array(
     926                'description' => __( 'Setting value to update.', 'dokan-kits' ),
     927                'type'        => array( 'string', 'number', 'boolean', 'array', 'object' ),
     928                'required'    => true,
     929            ),
     930        );
     931    }
     932
     933    /**
     934     * Get item schema for settings collection.
     935     *
     936     * @since 3.0.0
     937     *
     938     * @return array Item schema.
    531939     */
    532940    public function get_item_schema() {
     
    537945        $schema = array(
    538946            '$schema'    => 'http://json-schema.org/draft-04/schema#',
    539             'title'      => 'dokan_kits_settings',
     947            'title'      => 'dokan_kits_settings_collection',
    540948            'type'       => 'object',
    541949            'properties' => array(
    542950                'success' => array(
    543                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
     951                    'description' => __( 'Whether the request was successful.', 'dokan-kits' ),
    544952                    'type'        => 'boolean',
    545953                    'context'     => array( 'view', 'edit' ),
     
    547955                ),
    548956                'message' => array(
    549                     'description' => __( 'Message describing the result of the operation.', 'dokan-kits' ),
     957                    'description' => __( 'Human-readable message describing the result.', 'dokan-kits' ),
    550958                    'type'        => 'string',
    551959                    'context'     => array( 'view', 'edit' ),
     
    553961                ),
    554962                'data'    => array(
    555                     'description' => __( 'Settings data.', 'dokan-kits' ),
     963                    'description' => __( 'Settings collection data.', 'dokan-kits' ),
    556964                    'type'        => 'object',
    557965                    'context'     => array( 'view', 'edit' ),
    558                     'readonly'    => true,
    559966                    'properties'  => array(
    560967                        'settings' => array(
    561                             'description' => __( 'Settings collection.', 'dokan-kits' ),
    562                             'type'        => 'object',
     968                            'description'          => __( 'Settings as key-value pairs.', 'dokan-kits' ),
     969                            'type'                 => 'object',
     970                            'additionalProperties' => array(
     971                                'type' => array( 'string', 'number', 'boolean', 'array', 'object' ),
     972                            ),
    563973                        ),
    564974                        'count'    => array(
    565                             'description' => __( 'Number of settings.', 'dokan-kits' ),
     975                            'description' => __( 'Number of settings in the collection.', 'dokan-kits' ),
    566976                            'type'        => 'integer',
     977                            'minimum'     => 0,
    567978                        ),
    568979                    ),
     
    575986        return $this->add_additional_fields_schema( $this->schema );
    576987    }
     988
     989    /**
     990     * Get schema for single setting response.
     991     *
     992     * @since 3.0.0
     993     *
     994     * @return array Single setting schema.
     995     */
     996    public function get_single_setting_schema(): array {
     997        return array(
     998            '$schema'    => 'http://json-schema.org/draft-04/schema#',
     999            'title'      => 'dokan_kits_single_setting',
     1000            'type'       => 'object',
     1001            'properties' => array(
     1002                'success' => array(
     1003                    'description' => __( 'Whether the request was successful.', 'dokan-kits' ),
     1004                    'type'        => 'boolean',
     1005                    'readonly'    => true,
     1006                ),
     1007                'message' => array(
     1008                    'description' => __( 'Human-readable message describing the result.', 'dokan-kits' ),
     1009                    'type'        => 'string',
     1010                    'readonly'    => true,
     1011                ),
     1012                'data'    => array(
     1013                    'description' => __( 'Single setting data.', 'dokan-kits' ),
     1014                    'type'        => 'object',
     1015                    'properties'  => array(
     1016                        'name'  => array(
     1017                            'description' => __( 'Setting name.', 'dokan-kits' ),
     1018                            'type'        => 'string',
     1019                            'readonly'    => true,
     1020                        ),
     1021                        'value' => array(
     1022                            'description' => __( 'Setting value.', 'dokan-kits' ),
     1023                            'type'        => array( 'string', 'number', 'boolean', 'array', 'object' ),
     1024                        ),
     1025                    ),
     1026                ),
     1027            ),
     1028        );
     1029    }
    5771030}
  • dokan-kits/trunk/includes/REST/Controllers/Version1/ToolsController.php

    r3320185 r3321393  
    33 * Tools API Controller
    44 *
    5  * @since   3.0.2
    65 * @package DokanKits\REST\Controllers\Version1
     6 * @since 3.0.2
    77 */
    88
     
    2020use WP_REST_Request;
    2121use WP_REST_Response;
    22 use WP_REST_Controller;
    2322
    2423/**
     
    2726 * Handles API endpoints for managing maintenance and utility tools.
    2827 *
    29  * @since 3.0.0
     28 * @since 3.0.2
    3029 */
    3130class ToolsController extends Controller {
     
    4039     * Register routes.
    4140     *
    42      * @since 3.0.0
     41     * @since 3.0.2
    4342     *
    4443     * @return void
    4544     */
    4645    public function register_routes() {
    47         // Register route for recreating database tables
     46        // Database tables management
    4847        register_rest_route(
    4948            $this->namespace,
    50             '/' . $this->rest_base . '/recreate-tables',
     49            '/' . $this->rest_base . '/database/recreate',
    5150            array(
    5251                array(
     
    5655                    'args'                => array(),
    5756                ),
    58                 'schema' => array( $this, 'get_item_schema' ),
     57                'schema' => array( $this, 'get_database_operation_schema' ),
    5958            )
    6059        );
    6160
    62         // Register route for optimizing database tables
    6361        register_rest_route(
    6462            $this->namespace,
    65             '/' . $this->rest_base . '/optimize-tables',
     63            '/' . $this->rest_base . '/database/optimize',
    6664            array(
    6765                array(
     
    7169                    'args'                => array(),
    7270                ),
    73                 'schema' => array( $this, 'get_item_schema' ),
     71                'schema' => array( $this, 'get_database_operation_schema' ),
    7472            )
    7573        );
    7674
    77         // Register route for migrating settings
     75        // Migration management
    7876        register_rest_route(
    7977            $this->namespace,
    80             '/' . $this->rest_base . '/migrate-settings',
     78            '/' . $this->rest_base . '/migration/run',
    8179            array(
    8280                array(
    8381                    'methods'             => WP_REST_Server::CREATABLE,
    84                     'callback'            => array( $this, 'migrate_settings' ),
     82                    'callback'            => array( $this, 'run_migration' ),
    8583                    'permission_callback' => array( $this, 'admin_permissions_check' ),
    8684                    'args'                => array(),
    8785                ),
    88                 'schema' => array( $this, 'get_item_schema' ),
     86                'schema' => array( $this, 'get_migration_operation_schema' ),
    8987            )
    9088        );
    9189
    92         // Endpoint: GET /tools/migration-status - Check migration status
    9390        register_rest_route(
    9491            $this->namespace,
    95             '/' . $this->rest_base . '/migration-status',
     92            '/' . $this->rest_base . '/migration/status',
    9693            array(
    9794                array(
     
    10198                    'args'                => array(),
    10299                ),
    103                 'schema' => array( $this, 'get_item_schema' ),
     100                'schema' => array( $this, 'get_migration_status_schema' ),
    104101            )
    105102        );
    106103
    107         // Register route for running diagnostics
     104        // System diagnostics
    108105        register_rest_route(
    109106            $this->namespace,
    110             '/' . $this->rest_base . '/run-diagnostics',
     107            '/' . $this->rest_base . '/diagnostics/run',
    111108            array(
    112109                array(
     
    116113                    'args'                => array(),
    117114                ),
    118                 'schema' => array( $this, 'get_item_schema' ),
     115                'schema' => array( $this, 'get_diagnostics_schema' ),
    119116            )
    120117        );
    121118
    122         // Register route for downloading logs
     119        // Log management
    123120        register_rest_route(
    124121            $this->namespace,
    125             '/' . $this->rest_base . '/download-logs',
     122            '/' . $this->rest_base . '/logs/download',
    126123            array(
    127124                array(
     
    131128                    'args'                => array(),
    132129                ),
    133                 'schema' => array( $this, 'get_item_schema' ),
     130                'schema' => array( $this, 'get_logs_schema' ),
    134131            )
    135132        );
     
    139136     * Recreate database tables.
    140137     *
    141      * @since 3.0.0
     138     * @since 3.0.2
    142139     *
    143140     * @param WP_REST_Request $request Full details about the request.
    144141     *
    145      * @return WP_REST_Response|WP_Error
     142     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
    146143     */
    147144    public function recreate_tables( WP_REST_Request $request ) {
    148145        try {
    149             // Get all data stores from the container.
    150             $data_stores    = dokan_kits_get_container()->get( 'data-store-service' );
    151             $created_tables = array();
    152 
    153             // Initialize each data store that has an initialize method.
    154             foreach ( $data_stores as $data_store ) {
    155                 if ( ! $data_store instanceof DataStore ) {
    156                     continue;
    157                 }
    158 
     146            /**
     147             * Action fired before recreating database tables.
     148             *
     149             * @since 3.0.2
     150             *
     151             * @param WP_REST_Request $request The request object.
     152             */
     153            do_action( 'dokan_kits_before_recreate_tables', $request );
     154
     155            $result = $this->recreate_database_tables();
     156
     157            /**
     158             * Action fired after recreating database tables.
     159             *
     160             * @since 3.0.2
     161             *
     162             * @param array           $result  The recreation result.
     163             * @param WP_REST_Request $request The request object.
     164             */
     165            do_action( 'dokan_kits_after_recreate_tables', $result, $request );
     166
     167            return $this->success(
     168                $result,
     169                sprintf(
     170                /* translators: %d: Number of tables recreated */
     171                    _n(
     172                        '%d database table recreated successfully.',
     173                        '%d database tables recreated successfully.',
     174                        count( $result['tables'] ),
     175                        'dokan-kits'
     176                    ),
     177                    count( $result['tables'] )
     178                )
     179            );
     180
     181        } catch ( \Exception $e ) {
     182            return $this->handle_exception( $e, 'recreate_tables' );
     183        }
     184    }
     185
     186    /**
     187     * Optimize database tables.
     188     *
     189     * @since 3.0.2
     190     *
     191     * @param WP_REST_Request $request Full details about the request.
     192     *
     193     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
     194     */
     195    public function optimize_tables( WP_REST_Request $request ) {
     196        try {
     197            /**
     198             * Action fired before optimizing database tables.
     199             *
     200             * @since 3.0.2
     201             *
     202             * @param WP_REST_Request $request The request object.
     203             */
     204            do_action( 'dokan_kits_before_optimize_tables', $request );
     205
     206            $result = $this->optimize_database_tables();
     207
     208            /**
     209             * Action fired after optimizing database tables.
     210             *
     211             * @since 3.0.2
     212             *
     213             * @param array           $result  The optimization result.
     214             * @param WP_REST_Request $request The request object.
     215             */
     216            do_action( 'dokan_kits_after_optimize_tables', $result, $request );
     217
     218            if ( ! empty( $result['failed'] ) ) {
     219                return $this->error(
     220                    __( 'Some tables could not be optimized.', 'dokan-kits' ),
     221                    'partial_optimization_failure',
     222                    207, // Multi-Status
     223                    $result
     224                );
     225            }
     226
     227            return $this->success(
     228                $result,
     229                sprintf(
     230                /* translators: %d: Number of tables optimized */
     231                    _n(
     232                        '%d database table optimized successfully.',
     233                        '%d database tables optimized successfully.',
     234                        count( $result['optimized'] ),
     235                        'dokan-kits'
     236                    ),
     237                    count( $result['optimized'] )
     238                )
     239            );
     240
     241        } catch ( \Exception $e ) {
     242            return $this->handle_exception( $e, 'optimize_tables' );
     243        }
     244    }
     245
     246    /**
     247     * Run database migration.
     248     *
     249     * @since 3.0.2
     250     *
     251     * @param WP_REST_Request $request Full details about the request.
     252     *
     253     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
     254     */
     255    public function run_migration( WP_REST_Request $request ) {
     256        try {
     257            /**
     258             * Action fired before running migration.
     259             *
     260             * @since 3.0.2
     261             *
     262             * @param WP_REST_Request $request The request object.
     263             */
     264            do_action( 'dokan_kits_before_run_migration', $request );
     265
     266            $migrator = dokan_kits_get_container()->get( Migrator::class );
     267
     268            if ( $migrator->is_migration_running() ) {
     269                return $this->error(
     270                    __( 'A migration is already in progress.', 'dokan-kits' ),
     271                    'migration_in_progress',
     272                    409 // Conflict
     273                );
     274            }
     275
     276            $result = $this->execute_migration( $migrator );
     277
     278            /**
     279             * Action fired after running migration.
     280             *
     281             * @since 3.0.2
     282             *
     283             * @param array           $result  The migration result.
     284             * @param WP_REST_Request $request The request object.
     285             */
     286            do_action( 'dokan_kits_after_run_migration', $result, $request );
     287
     288            return $this->success(
     289                $result,
     290                sprintf(
     291                /* translators: %d: Number of migration versions executed */
     292                    _n(
     293                        '%d migration version executed successfully.',
     294                        '%d migration versions executed successfully.',
     295                        count( $result['versions'] ),
     296                        'dokan-kits'
     297                    ),
     298                    count( $result['versions'] )
     299                )
     300            );
     301
     302        } catch ( \Exception $e ) {
     303            return $this->handle_exception( $e, 'run_migration' );
     304        }
     305    }
     306
     307    /**
     308     * Get migration status.
     309     *
     310     * @since 3.0.2
     311     *
     312     * @param WP_REST_Request $request Full details about the request.
     313     *
     314     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
     315     */
     316    public function get_migration_status( WP_REST_Request $request ) {
     317        try {
     318            /**
     319             * Action fired before getting migration status.
     320             *
     321             * @since 3.0.2
     322             *
     323             * @param WP_REST_Request $request The request object.
     324             */
     325            do_action( 'dokan_kits_before_get_migration_status', $request );
     326
     327            $status_data = $this->prepare_migration_status();
     328
     329            /**
     330             * Filter the migration status data.
     331             *
     332             * @since 3.0.2
     333             *
     334             * @param array           $status_data The migration status data.
     335             * @param WP_REST_Request $request     The request object.
     336             */
     337            $status_data = apply_filters( 'dokan_kits_migration_status_data', $status_data, $request );
     338
     339            /**
     340             * Action fired after getting migration status.
     341             *
     342             * @since 3.0.2
     343             *
     344             * @param array           $status_data The migration status data.
     345             * @param WP_REST_Request $request     The request object.
     346             */
     347            do_action( 'dokan_kits_after_get_migration_status', $status_data, $request );
     348
     349            return $this->success(
     350                $status_data,
     351                __( 'Migration status retrieved successfully.', 'dokan-kits' )
     352            );
     353
     354        } catch ( \Exception $e ) {
     355            return $this->handle_exception( $e, 'get_migration_status' );
     356        }
     357    }
     358
     359    /**
     360     * Run system diagnostics.
     361     *
     362     * @since 3.0.2
     363     *
     364     * @param WP_REST_Request $request Full details about the request.
     365     *
     366     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
     367     */
     368    public function run_diagnostics( WP_REST_Request $request ) {
     369        try {
     370            /**
     371             * Action fired before running diagnostics.
     372             *
     373             * @since 3.0.2
     374             *
     375             * @param WP_REST_Request $request The request object.
     376             */
     377            do_action( 'dokan_kits_before_run_diagnostics', $request );
     378
     379            $diagnostics_data = $this->perform_system_diagnostics();
     380
     381            /**
     382             * Filter the diagnostics data.
     383             *
     384             * @since 3.0.2
     385             *
     386             * @param array           $diagnostics_data The diagnostics data.
     387             * @param WP_REST_Request $request          The request object.
     388             */
     389            $diagnostics_data = apply_filters( 'dokan_kits_diagnostics_data', $diagnostics_data, $request );
     390
     391            /**
     392             * Action fired after running diagnostics.
     393             *
     394             * @since 3.0.2
     395             *
     396             * @param array           $diagnostics_data The diagnostics data.
     397             * @param WP_REST_Request $request          The request object.
     398             */
     399            do_action( 'dokan_kits_after_run_diagnostics', $diagnostics_data, $request );
     400
     401            return $this->success(
     402                $diagnostics_data,
     403                __( 'System diagnostics completed successfully.', 'dokan-kits' )
     404            );
     405
     406        } catch ( \Exception $e ) {
     407            return $this->handle_exception( $e, 'run_diagnostics' );
     408        }
     409    }
     410
     411    /**
     412     * Download error logs.
     413     *
     414     * @since 3.0.2
     415     *
     416     * @param WP_REST_Request $request Full details about the request.
     417     *
     418     * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
     419     */
     420    public function download_logs( WP_REST_Request $request ) {
     421        try {
     422            /**
     423             * Action fired before preparing logs for download.
     424             *
     425             * @since 3.0.2
     426             *
     427             * @param WP_REST_Request $request The request object.
     428             */
     429            do_action( 'dokan_kits_before_download_logs', $request );
     430
     431            $logs_data = $this->prepare_log_files();
     432
     433            if ( is_wp_error( $logs_data ) ) {
     434                return $logs_data;
     435            }
     436
     437            /**
     438             * Filter the logs data.
     439             *
     440             * @since 3.0.2
     441             *
     442             * @param array           $logs_data The logs data.
     443             * @param WP_REST_Request $request   The request object.
     444             */
     445            $logs_data = apply_filters( 'dokan_kits_logs_data', $logs_data, $request );
     446
     447            /**
     448             * Action fired after preparing logs for download.
     449             *
     450             * @since 3.0.2
     451             *
     452             * @param array           $logs_data The logs data.
     453             * @param WP_REST_Request $request   The request object.
     454             */
     455            do_action( 'dokan_kits_after_download_logs', $logs_data, $request );
     456
     457            return $this->success(
     458                $logs_data,
     459                __( 'Log files prepared for download successfully.', 'dokan-kits' )
     460            );
     461
     462        } catch ( \Exception $e ) {
     463            return $this->handle_exception( $e, 'download_logs' );
     464        }
     465    }
     466
     467    /**
     468     * Recreate database tables.
     469     *
     470     * @since 3.0.2
     471     *
     472     * @return array Recreation result.
     473     */
     474    private function recreate_database_tables(): array {
     475        $data_stores    = dokan_kits_get_container()->get( 'data-store-service' );
     476        $created_tables = array();
     477        $failed_tables  = array();
     478
     479        foreach ( $data_stores as $data_store ) {
     480            if ( ! $data_store instanceof DataStore ) {
     481                continue;
     482            }
     483
     484            try {
    159485                $data_store->create_tables();
    160486                $data_store->verify_tables();
    161 
    162487                $created_tables[] = $data_store->get_table_name();
    163             }
    164 
    165             /**
    166              * Action after initializing all data stores
    167              *
    168              * @since 3.0.2
    169              *
    170              * @param array      $data_stores Array of initialized data stores
    171              * @param Dokan_Kits $this        Plugin instance
    172              */
    173             do_action( 'dokan_kits_table_created', $data_stores, $this );
    174 
    175             return $this->success(
    176                 array( 'tables' => $created_tables ),
    177                 __( 'Database tables recreated successfully.', 'dokan-kits' )
    178             );
    179         } catch ( \Exception $e ) {
    180             return $this->error( __( 'Failed to recreate database tables: ', 'dokan-kits' ) . $e->getMessage() );
    181         }
     488            } catch ( \Exception $e ) {
     489                $failed_tables[ $data_store->get_table_name() ] = $e->getMessage();
     490            }
     491        }
     492
     493        /**
     494         * Action after recreating all data store tables.
     495         *
     496         * @since 3.0.2
     497         *
     498         * @param array $data_stores Array of data stores.
     499         * @param array $created_tables Array of successfully created tables.
     500         * @param array $failed_tables Array of failed table creations.
     501         */
     502        do_action( 'dokan_kits_tables_recreated', $data_stores, $created_tables, $failed_tables );
     503
     504        return array(
     505            'tables' => $created_tables,
     506            'failed' => $failed_tables,
     507            'total'  => count( $created_tables ),
     508        );
    182509    }
    183510
     
    185512     * Optimize database tables.
    186513     *
    187      * @since 3.0.0
    188      *
    189      * @param WP_REST_Request $request Full details about the request.
    190      *
    191      * @return WP_REST_Response|WP_Error
    192      */
    193     public function optimize_tables( WP_REST_Request $request ) {
     514     * @since 3.0.2
     515     *
     516     * @return array Optimization result.
     517     */
     518    private function optimize_database_tables(): array {
    194519        global $wpdb;
    195520
    196         try {
    197             $tables    = $this->get_dokan_kits_tables();
    198             $optimized = array();
    199             $failed    = array();
    200 
    201             foreach ( $tables as $table ) {
    202                 $table_name = $wpdb->prefix . $table;
    203 
     521        $tables    = $this->get_dokan_kits_tables();
     522        $optimized = array();
     523        $failed    = array();
     524
     525        foreach ( $tables as $table ) {
     526            $table_name = $wpdb->prefix . $table;
     527
     528            try {
    204529                // Repair the table
    205                 $repair_result = $wpdb->query( "REPAIR TABLE {$table_name}" );
     530                $repair_result = $wpdb->query( "REPAIR TABLE {$table_name}" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    206531
    207532                // Optimize the table
    208                 $optimize_result = $wpdb->query( "OPTIMIZE TABLE {$table_name}" );
     533                $optimize_result = $wpdb->query( "OPTIMIZE TABLE {$table_name}" ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    209534
    210535                if ( false !== $repair_result && false !== $optimize_result ) {
    211536                    $optimized[] = $table_name;
    212537                } else {
    213                     $failed[] = $table_name;
     538                    $failed[ $table_name ] = __( 'Failed to repair or optimize table.', 'dokan-kits' );
    214539                }
    215             }
    216 
    217             if ( count( $failed ) > 0 ) {
    218                 return $this->error(
    219                     __( 'Not all tables could be optimized.', 'dokan-kits' ),
    220                 );
    221             }
    222 
    223             return $this->success(
    224                 array(
    225                     'optimized' => $optimized,
    226                     'failed'    => $failed,
    227                 ),
    228                 __( 'Database tables optimized successfully.', 'dokan-kits' )
    229             );
    230         } catch ( \Exception $e ) {
    231             return $this->error( __( 'Failed to optimize database tables: ', 'dokan-kits' ) . $e->getMessage() );
    232         }
    233     }
    234 
    235     /**
    236      * Migrate settings from old options to new structure.
    237      *
    238      * @since 3.0.0
    239      *
    240      * @param WP_REST_Request $request Full details about the request.
    241      *
    242      * @return WP_REST_Response|WP_Error
    243      */
    244     public function migrate_settings( WP_REST_Request $request ) {
    245         try {
    246             $migrator = dokan_kits_get_container()->get( Migrator::class );
    247 
    248             if ( $migrator->is_migration_running() ) {
    249                 return $this->error(
    250                     __( 'A migration is already in progress.', 'dokan-kits' ),
    251                     'dokan_kits_rest_migration_running',
    252                 );
    253             }
    254 
    255             $migrator->run();
    256             $executed_versions = $migrator->get_ordered_versions();
    257 
    258             /**
    259              * Action fired after running migrations via REST API.
    260              *
    261              * @since 3.0.0
    262              * @param array $executed_versions Executed migration versions
    263              * @param WP_REST_Request $request Request object
    264              */
    265             do_action( 'dokan_kits_tools_rest_run_migration', $executed_versions, $request );
    266 
    267             return $this->success(
    268                 array(
    269                     'versions' => $executed_versions,
    270                 ),
    271                 __( 'Migrations completed successfully.', 'dokan-kits' )
    272             );
    273         } catch ( \Exception $e ) {
    274             return $this->error(
    275                 __( 'Migration failed: ', 'dokan-kits' ) . $e->getMessage(),
    276                 'dokan_kits_rest_migration_failed'
    277             );
    278         }
    279     }
    280 
    281     /**
    282      * Run system diagnostics.
    283      *
    284      * @since 3.0.0
    285      *
    286      * @param WP_REST_Request $request Full details about the request.
    287      *
    288      * @return WP_REST_Response|WP_Error
    289      */
    290     public function run_diagnostics( WP_REST_Request $request ) {
    291         try {
    292             $system_check                = dokan_kits_get_container()->get( SystemCheck::class );
    293             $diagnostics                 = $this->perform_system_diagnostics();
    294             $diagnostics['system_check'] = array(
    295                 'pass'    => $system_check->check(),
    296                 'message' => $system_check->check() ? __( 'System requirements met.', 'dokan-kits' ) : __( 'System requirements not met.', 'dokan-kits' ),
    297             );
    298 
    299             /**
    300              * Filter the diagnostic results.
    301              *
    302              * @since 3.0.0
    303              * @param array $diagnostics Diagnostic results
    304              * @param WP_REST_Request $request Request object
    305              */
    306             $diagnostics = apply_filters( 'dokan_kits_diagnostic_results', $diagnostics, $request );
    307 
    308             return $this->success(
    309                 $diagnostics,
    310                 __( 'System diagnostics completed.', 'dokan-kits' )
    311             );
    312         } catch ( \Exception $e ) {
    313             return $this->error(
    314                 __( 'System diagnostics failed: ', 'dokan-kits' ) . $e->getMessage(),
    315                 'dokan_kits_rest_diagnostics_failed',
    316             );
    317         }
    318     }
    319 
    320     /**
    321      * Download error logs.
    322      *
    323      * @since 3.0.0
    324      *
    325      * @param WP_REST_Request $request Full details about the request.
    326      *
    327      * @return WP_REST_Response|WP_Error
    328      */
    329     public function download_logs( WP_REST_Request $request ) {
    330         try {
    331             $logs = $this->prepare_log_files();
    332 
    333             if ( is_wp_error( $logs ) ) {
    334                 return $logs;
    335             }
    336 
    337             /**
    338              * Action fired after preparing log files.
    339              *
    340              * @since 3.0.0
    341              * @param array $logs Log file information
    342              * @param WP_REST_Request $request Request object
    343              */
    344             do_action( 'dokan_kits_logs_prepared', $logs, $request );
    345 
    346             return $this->success(
    347                 $logs,
    348                 __( 'Log files prepared for download.', 'dokan-kits' )
    349             );
    350         } catch ( \Exception $e ) {
    351             return $this->error(
    352                 __( 'Failed to prepare log files: ', 'dokan-kits' ) . $e->getMessage(),
    353                 'dokan_kits_rest_log_download_failed',
    354             );
    355         }
    356     }
    357 
    358     /**
    359      * Get migration status.
    360      *
    361      * @since 3.0.0
    362      * @param WP_REST_Request $request Full details about the request.
    363      * @return WP_REST_Response|WP_Error
    364      */
    365     public function get_migration_status( WP_REST_Request $request ) {
    366         try {
    367             $migrator   = dokan_kits_get_container()->get( Migrator::class );
    368             $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
    369 
    370             $migration_history = $data_store->get_settings_by_name( 'migration_history' );
    371             $history           = $migration_history instanceof Settings ? $migration_history->get_value() : array();
    372 
    373             $data = array(
    374                 'is_running'           => $migrator->is_migration_running(),
    375                 'needs_migration'      => $migrator->needs_migration(),
    376                 'current_version'      => defined( 'DOKAN_KITS_VERSION' ) ? DOKAN_KITS_VERSION : 'unknown',
    377                 'migration_history'    => is_array( $history ) ? $history : array(),
    378                 'available_migrations' => $migrator->get_ordered_versions(),
    379             );
    380 
    381             /**
    382              * Filter the migration status response data.
    383              *
    384              * @since 3.0.0
    385              * @param array $data Response data
    386              * @param WP_REST_Request $request Request object
    387              */
    388             $data = apply_filters( 'dokan_kits_tools_rest_migration_status', $data, $request );
    389 
    390             return $this->success(
    391                 $data,
    392                 __( 'Migration status retrieved successfully.', 'dokan-kits' )
    393             );
    394         } catch ( \Exception $e ) {
    395             return $this->error(
    396                 __( 'Failed to retrieve migration status: ', 'dokan-kits' ) . $e->getMessage(),
    397                 'dokan_kits_rest_migration_status_failed',
    398             );
    399         }
    400     }
    401 
    402     /**
    403      * Get the list of Dokan Kits database tables.
    404      *
    405      * @since 3.0.0
    406      * @return array List of table names without prefix.
    407      */
    408     private function get_dokan_kits_tables(): array {
    409         $tables      = array();
    410         $data_stores = dokan_kits_get_container()->get( 'data-store-service' );
    411 
    412         foreach ( $data_stores as $data_store ) {
    413             if ( $data_store instanceof DataStore ) {
    414                 $tables[] = $data_store->get_table_name();
    415             }
    416         }
     540            } catch ( \Exception $e ) {
     541                $failed[ $table_name ] = $e->getMessage();
     542            }
     543        }
     544
     545        return array(
     546            'optimized' => $optimized,
     547            'failed'    => $failed,
     548            'total'     => count( $optimized ),
     549        );
     550    }
     551
     552    /**
     553     * Execute database migration.
     554     *
     555     * @since 3.0.2
     556     *
     557     * @param Migrator $migrator The migrator instance.
     558     *
     559     * @return array Migration result.
     560     */
     561    private function execute_migration( Migrator $migrator ): array {
     562        $migrator->run();
     563        $executed_versions = $migrator->get_ordered_versions();
    417564
    418565        /**
    419          * Filter the list of database tables.
     566         * Action fired after running migrations via REST API.
    420567         *
    421          * @since 3.0.0
    422          * @param array $tables List of database tables.
     568         * @since 3.0.2
     569         *
     570         * @param array $executed_versions Executed migration versions.
    423571         */
    424         return apply_filters( 'dokan_kits_database_tables', array_unique( $tables ) );
     572        do_action( 'dokan_kits_migrations_executed', $executed_versions );
     573
     574        return array(
     575            'versions'  => $executed_versions,
     576            'total'     => count( $executed_versions ),
     577            'timestamp' => current_time( 'mysql' ),
     578        );
     579    }
     580
     581    /**
     582     * Prepare migration status data.
     583     *
     584     * @since 3.0.2
     585     *
     586     * @return array Migration status data.
     587     */
     588    private function prepare_migration_status(): array {
     589        $migrator   = dokan_kits_get_container()->get( Migrator::class );
     590        $data_store = dokan_kits_get_container()->get( SettingsDataStore::class );
     591
     592        $migration_history = $data_store->get_settings_by_name( 'migration_history' );
     593        $history           = $migration_history instanceof Settings ? $migration_history->get_value() : array();
     594
     595        return array(
     596            'is_running'           => $migrator->is_migration_running(),
     597            'needs_migration'      => $migrator->needs_migration(),
     598            'current_version'      => defined( 'DOKAN_KITS_VERSION' ) ? DOKAN_KITS_VERSION : 'unknown',
     599            'migration_history'    => is_array( $history ) ? $history : array(),
     600            'available_migrations' => $migrator->get_ordered_versions(),
     601            'last_check'           => current_time( 'mysql' ),
     602        );
    425603    }
    426604
     
    428606     * Perform system diagnostics.
    429607     *
    430      * @since 3.0.0
     608     * @since 3.0.2
     609     *
    431610     * @return array Diagnostic results.
    432611     */
     
    464643
    465644        // Server information
    466         $server_software   = isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '';
     645        $server_software   = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $this->sanitize_text( $_SERVER['SERVER_SOFTWARE'] ) : '';
    467646        $results['server'] = array(
    468647            'software'      => $server_software,
     
    504683        }
    505684
     685        // Add system check
     686        $system_check            = dokan_kits_get_container()->get( SystemCheck::class );
     687        $results['system_check'] = array(
     688            'pass'    => $system_check->check(),
     689            'message' => $system_check->check() ? __( 'System requirements met.', 'dokan-kits' ) : __( 'System requirements not met.', 'dokan-kits' ),
     690        );
     691
    506692        /**
    507693         * Filter the diagnostic results.
    508694         *
    509          * @since 3.0.0
     695         * @since 3.0.2
    510696         *
    511697         * @param array $results Diagnostic results.
    512698         */
    513         return apply_filters( 'dokan_kits_perform_diagnostics', $results );
     699        return apply_filters( 'dokan_kits_diagnostic_results', $results );
     700    }
     701
     702    /**
     703     * Get the list of Dokan Kits database tables.
     704     *
     705     * @since 3.0.2
     706     *
     707     * @return array List of table names without prefix.
     708     */
     709    private function get_dokan_kits_tables(): array {
     710        $tables      = array();
     711        $data_stores = dokan_kits_get_container()->get( 'data-store-service' );
     712
     713        foreach ( $data_stores as $data_store ) {
     714            if ( $data_store instanceof DataStore ) {
     715                $tables[] = $data_store->get_table_name();
     716            }
     717        }
     718
     719        /**
     720         * Filter the list of database tables.
     721         *
     722         * @since 3.0.2
     723         *
     724         * @param array $tables List of database tables.
     725         */
     726        return apply_filters( 'dokan_kits_database_tables', array_unique( $tables ) );
    514727    }
    515728
     
    517730     * Check database tables.
    518731     *
    519      * @since 3.0.0
     732     * @since 3.0.2
    520733     *
    521734     * @return array Table check results.
     
    553766     * Prepare log files for download.
    554767     *
    555      * @since 3.0.0
     768     * @since 3.0.2
    556769     *
    557770     * @return array|WP_Error Log file information or error.
     
    566779                return $this->error(
    567780                    __( 'Could not create log directory.', 'dokan-kits' ),
    568                     'dokan_kits_log_dir_creation_failed',
     781                    'log_dir_creation_failed',
    569782                    500
    570783                );
     
    591804            return $this->error(
    592805                __( 'Could not write to log file.', 'dokan-kits' ),
    593                 'dokan_kits_log_write_failed',
     806                'log_write_failed',
    594807                500
    595808            );
     
    609822     * Collect debug information for logs.
    610823     *
    611      * @since 3.0.0
     824     * @since 3.0.2
    612825     *
    613826     * @return string Log data as formatted string.
     
    707920         * Filter the log data.
    708921         *
    709          * @since 3.0.0
     922         * @since 3.0.2
    710923         *
    711924         * @param string $log_data    Log data as a formatted string.
    712925         * @param array  $diagnostics Raw diagnostic data.
    713926         */
    714         return apply_filters( 'dokan_kits_log_data', $log_data, $diagnostics );
    715     }
    716 
    717     /**
    718      * Get item schema.
    719      *
    720      * @since 3.0.0
    721      *
    722      * @return array
    723      */
    724     public function get_item_schema() {
    725         if ( $this->schema ) {
    726             return $this->add_additional_fields_schema( $this->schema );
    727         }
    728 
    729         $schema = array(
     927        return apply_filters( 'dokan_kits_debug_log_data', $log_data, $diagnostics );
     928    }
     929
     930    /**
     931     * Get database operation schema.
     932     *
     933     * @since 3.0.2
     934     *
     935     * @return array Database operation schema.
     936     */
     937    public function get_database_operation_schema(): array {
     938        return array(
    730939            '$schema'    => 'http://json-schema.org/draft-04/schema#',
    731             'title'      => 'dokan_kits_tools',
     940            'title'      => 'dokan_kits_database_operation',
    732941            'type'       => 'object',
    733             'properties' => array(
    734                 'success' => array(
    735                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
    736                     'type'        => 'boolean',
    737                     'context'     => array( 'view', 'edit' ),
    738                     'readonly'    => true,
    739                 ),
    740                 'message' => array(
    741                     'description' => __( 'Message describing the result of the operation.', 'dokan-kits' ),
    742                     'type'        => 'string',
    743                     'context'     => array( 'view', 'edit' ),
    744                     'readonly'    => true,
    745                 ),
    746                 'data'    => array(
    747                     'description' => __( 'Additional data related to the operation.', 'dokan-kits' ),
    748                     'type'        => 'object',
    749                     'context'     => array( 'view', 'edit' ),
    750                     'readonly'    => true,
    751                 ),
     942            'properties' => array_merge(
     943                $this->get_standard_response_schema(),
     944                array(
     945                    'data' => array(
     946                        'description' => __( 'Database operation result.', 'dokan-kits' ),
     947                        'type'        => 'object',
     948                        'properties'  => array(
     949                            'tables' => array(
     950                                'description' => __( 'List of successfully processed tables.', 'dokan-kits' ),
     951                                'type'        => 'array',
     952                                'items'       => array( 'type' => 'string' ),
     953                            ),
     954                            'failed' => array(
     955                                'description'          => __( 'Failed operations by table name.', 'dokan-kits' ),
     956                                'type'                 => array( 'object', 'array' ),
     957                                'additionalProperties' => array( 'type' => 'string' ),
     958                            ),
     959                            'total'  => array(
     960                                'description' => __( 'Total number of successfully processed tables.', 'dokan-kits' ),
     961                                'type'        => 'integer',
     962                                'minimum'     => 0,
     963                            ),
     964                        ),
     965                    ),
     966                )
    752967            ),
    753968        );
    754 
    755         $this->schema = $schema;
    756 
    757         return $this->add_additional_fields_schema( $this->schema );
     969    }
     970
     971    /**
     972     * Get migration operation schema.
     973     *
     974     * @since 3.0.2
     975     *
     976     * @return array Migration operation schema.
     977     */
     978    public function get_migration_operation_schema(): array {
     979        return array(
     980            '$schema'    => 'http://json-schema.org/draft-04/schema#',
     981            'title'      => 'dokan_kits_migration_operation',
     982            'type'       => 'object',
     983            'properties' => array_merge(
     984                $this->get_standard_response_schema(),
     985                array(
     986                    'data' => array(
     987                        'description' => __( 'Migration operation result.', 'dokan-kits' ),
     988                        'type'        => 'object',
     989                        'properties'  => array(
     990                            'versions'  => array(
     991                                'description' => __( 'List of executed migration versions.', 'dokan-kits' ),
     992                                'type'        => 'array',
     993                                'items'       => array( 'type' => 'string' ),
     994                            ),
     995                            'total'     => array(
     996                                'description' => __( 'Total number of executed migrations.', 'dokan-kits' ),
     997                                'type'        => 'integer',
     998                                'minimum'     => 0,
     999                            ),
     1000                            'timestamp' => array(
     1001                                'description' => __( 'Migration execution timestamp.', 'dokan-kits' ),
     1002                                'type'        => 'string',
     1003                                'format'      => 'date-time',
     1004                            ),
     1005                        ),
     1006                    ),
     1007                )
     1008            ),
     1009        );
    7581010    }
    7591011
     
    7611013     * Get migration status schema.
    7621014     *
    763      * @since 3.0.0
    764      *
    765      * @return array
     1015     * @since 3.0.2
     1016     *
     1017     * @return array Migration status schema.
    7661018     */
    7671019    public function get_migration_status_schema(): array {
     
    7701022            'title'      => 'dokan_kits_migration_status',
    7711023            'type'       => 'object',
    772             'properties' => array(
    773                 'success' => array(
    774                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
    775                     'type'        => 'boolean',
    776                 ),
    777                 'message' => array(
    778                     'description' => __( 'Message describing the result.', 'dokan-kits' ),
    779                     'type'        => 'string',
    780                 ),
    781                 'data'    => array(
    782                     'description' => __( 'Migration status data.', 'dokan-kits' ),
    783                     'type'        => 'object',
    784                     'properties'  => array(
    785                         'is_running'           => array(
    786                             'description' => __( 'Whether migration is currently running.', 'dokan-kits' ),
    787                             'type'        => 'boolean',
    788                         ),
    789                         'needs_migration'      => array(
    790                             'description' => __( 'Whether migration is needed.', 'dokan-kits' ),
    791                             'type'        => 'boolean',
    792                         ),
    793                         'current_version'      => array(
    794                             'description' => __( 'Current plugin version.', 'dokan-kits' ),
    795                             'type'        => 'string',
    796                         ),
    797                         'migration_history'    => array(
    798                             'description' => __( 'Migration history.', 'dokan-kits' ),
    799                             'type'        => 'array',
    800                         ),
    801                         'available_migrations' => array(
    802                             'description' => __( 'Available migration versions.', 'dokan-kits' ),
    803                             'type'        => 'array',
    804                         ),
    805                         'last_check'           => array(
    806                             'description' => __( 'Last check timestamp.', 'dokan-kits' ),
    807                             'type'        => 'string',
    808                             'format'      => 'date-time',
     1024            'properties' => array_merge(
     1025                $this->get_standard_response_schema(),
     1026                array(
     1027                    'data' => array(
     1028                        'description' => __( 'Migration status information.', 'dokan-kits' ),
     1029                        'type'        => 'object',
     1030                        'properties'  => array(
     1031                            'is_running'           => array(
     1032                                'description' => __( 'Whether migration is currently running.', 'dokan-kits' ),
     1033                                'type'        => 'boolean',
     1034                            ),
     1035                            'needs_migration'      => array(
     1036                                'description' => __( 'Whether migration is needed.', 'dokan-kits' ),
     1037                                'type'        => 'boolean',
     1038                            ),
     1039                            'current_version'      => array(
     1040                                'description' => __( 'Current plugin version.', 'dokan-kits' ),
     1041                                'type'        => 'string',
     1042                            ),
     1043                            'migration_history'    => array(
     1044                                'description' => __( 'Historical migration data.', 'dokan-kits' ),
     1045                                'type'        => 'array',
     1046                            ),
     1047                            'available_migrations' => array(
     1048                                'description' => __( 'Available migration versions.', 'dokan-kits' ),
     1049                                'type'        => 'array',
     1050                                'items'       => array( 'type' => 'string' ),
     1051                            ),
     1052                            'last_check'           => array(
     1053                                'description' => __( 'Last status check timestamp.', 'dokan-kits' ),
     1054                                'type'        => 'string',
     1055                                'format'      => 'date-time',
     1056                            ),
    8091057                        ),
    8101058                    ),
    811                 ),
     1059                )
    8121060            ),
    8131061        );
     
    8171065     * Get diagnostics schema.
    8181066     *
    819      * @since 3.0.0
    820      *
    821      * @return array
     1067     * @since 3.0.2
     1068     *
     1069     * @return array Diagnostics schema.
    8221070     */
    8231071    public function get_diagnostics_schema(): array {
     
    8261074            'title'      => 'dokan_kits_diagnostics',
    8271075            'type'       => 'object',
    828             'properties' => array(
    829                 'success' => array(
    830                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
    831                     'type'        => 'boolean',
    832                 ),
    833                 'message' => array(
    834                     'description' => __( 'Message describing the result.', 'dokan-kits' ),
    835                     'type'        => 'string',
    836                 ),
    837                 'data'    => array(
    838                     'description' => __( 'Diagnostics data.', 'dokan-kits' ),
    839                     'type'        => 'object',
    840                     'properties'  => array(
    841                         'diagnostics' => array(
    842                             'description' => __( 'System diagnostic results.', 'dokan-kits' ),
    843                             'type'        => 'object',
    844                         ),
    845                         'timestamp'   => array(
    846                             'description' => __( 'Diagnostics timestamp.', 'dokan-kits' ),
    847                             'type'        => 'string',
    848                             'format'      => 'date-time',
     1076            'properties' => array_merge(
     1077                $this->get_standard_response_schema(),
     1078                array(
     1079                    'data' => array(
     1080                        'description' => __( 'System diagnostics information.', 'dokan-kits' ),
     1081                        'type'        => 'object',
     1082                        'properties'  => array(
     1083                            'wordpress'    => array(
     1084                                'description' => __( 'WordPress environment information.', 'dokan-kits' ),
     1085                                'type'        => 'object',
     1086                            ),
     1087                            'php'          => array(
     1088                                'description' => __( 'PHP environment information.', 'dokan-kits' ),
     1089                                'type'        => 'object',
     1090                            ),
     1091                            'server'       => array(
     1092                                'description' => __( 'Server environment information.', 'dokan-kits' ),
     1093                                'type'        => 'object',
     1094                            ),
     1095                            'dokan_kits'   => array(
     1096                                'description' => __( 'Dokan Kits specific information.', 'dokan-kits' ),
     1097                                'type'        => 'object',
     1098                            ),
     1099                            'dokan'        => array(
     1100                                'description' => __( 'Dokan plugin information.', 'dokan-kits' ),
     1101                                'type'        => 'object',
     1102                            ),
     1103                            'woocommerce'  => array(
     1104                                'description' => __( 'WooCommerce information.', 'dokan-kits' ),
     1105                                'type'        => 'object',
     1106                            ),
     1107                            'system_check' => array(
     1108                                'description' => __( 'System requirements check result.', 'dokan-kits' ),
     1109                                'type'        => 'object',
     1110                                'properties'  => array(
     1111                                    'pass'    => array(
     1112                                        'description' => __( 'Whether system check passed.', 'dokan-kits' ),
     1113                                        'type'        => 'boolean',
     1114                                    ),
     1115                                    'message' => array(
     1116                                        'description' => __( 'System check message.', 'dokan-kits' ),
     1117                                        'type'        => 'string',
     1118                                    ),
     1119                                ),
     1120                            ),
    8491121                        ),
    8501122                    ),
    851                 ),
     1123                )
    8521124            ),
    8531125        );
     
    8551127
    8561128    /**
    857      * Get system status schema.
    858      *
    859      * @since 3.0.0
    860      *
    861      * @return array
    862      */
    863     public function get_system_status_schema(): array {
    864         return array(
    865             '$schema'    => 'http://json-schema.org/draft-04/schema#',
    866             'title'      => 'dokan_kits_system_status',
    867             'type'       => 'object',
    868             'properties' => array(
    869                 'success' => array(
    870                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
    871                     'type'        => 'boolean',
    872                 ),
    873                 'message' => array(
    874                     'description' => __( 'Message describing the result.', 'dokan-kits' ),
    875                     'type'        => 'string',
    876                 ),
    877                 'data'    => array(
    878                     'description' => __( 'System status data.', 'dokan-kits' ),
    879                     'type'        => 'object',
    880                     'properties'  => array(
    881                         'system_check'    => array(
    882                             'description' => __( 'System check result.', 'dokan-kits' ),
    883                             'type'        => 'boolean',
    884                         ),
    885                         'plugin_version'  => array(
    886                             'description' => __( 'Plugin version.', 'dokan-kits' ),
    887                             'type'        => 'string',
    888                         ),
    889                         'wp_version'      => array(
    890                             'description' => __( 'WordPress version.', 'dokan-kits' ),
    891                             'type'        => 'string',
    892                         ),
    893                         'php_version'     => array(
    894                             'description' => __( 'PHP version.', 'dokan-kits' ),
    895                             'type'        => 'string',
    896                         ),
    897                         'database_tables' => array(
    898                             'description' => __( 'Database tables status.', 'dokan-kits' ),
    899                             'type'        => 'object',
    900                         ),
    901                         'dokan_active'    => array(
    902                             'description' => __( 'Whether Dokan is active.', 'dokan-kits' ),
    903                             'type'        => 'boolean',
    904                         ),
    905                         'wc_active'       => array(
    906                             'description' => __( 'Whether WooCommerce is active.', 'dokan-kits' ),
    907                             'type'        => 'boolean',
    908                         ),
    909                         'timestamp'       => array(
    910                             'description' => __( 'Status check timestamp.', 'dokan-kits' ),
    911                             'type'        => 'string',
    912                             'format'      => 'date-time',
    913                         ),
    914                     ),
    915                 ),
    916             ),
    917         );
    918     }
    919 
    920     /**
    9211129     * Get logs schema.
    9221130     *
    923      * @since 3.0.0
    924      *
    925      * @return array
     1131     * @since 3.0.2
     1132     *
     1133     * @return array Logs schema.
    9261134     */
    9271135    public function get_logs_schema(): array {
     
    9301138            'title'      => 'dokan_kits_logs',
    9311139            'type'       => 'object',
    932             'properties' => array(
    933                 'success' => array(
    934                     'description' => __( 'Status of the operation.', 'dokan-kits' ),
    935                     'type'        => 'boolean',
    936                 ),
    937                 'message' => array(
    938                     'description' => __( 'Message describing the result.', 'dokan-kits' ),
    939                     'type'        => 'string',
    940                 ),
    941                 'data'    => array(
    942                     'description' => __( 'Log file data.', 'dokan-kits' ),
    943                     'type'        => 'object',
    944                     'properties'  => array(
    945                         'file_name' => array(
    946                             'description' => __( 'Log file name.', 'dokan-kits' ),
    947                             'type'        => 'string',
    948                         ),
    949                         'file_url'  => array(
    950                             'description' => __( 'Log file URL.', 'dokan-kits' ),
    951                             'type'        => 'string',
    952                             'format'      => 'uri',
    953                         ),
    954                         'file_path' => array(
    955                             'description' => __( 'Log file path.', 'dokan-kits' ),
    956                             'type'        => 'string',
    957                         ),
    958                         'file_size' => array(
    959                             'description' => __( 'Log file size.', 'dokan-kits' ),
    960                             'type'        => 'string',
    961                         ),
    962                         'created'   => array(
    963                             'description' => __( 'File creation date.', 'dokan-kits' ),
    964                             'type'        => 'string',
    965                         ),
    966                         'timestamp' => array(
    967                             'description' => __( 'Creation timestamp.', 'dokan-kits' ),
    968                             'type'        => 'string',
    969                             'format'      => 'date-time',
     1140            'properties' => array_merge(
     1141                $this->get_standard_response_schema(),
     1142                array(
     1143                    'data' => array(
     1144                        'description' => __( 'Log file information.', 'dokan-kits' ),
     1145                        'type'        => 'object',
     1146                        'properties'  => array(
     1147                            'file_name' => array(
     1148                                'description' => __( 'Generated log file name.', 'dokan-kits' ),
     1149                                'type'        => 'string',
     1150                            ),
     1151                            'file_url'  => array(
     1152                                'description' => __( 'URL to download the log file.', 'dokan-kits' ),
     1153                                'type'        => 'string',
     1154                                'format'      => 'uri',
     1155                            ),
     1156                            'file_path' => array(
     1157                                'description' => __( 'Server path to the log file.', 'dokan-kits' ),
     1158                                'type'        => 'string',
     1159                            ),
     1160                            'file_size' => array(
     1161                                'description' => __( 'Human-readable file size.', 'dokan-kits' ),
     1162                                'type'        => 'string',
     1163                            ),
     1164                            'created'   => array(
     1165                                'description' => __( 'File creation date identifier.', 'dokan-kits' ),
     1166                                'type'        => 'string',
     1167                            ),
     1168                            'timestamp' => array(
     1169                                'description' => __( 'File creation timestamp.', 'dokan-kits' ),
     1170                                'type'        => 'string',
     1171                                'format'      => 'date-time',
     1172                            ),
    9701173                        ),
    9711174                    ),
    972                 ),
     1175                )
    9731176            ),
    9741177        );
  • dokan-kits/trunk/languages/dokan-kits.pot

    r3320185 r3321393  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Dokan Kits 3.0.2\n"
     5"Project-Id-Version: Dokan Kits 3.0.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/dokan-kits\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-06-30T17:13:45+00:00\n"
     12"POT-Creation-Date: 2025-07-02T17:10:58+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    390390
    391391#: includes/Admin/Hooks.php:81
    392 #: includes/REST/Controllers/Version1/DashboardController.php:593
     392#: includes/REST/Controllers/Version1/DashboardController.php:598
    393393msgid "Settings"
    394394msgstr ""
     
    398398#: src/admin/pages/about.jsx:91
    399399#: src/admin/pages/not-found.jsx:75
    400 #: src/admin/pages/tools/index.jsx:687
     400#: src/admin/pages/tools/index.jsx:761
    401401msgid "Documentation"
    402402msgstr ""
     
    546546msgstr ""
    547547
    548 #: includes/REST/Controllers/Version1/DashboardController.php:183
     548#: includes/REST/Controllers/Controller.php:342
     549msgid "Current page of the collection."
     550msgstr ""
     551
     552#: includes/REST/Controllers/Controller.php:348
     553msgid "Maximum number of items to be returned in result set."
     554msgstr ""
     555
     556#: includes/REST/Controllers/Controller.php:355
     557msgid "Limit results to those matching a string."
     558msgstr ""
     559
     560#: includes/REST/Controllers/Controller.php:359
     561msgid "Sort collection by attribute."
     562msgstr ""
     563
     564#: includes/REST/Controllers/Controller.php:364
     565msgid "Order sort attribute ascending or descending."
     566msgstr ""
     567
     568#: includes/REST/Controllers/Controller.php:382
     569#: includes/REST/Controllers/Version1/SettingsController.php:951
     570#: includes/REST/Controllers/Version1/SettingsController.php:1003
     571msgid "Whether the request was successful."
     572msgstr ""
     573
     574#: includes/REST/Controllers/Controller.php:388
     575#: includes/REST/Controllers/Version1/SettingsController.php:957
     576#: includes/REST/Controllers/Version1/SettingsController.php:1008
     577msgid "Human-readable message describing the result."
     578msgstr ""
     579
     580#: includes/REST/Controllers/Controller.php:394
     581msgid "Response data."
     582msgstr ""
     583
     584#. translators: 1: resource type, 2: resource ID
     585#: includes/REST/Controllers/Controller.php:415
     586msgid "Invalid %1$s ID: %2$s"
     587msgstr ""
     588
     589#. translators: 1: resource type, 2: resource ID
     590#: includes/REST/Controllers/Controller.php:438
     591msgid "%1$s not found: %2$s"
     592msgstr ""
     593
     594#. translators: %s: parameter name
     595#: includes/REST/Controllers/Controller.php:460
     596msgid "Missing required parameter: %s"
     597msgstr ""
     598
     599#. translators: 1: resource type, 2: resource ID, 3: operation
     600#: includes/REST/Controllers/Controller.php:483
     601msgid "%1$s \"%2$s\" %3$s successfully."
     602msgstr ""
     603
     604#. translators: 1: resource type, 2: operation
     605#: includes/REST/Controllers/Controller.php:492
     606msgid "%1$s %2$s successfully."
     607msgstr ""
     608
     609#: includes/REST/Controllers/Version1/DashboardController.php:195
    549610msgid "Dashboard data retrieved successfully."
    550611msgstr ""
    551612
    552 #: includes/REST/Controllers/Version1/DashboardController.php:188
    553 msgid "Failed to retrieve dashboard data: "
    554 msgstr ""
    555 
    556 #: includes/REST/Controllers/Version1/DashboardController.php:210
     613#: includes/REST/Controllers/Version1/DashboardController.php:250
    557614msgid "Statistics retrieved successfully."
    558615msgstr ""
    559616
    560 #: includes/REST/Controllers/Version1/DashboardController.php:215
    561 msgid "Failed to retrieve statistics: "
    562 msgstr ""
    563 
    564 #: includes/REST/Controllers/Version1/DashboardController.php:265
     617#: includes/REST/Controllers/Version1/DashboardController.php:285
     618msgid "Invalid export format. Allowed formats: json, array"
     619msgstr ""
     620
     621#: includes/REST/Controllers/Version1/DashboardController.php:297
    565622msgid "No valid groups specified for export."
    566623msgstr ""
    567624
    568 #: includes/REST/Controllers/Version1/DashboardController.php:313
    569 #: src/admin/pages/dashboard/index.js:270
    570 msgid "Settings exported successfully."
    571 msgstr ""
    572 
    573 #: includes/REST/Controllers/Version1/DashboardController.php:319
    574 msgid "Failed to export settings: "
    575 msgstr ""
    576 
    577 #: includes/REST/Controllers/Version1/DashboardController.php:362
    578 #: includes/REST/Controllers/Version1/SettingsController.php:243
    579 msgid "No settings data provided."
    580 msgstr ""
    581 
    582 #: includes/REST/Controllers/Version1/DashboardController.php:371
     625#. translators: %d: Number of settings exported
     626#: includes/REST/Controllers/Version1/DashboardController.php:332
     627msgid "%d setting exported successfully."
     628msgid_plural "%d settings exported successfully."
     629msgstr[0] ""
     630msgstr[1] ""
     631
     632#: includes/REST/Controllers/Version1/DashboardController.php:378
    583633msgid "Too many settings provided. Maximum 100 settings allowed."
    584634msgstr ""
    585635
    586 #: includes/REST/Controllers/Version1/DashboardController.php:385
    587 #: includes/REST/Controllers/Version1/SettingsController.php:339
    588 msgid "Invalid setting name."
    589 msgstr ""
    590 
    591 #: includes/REST/Controllers/Version1/DashboardController.php:432
     636#: includes/REST/Controllers/Version1/DashboardController.php:413
     637msgid "All settings failed to import."
     638msgstr ""
     639
     640#: includes/REST/Controllers/Version1/DashboardController.php:423
    592641msgid "Some settings failed to import."
    593642msgstr ""
    594643
    595644#. translators: %d: Number of settings imported
    596 #: includes/REST/Controllers/Version1/DashboardController.php:450
     645#: includes/REST/Controllers/Version1/DashboardController.php:435
    597646msgid "%d setting imported successfully."
    598647msgid_plural "%d settings imported successfully."
     
    600649msgstr[1] ""
    601650
    602 #: includes/REST/Controllers/Version1/DashboardController.php:463
    603 msgid "Failed to import settings: "
    604 msgstr ""
    605 
    606 #: includes/REST/Controllers/Version1/DashboardController.php:507
     651#: includes/REST/Controllers/Version1/DashboardController.php:476
    607652msgid "Please confirm that you want to reset the settings."
    608653msgstr ""
    609654
    610 #: includes/REST/Controllers/Version1/DashboardController.php:517
     655#. translators: %s: allowed scopes
     656#: includes/REST/Controllers/Version1/DashboardController.php:488
     657msgid "Invalid scope. Allowed scopes: %s"
     658msgstr ""
     659
     660#: includes/REST/Controllers/Version1/DashboardController.php:584
     661msgid "Active Features"
     662msgstr ""
     663
     664#: includes/REST/Controllers/Version1/DashboardController.php:585
     665msgid "Number of enabled features"
     666msgstr ""
     667
     668#: includes/REST/Controllers/Version1/DashboardController.php:591
     669#: src/admin/pages/dashboard/index.js:308
     670msgid "Total Features"
     671msgstr ""
     672
     673#: includes/REST/Controllers/Version1/DashboardController.php:592
     674msgid "Total available features"
     675msgstr ""
     676
     677#: includes/REST/Controllers/Version1/DashboardController.php:599
     678msgid "Number of configured settings"
     679msgstr ""
     680
     681#: includes/REST/Controllers/Version1/DashboardController.php:604
     682msgid "Not installed"
     683msgstr ""
     684
     685#: includes/REST/Controllers/Version1/DashboardController.php:605
     686#: src/admin/pages/dashboard/index.js:332
     687msgid "Dokan Version"
     688msgstr ""
     689
     690#: includes/REST/Controllers/Version1/DashboardController.php:606
     691msgid "Installed Dokan version"
     692msgstr ""
     693
     694#: includes/REST/Controllers/Version1/DashboardController.php:639
     695#: src/admin/pages/dashboard/index.js:296
     696msgid "Enhance your Dokan-powered marketplace with powerful tools and customizations."
     697msgstr ""
     698
     699#: includes/REST/Controllers/Version1/DashboardController.php:718
     700#: includes/REST/Controllers/Version1/SettingsController.php:604
     701msgid "Invalid setting name."
     702msgstr ""
     703
     704#: includes/REST/Controllers/Version1/DashboardController.php:772
    611705msgid "All settings have been reset to defaults."
    612706msgstr ""
    613707
    614708#. translators: %s: settings group name
    615 #: includes/REST/Controllers/Version1/DashboardController.php:521
     709#: includes/REST/Controllers/Version1/DashboardController.php:776
    616710msgid "%s settings have been reset to defaults."
    617711msgstr ""
    618712
    619 #: includes/REST/Controllers/Version1/DashboardController.php:545
    620 msgid "Failed to reset settings: "
    621 msgstr ""
    622 
    623 #: includes/REST/Controllers/Version1/DashboardController.php:579
    624 msgid "Active Features"
    625 msgstr ""
    626 
    627 #: includes/REST/Controllers/Version1/DashboardController.php:580
    628 msgid "Number of enabled features"
    629 msgstr ""
    630 
    631 #: includes/REST/Controllers/Version1/DashboardController.php:586
    632 #: src/admin/pages/dashboard/index.js:313
    633 msgid "Total Features"
    634 msgstr ""
    635 
    636 #: includes/REST/Controllers/Version1/DashboardController.php:587
    637 msgid "Total available features"
    638 msgstr ""
    639 
    640 #: includes/REST/Controllers/Version1/DashboardController.php:594
    641 msgid "Number of configured settings"
    642 msgstr ""
    643 
    644 #: includes/REST/Controllers/Version1/DashboardController.php:599
    645 msgid "Not installed"
    646 msgstr ""
    647 
    648 #: includes/REST/Controllers/Version1/DashboardController.php:600
    649 #: src/admin/pages/dashboard/index.js:337
    650 msgid "Dokan Version"
    651 msgstr ""
    652 
    653 #: includes/REST/Controllers/Version1/DashboardController.php:601
    654 msgid "Installed Dokan version"
    655 msgstr ""
    656 
    657 #: includes/REST/Controllers/Version1/DashboardController.php:629
    658 #: src/admin/pages/dashboard/index.js:301
    659 msgid "Enhance your Dokan-powered marketplace with powerful tools and customizations."
    660 msgstr ""
    661 
    662 #: includes/REST/Controllers/Version1/DashboardController.php:655
     713#: includes/REST/Controllers/Version1/DashboardController.php:796
    663714msgid "Include statistics in response."
    664715msgstr ""
    665716
    666 #: includes/REST/Controllers/Version1/DashboardController.php:660
     717#: includes/REST/Controllers/Version1/DashboardController.php:801
    667718msgid "Include plugin data in response."
    668719msgstr ""
    669720
    670 #: includes/REST/Controllers/Version1/DashboardController.php:677
     721#: includes/REST/Controllers/Version1/DashboardController.php:818
    671722msgid "Force refresh of cached statistics."
    672723msgstr ""
    673724
    674 #: includes/REST/Controllers/Version1/DashboardController.php:696
     725#: includes/REST/Controllers/Version1/DashboardController.php:837
    675726msgid "Export format."
    676727msgstr ""
    677728
    678 #: includes/REST/Controllers/Version1/DashboardController.php:702
     729#: includes/REST/Controllers/Version1/DashboardController.php:843
    679730msgid "Settings groups to export."
    680731msgstr ""
    681732
    682 #: includes/REST/Controllers/Version1/DashboardController.php:723
    683 msgid "Settings data to import."
    684 msgstr ""
    685 
    686 #: includes/REST/Controllers/Version1/DashboardController.php:728
     733#: includes/REST/Controllers/Version1/DashboardController.php:864
     734msgid "Settings data to import as key-value pairs."
     735msgstr ""
     736
     737#: includes/REST/Controllers/Version1/DashboardController.php:874
    687738msgid "Whether to overwrite existing settings."
    688739msgstr ""
    689740
    690 #: includes/REST/Controllers/Version1/DashboardController.php:745
     741#: includes/REST/Controllers/Version1/DashboardController.php:891
    691742msgid "Scope of settings to reset."
    692743msgstr ""
    693744
    694 #: includes/REST/Controllers/Version1/DashboardController.php:751
     745#: includes/REST/Controllers/Version1/DashboardController.php:897
    695746msgid "Confirmation that you want to reset the settings."
    696747msgstr ""
    697748
    698 #: includes/REST/Controllers/Version1/DashboardController.php:776
    699 #: includes/REST/Controllers/Version1/DashboardController.php:838
    700 #: includes/REST/Controllers/Version1/DashboardController.php:867
    701749#: includes/REST/Controllers/Version1/DashboardController.php:920
     750msgid "Dashboard data."
     751msgstr ""
     752
     753#: includes/REST/Controllers/Version1/DashboardController.php:924
     754msgid "Number of configured settings."
     755msgstr ""
     756
     757#: includes/REST/Controllers/Version1/DashboardController.php:929
     758msgid "Last updated timestamp."
     759msgstr ""
     760
     761#: includes/REST/Controllers/Version1/DashboardController.php:934
     762msgid "Dashboard statistics."
     763msgstr ""
     764
     765#: includes/REST/Controllers/Version1/DashboardController.php:938
     766msgid "Plugin information."
     767msgstr ""
     768
    702769#: includes/REST/Controllers/Version1/DashboardController.php:964
    703 #: includes/REST/Controllers/Version1/SettingsController.php:543
    704 #: includes/REST/Controllers/Version1/ToolsController.php:735
    705 #: includes/REST/Controllers/Version1/ToolsController.php:774
    706 #: includes/REST/Controllers/Version1/ToolsController.php:830
    707 #: includes/REST/Controllers/Version1/ToolsController.php:870
    708 #: includes/REST/Controllers/Version1/ToolsController.php:934
    709 msgid "Status of the operation."
    710 msgstr ""
    711 
    712 #: includes/REST/Controllers/Version1/DashboardController.php:782
    713 #: includes/REST/Controllers/Version1/SettingsController.php:549
    714 #: includes/REST/Controllers/Version1/ToolsController.php:741
    715 msgid "Message describing the result of the operation."
    716 msgstr ""
    717 
    718 #: includes/REST/Controllers/Version1/DashboardController.php:788
    719 msgid "Dashboard data."
    720 msgstr ""
    721 
    722 #: includes/REST/Controllers/Version1/DashboardController.php:794
    723 msgid "Number of configured settings."
    724 msgstr ""
    725 
    726 #: includes/REST/Controllers/Version1/DashboardController.php:798
    727 msgid "Last updated timestamp."
    728 msgstr ""
    729 
    730 #: includes/REST/Controllers/Version1/DashboardController.php:803
    731 msgid "Dashboard statistics."
    732 msgstr ""
    733 
    734 #: includes/REST/Controllers/Version1/DashboardController.php:807
    735 msgid "Plugin information."
    736 msgstr ""
    737 
    738 #: includes/REST/Controllers/Version1/DashboardController.php:811
    739 msgid "Features information."
    740 msgstr ""
    741 
    742 #: includes/REST/Controllers/Version1/DashboardController.php:842
    743 #: includes/REST/Controllers/Version1/DashboardController.php:871
    744 #: includes/REST/Controllers/Version1/DashboardController.php:924
    745 #: includes/REST/Controllers/Version1/DashboardController.php:968
    746 #: includes/REST/Controllers/Version1/ToolsController.php:778
    747 #: includes/REST/Controllers/Version1/ToolsController.php:834
    748 #: includes/REST/Controllers/Version1/ToolsController.php:874
    749 #: includes/REST/Controllers/Version1/ToolsController.php:938
    750 msgid "Message describing the result."
    751 msgstr ""
    752 
    753 #: includes/REST/Controllers/Version1/DashboardController.php:846
    754 msgid "Statistics data."
    755 msgstr ""
    756 
    757 #: includes/REST/Controllers/Version1/DashboardController.php:875
     770msgid "Statistics data with metrics and their metadata."
     771msgstr ""
     772
     773#: includes/REST/Controllers/Version1/DashboardController.php:970
     774msgid "Statistic value."
     775msgstr ""
     776
     777#: includes/REST/Controllers/Version1/DashboardController.php:974
     778msgid "Human-readable label."
     779msgstr ""
     780
     781#: includes/REST/Controllers/Version1/DashboardController.php:978
     782msgid "Detailed description."
     783msgstr ""
     784
     785#: includes/REST/Controllers/Version1/DashboardController.php:982
     786msgid "Icon class or identifier."
     787msgstr ""
     788
     789#: includes/REST/Controllers/Version1/DashboardController.php:986
     790msgid "Color theme or class."
     791msgstr ""
     792
     793#: includes/REST/Controllers/Version1/DashboardController.php:1013
    758794msgid "Export data."
    759795msgstr ""
    760796
    761 #: includes/REST/Controllers/Version1/DashboardController.php:879
     797#: includes/REST/Controllers/Version1/DashboardController.php:1017
    762798msgid "Exported settings data."
    763799msgstr ""
    764800
    765 #: includes/REST/Controllers/Version1/DashboardController.php:883
     801#: includes/REST/Controllers/Version1/DashboardController.php:1021
    766802msgid "Export format used."
    767803msgstr ""
    768804
    769 #: includes/REST/Controllers/Version1/DashboardController.php:887
     805#: includes/REST/Controllers/Version1/DashboardController.php:1026
    770806msgid "Settings groups exported."
    771807msgstr ""
    772808
    773 #: includes/REST/Controllers/Version1/DashboardController.php:892
     809#: includes/REST/Controllers/Version1/DashboardController.php:1031
    774810msgid "Number of exported settings."
    775811msgstr ""
    776812
    777 #: includes/REST/Controllers/Version1/DashboardController.php:896
     813#: includes/REST/Controllers/Version1/DashboardController.php:1036
    778814msgid "Export timestamp."
    779815msgstr ""
    780816
    781 #: includes/REST/Controllers/Version1/DashboardController.php:928
    782 msgid "Import data."
    783 msgstr ""
    784 
    785 #: includes/REST/Controllers/Version1/DashboardController.php:932
    786 msgid "List of imported settings."
    787 msgstr ""
    788 
    789 #: includes/REST/Controllers/Version1/DashboardController.php:937
    790 msgid "Total number of imported settings."
    791 msgstr ""
    792 
    793 #: includes/REST/Controllers/Version1/DashboardController.php:941
     817#: includes/REST/Controllers/Version1/DashboardController.php:1063
     818msgid "Import result data."
     819msgstr ""
     820
     821#: includes/REST/Controllers/Version1/DashboardController.php:1067
     822msgid "List of successfully imported settings."
     823msgstr ""
     824
     825#: includes/REST/Controllers/Version1/DashboardController.php:1072
     826msgid "Import errors by setting name."
     827msgstr ""
     828
     829#: includes/REST/Controllers/Version1/DashboardController.php:1077
     830msgid "Total number of successfully imported settings."
     831msgstr ""
     832
     833#: includes/REST/Controllers/Version1/DashboardController.php:1082
    794834msgid "Whether existing settings were overwritten."
    795835msgstr ""
    796836
    797 #: includes/REST/Controllers/Version1/DashboardController.php:972
    798 msgid "Reset data."
    799 msgstr ""
    800 
    801 #: includes/REST/Controllers/Version1/DashboardController.php:976
     837#: includes/REST/Controllers/Version1/DashboardController.php:1108
     838msgid "Reset operation result."
     839msgstr ""
     840
     841#: includes/REST/Controllers/Version1/DashboardController.php:1112
    802842msgid "Scope of settings that were reset."
    803843msgstr ""
    804844
    805 #: includes/REST/Controllers/Version1/DashboardController.php:980
    806 msgid "Reset timestamp."
    807 msgstr ""
    808 
    809 #: includes/REST/Controllers/Version1/SettingsController.php:143
    810 msgid "Settings retrieved successfully."
    811 msgstr ""
    812 
    813 #: includes/REST/Controllers/Version1/SettingsController.php:149
    814 msgid "Failed to retrieve settings: "
    815 msgstr ""
    816 
    817 #: includes/REST/Controllers/Version1/SettingsController.php:170
    818 msgid "Setting name is required."
     845#: includes/REST/Controllers/Version1/DashboardController.php:1117
     846msgid "Detailed reset result message."
     847msgstr ""
     848
     849#: includes/REST/Controllers/Version1/DashboardController.php:1121
     850msgid "Reset operation timestamp."
     851msgstr ""
     852
     853#. translators: %d: Number of settings retrieved
     854#: includes/REST/Controllers/Version1/SettingsController.php:156
     855msgid "%d setting retrieved successfully."
     856msgid_plural "%d settings retrieved successfully."
     857msgstr[0] ""
     858msgstr[1] ""
     859
     860#: includes/REST/Controllers/Version1/SettingsController.php:186
     861#: includes/REST/Controllers/Version1/SettingsController.php:394
     862msgid "Setting name is required and must be valid."
    819863msgstr ""
    820864
    821865#. translators: %s: setting name
    822 #: includes/REST/Controllers/Version1/SettingsController.php:183
     866#: includes/REST/Controllers/Version1/SettingsController.php:215
    823867msgid "Setting \"%s\" not found."
    824868msgstr ""
    825869
    826 #: includes/REST/Controllers/Version1/SettingsController.php:193
    827 msgid "Setting retrieved successfully."
    828 msgstr ""
    829 
    830 #: includes/REST/Controllers/Version1/SettingsController.php:198
    831 msgid "Failed to retrieve setting: "
    832 msgstr ""
    833 
    834 #: includes/REST/Controllers/Version1/SettingsController.php:232
    835 msgid "Invalid JSON data provided."
    836 msgstr ""
    837 
     870#. translators: %s: setting name
    838871#: includes/REST/Controllers/Version1/SettingsController.php:252
    839 msgid "Too many settings provided. Maximum 100 settings per request."
    840 msgstr ""
    841 
    842 #: includes/REST/Controllers/Version1/SettingsController.php:288
     872msgid "Setting \"%s\" retrieved successfully."
     873msgstr ""
     874
     875#: includes/REST/Controllers/Version1/SettingsController.php:287
     876msgid "No settings data provided."
     877msgstr ""
     878
     879#: includes/REST/Controllers/Version1/SettingsController.php:341
     880msgid "All settings failed to update."
     881msgstr ""
     882
     883#: includes/REST/Controllers/Version1/SettingsController.php:351
    843884msgid "Some settings failed to update."
    844885msgstr ""
    845886
    846887#. translators: %d: Number of settings updated
    847 #: includes/REST/Controllers/Version1/SettingsController.php:305
     888#: includes/REST/Controllers/Version1/SettingsController.php:363
    848889msgid "%d setting updated successfully."
    849890msgid_plural "%d settings updated successfully."
     
    851892msgstr[1] ""
    852893
    853 #: includes/REST/Controllers/Version1/SettingsController.php:318
    854 msgid "Failed to update settings: "
    855 msgstr ""
    856 
    857 #: includes/REST/Controllers/Version1/SettingsController.php:349
     894#: includes/REST/Controllers/Version1/SettingsController.php:422
     895msgid "Failed to retrieve updated setting."
     896msgstr ""
     897
     898#. translators: %s: setting name
     899#: includes/REST/Controllers/Version1/SettingsController.php:455
     900msgid "Setting \"%s\" updated successfully."
     901msgstr ""
     902
     903#: includes/REST/Controllers/Version1/SettingsController.php:637
     904msgid "Failed to update setting."
     905msgstr ""
     906
     907#. translators: 1: group name, 2: allowed groups
     908#: includes/REST/Controllers/Version1/SettingsController.php:691
     909msgid "Invalid group \"%1$s\". Allowed groups: %2$s"
     910msgstr ""
     911
     912#. translators: %s: setting name
     913#: includes/REST/Controllers/Version1/SettingsController.php:715
     914msgid "Access denied for setting \"%s\"."
     915msgstr ""
     916
     917#: includes/REST/Controllers/Version1/SettingsController.php:740
    858918msgid "Invalid setting name format. Expected: group.section.option"
    859919msgstr ""
    860920
    861 #. translators: %1$s: group name, %2$s: allowed groups
    862 #: includes/REST/Controllers/Version1/SettingsController.php:368
    863 msgid "Invalid group \"%1$s\". Allowed groups: %2$s"
    864 msgstr ""
    865 
    866 #: includes/REST/Controllers/Version1/SettingsController.php:385
    867 msgid "Failed to update setting."
    868 msgstr ""
    869 
    870 #: includes/REST/Controllers/Version1/SettingsController.php:470
     921#: includes/REST/Controllers/Version1/SettingsController.php:802
     922msgid "Invalid JSON data provided."
     923msgstr ""
     924
     925#. translators: %s: context
     926#: includes/REST/Controllers/Version1/SettingsController.php:812
     927msgid "Failed to %s: An unexpected error occurred."
     928msgstr ""
     929
     930#: includes/REST/Controllers/Version1/SettingsController.php:832
    871931msgid "Order by field."
    872932msgstr ""
    873933
    874 #: includes/REST/Controllers/Version1/SettingsController.php:476
     934#: includes/REST/Controllers/Version1/SettingsController.php:838
    875935msgid "Order direction."
    876936msgstr ""
    877937
    878 #: includes/REST/Controllers/Version1/SettingsController.php:482
     938#: includes/REST/Controllers/Version1/SettingsController.php:844
    879939msgid "Number of items to fetch."
    880940msgstr ""
    881941
    882 #: includes/REST/Controllers/Version1/SettingsController.php:488
     942#: includes/REST/Controllers/Version1/SettingsController.php:850
    883943msgid "Number of items to skip."
    884944msgstr ""
    885945
    886 #: includes/REST/Controllers/Version1/SettingsController.php:494
     946#: includes/REST/Controllers/Version1/SettingsController.php:856
    887947msgid "Filter settings by group."
    888948msgstr ""
    889949
    890 #: includes/REST/Controllers/Version1/SettingsController.php:502
     950#: includes/REST/Controllers/Version1/SettingsController.php:864
    891951msgid "Search settings by name."
    892952msgstr ""
    893953
    894 #: includes/REST/Controllers/Version1/SettingsController.php:518
    895 msgid "Settings data to update."
    896 msgstr ""
    897 
    898 #: includes/REST/Controllers/Version1/SettingsController.php:555
    899 msgid "Settings data."
    900 msgstr ""
    901 
    902 #: includes/REST/Controllers/Version1/SettingsController.php:561
    903 msgid "Settings collection."
    904 msgstr ""
    905 
    906 #: includes/REST/Controllers/Version1/SettingsController.php:565
    907 msgid "Number of settings."
    908 msgstr ""
    909 
    910 #: includes/REST/Controllers/Version1/ToolsController.php:177
    911 msgid "Database tables recreated successfully."
    912 msgstr ""
    913 
    914 #: includes/REST/Controllers/Version1/ToolsController.php:180
    915 msgid "Failed to recreate database tables: "
    916 msgstr ""
    917 
    918 #: includes/REST/Controllers/Version1/ToolsController.php:219
    919 msgid "Not all tables could be optimized."
    920 msgstr ""
    921 
    922 #: includes/REST/Controllers/Version1/ToolsController.php:228
    923 msgid "Database tables optimized successfully."
    924 msgstr ""
    925 
     954#: includes/REST/Controllers/Version1/SettingsController.php:880
     955msgid "Setting name in format: group.section.option"
     956msgstr ""
     957
     958#: includes/REST/Controllers/Version1/SettingsController.php:926
     959msgid "Setting value to update."
     960msgstr ""
     961
     962#: includes/REST/Controllers/Version1/SettingsController.php:963
     963msgid "Settings collection data."
     964msgstr ""
     965
     966#: includes/REST/Controllers/Version1/SettingsController.php:968
     967msgid "Settings as key-value pairs."
     968msgstr ""
     969
     970#: includes/REST/Controllers/Version1/SettingsController.php:975
     971msgid "Number of settings in the collection."
     972msgstr ""
     973
     974#: includes/REST/Controllers/Version1/SettingsController.php:1013
     975msgid "Single setting data."
     976msgstr ""
     977
     978#: includes/REST/Controllers/Version1/SettingsController.php:1017
     979msgid "Setting name."
     980msgstr ""
     981
     982#: includes/REST/Controllers/Version1/SettingsController.php:1022
     983msgid "Setting value."
     984msgstr ""
     985
     986#. translators: %d: Number of tables recreated
     987#: includes/REST/Controllers/Version1/ToolsController.php:171
     988msgid "%d database table recreated successfully."
     989msgid_plural "%d database tables recreated successfully."
     990msgstr[0] ""
     991msgstr[1] ""
     992
     993#: includes/REST/Controllers/Version1/ToolsController.php:220
     994msgid "Some tables could not be optimized."
     995msgstr ""
     996
     997#. translators: %d: Number of tables optimized
    926998#: includes/REST/Controllers/Version1/ToolsController.php:231
    927 msgid "Failed to optimize database tables: "
    928 msgstr ""
    929 
    930 #: includes/REST/Controllers/Version1/ToolsController.php:250
     999msgid "%d database table optimized successfully."
     1000msgid_plural "%d database tables optimized successfully."
     1001msgstr[0] ""
     1002msgstr[1] ""
     1003
     1004#: includes/REST/Controllers/Version1/ToolsController.php:270
    9311005msgid "A migration is already in progress."
    9321006msgstr ""
    9331007
    934 #: includes/REST/Controllers/Version1/ToolsController.php:271
    935 msgid "Migrations completed successfully."
    936 msgstr ""
    937 
    938 #: includes/REST/Controllers/Version1/ToolsController.php:275
    939 msgid "Migration failed: "
    940 msgstr ""
    941 
    942 #: includes/REST/Controllers/Version1/ToolsController.php:296
     1008#. translators: %d: Number of migration versions executed
     1009#: includes/REST/Controllers/Version1/ToolsController.php:292
     1010msgid "%d migration version executed successfully."
     1011msgid_plural "%d migration versions executed successfully."
     1012msgstr[0] ""
     1013msgstr[1] ""
     1014
     1015#: includes/REST/Controllers/Version1/ToolsController.php:351
     1016msgid "Migration status retrieved successfully."
     1017msgstr ""
     1018
     1019#: includes/REST/Controllers/Version1/ToolsController.php:403
     1020msgid "System diagnostics completed successfully."
     1021msgstr ""
     1022
     1023#: includes/REST/Controllers/Version1/ToolsController.php:459
     1024msgid "Log files prepared for download successfully."
     1025msgstr ""
     1026
     1027#: includes/REST/Controllers/Version1/ToolsController.php:538
     1028msgid "Failed to repair or optimize table."
     1029msgstr ""
     1030
     1031#: includes/REST/Controllers/Version1/ToolsController.php:667
     1032msgid "Dokan plugin is not installed or active."
     1033msgstr ""
     1034
     1035#: includes/REST/Controllers/Version1/ToolsController.php:681
     1036msgid "WooCommerce is not installed or active."
     1037msgstr ""
     1038
     1039#: includes/REST/Controllers/Version1/ToolsController.php:689
    9431040msgid "System requirements met."
    9441041msgstr ""
    9451042
    946 #: includes/REST/Controllers/Version1/ToolsController.php:296
     1043#: includes/REST/Controllers/Version1/ToolsController.php:689
    9471044msgid "System requirements not met."
    9481045msgstr ""
    9491046
    950 #: includes/REST/Controllers/Version1/ToolsController.php:310
    951 msgid "System diagnostics completed."
    952 msgstr ""
    953 
    954 #: includes/REST/Controllers/Version1/ToolsController.php:314
    955 msgid "System diagnostics failed: "
    956 msgstr ""
    957 
    958 #: includes/REST/Controllers/Version1/ToolsController.php:348
    959 msgid "Log files prepared for download."
    960 msgstr ""
    961 
    962 #: includes/REST/Controllers/Version1/ToolsController.php:352
    963 msgid "Failed to prepare log files: "
    964 msgstr ""
    965 
    966 #: includes/REST/Controllers/Version1/ToolsController.php:392
    967 msgid "Migration status retrieved successfully."
    968 msgstr ""
    969 
    970 #: includes/REST/Controllers/Version1/ToolsController.php:396
    971 msgid "Failed to retrieve migration status: "
    972 msgstr ""
    973 
    974 #: includes/REST/Controllers/Version1/ToolsController.php:488
    975 msgid "Dokan plugin is not installed or active."
    976 msgstr ""
    977 
    978 #: includes/REST/Controllers/Version1/ToolsController.php:502
    979 msgid "WooCommerce is not installed or active."
    980 msgstr ""
    981 
    982 #: includes/REST/Controllers/Version1/ToolsController.php:544
     1047#: includes/REST/Controllers/Version1/ToolsController.php:757
    9831048msgid "Table does not exist"
    9841049msgstr ""
    9851050
    986 #: includes/REST/Controllers/Version1/ToolsController.php:567
     1051#: includes/REST/Controllers/Version1/ToolsController.php:780
    9871052msgid "Could not create log directory."
    9881053msgstr ""
    9891054
    990 #: includes/REST/Controllers/Version1/ToolsController.php:592
     1055#: includes/REST/Controllers/Version1/ToolsController.php:805
    9911056msgid "Could not write to log file."
    9921057msgstr ""
    9931058
    994 #: includes/REST/Controllers/Version1/ToolsController.php:747
    995 msgid "Additional data related to the operation."
    996 msgstr ""
    997 
    998 #: includes/REST/Controllers/Version1/ToolsController.php:782
    999 msgid "Migration status data."
    1000 msgstr ""
    1001 
    1002 #: includes/REST/Controllers/Version1/ToolsController.php:786
     1059#: includes/REST/Controllers/Version1/ToolsController.php:946
     1060msgid "Database operation result."
     1061msgstr ""
     1062
     1063#: includes/REST/Controllers/Version1/ToolsController.php:950
     1064msgid "List of successfully processed tables."
     1065msgstr ""
     1066
     1067#: includes/REST/Controllers/Version1/ToolsController.php:955
     1068msgid "Failed operations by table name."
     1069msgstr ""
     1070
     1071#: includes/REST/Controllers/Version1/ToolsController.php:960
     1072msgid "Total number of successfully processed tables."
     1073msgstr ""
     1074
     1075#: includes/REST/Controllers/Version1/ToolsController.php:987
     1076msgid "Migration operation result."
     1077msgstr ""
     1078
     1079#: includes/REST/Controllers/Version1/ToolsController.php:991
     1080msgid "List of executed migration versions."
     1081msgstr ""
     1082
     1083#: includes/REST/Controllers/Version1/ToolsController.php:996
     1084msgid "Total number of executed migrations."
     1085msgstr ""
     1086
     1087#: includes/REST/Controllers/Version1/ToolsController.php:1001
     1088msgid "Migration execution timestamp."
     1089msgstr ""
     1090
     1091#: includes/REST/Controllers/Version1/ToolsController.php:1028
     1092msgid "Migration status information."
     1093msgstr ""
     1094
     1095#: includes/REST/Controllers/Version1/ToolsController.php:1032
    10031096msgid "Whether migration is currently running."
    10041097msgstr ""
    10051098
    1006 #: includes/REST/Controllers/Version1/ToolsController.php:790
     1099#: includes/REST/Controllers/Version1/ToolsController.php:1036
    10071100msgid "Whether migration is needed."
    10081101msgstr ""
    10091102
    1010 #: includes/REST/Controllers/Version1/ToolsController.php:794
     1103#: includes/REST/Controllers/Version1/ToolsController.php:1040
    10111104msgid "Current plugin version."
    10121105msgstr ""
    10131106
    1014 #: includes/REST/Controllers/Version1/ToolsController.php:798
    1015 msgid "Migration history."
    1016 msgstr ""
    1017 
    1018 #: includes/REST/Controllers/Version1/ToolsController.php:802
     1107#: includes/REST/Controllers/Version1/ToolsController.php:1044
     1108msgid "Historical migration data."
     1109msgstr ""
     1110
     1111#: includes/REST/Controllers/Version1/ToolsController.php:1048
    10191112msgid "Available migration versions."
    10201113msgstr ""
    10211114
    1022 #: includes/REST/Controllers/Version1/ToolsController.php:806
    1023 msgid "Last check timestamp."
    1024 msgstr ""
    1025 
    1026 #: includes/REST/Controllers/Version1/ToolsController.php:838
    1027 msgid "Diagnostics data."
    1028 msgstr ""
    1029 
    1030 #: includes/REST/Controllers/Version1/ToolsController.php:842
    1031 msgid "System diagnostic results."
    1032 msgstr ""
    1033 
    1034 #: includes/REST/Controllers/Version1/ToolsController.php:846
    1035 msgid "Diagnostics timestamp."
    1036 msgstr ""
    1037 
    1038 #: includes/REST/Controllers/Version1/ToolsController.php:878
    1039 msgid "System status data."
    1040 msgstr ""
    1041 
    1042 #: includes/REST/Controllers/Version1/ToolsController.php:882
    1043 msgid "System check result."
    1044 msgstr ""
    1045 
    1046 #: includes/REST/Controllers/Version1/ToolsController.php:886
    1047 msgid "Plugin version."
    1048 msgstr ""
    1049 
    1050 #: includes/REST/Controllers/Version1/ToolsController.php:890
    1051 msgid "WordPress version."
    1052 msgstr ""
    1053 
    1054 #: includes/REST/Controllers/Version1/ToolsController.php:894
    1055 msgid "PHP version."
    1056 msgstr ""
    1057 
    1058 #: includes/REST/Controllers/Version1/ToolsController.php:898
    1059 msgid "Database tables status."
    1060 msgstr ""
    1061 
    1062 #: includes/REST/Controllers/Version1/ToolsController.php:902
    1063 msgid "Whether Dokan is active."
    1064 msgstr ""
    1065 
    1066 #: includes/REST/Controllers/Version1/ToolsController.php:906
    1067 msgid "Whether WooCommerce is active."
    1068 msgstr ""
    1069 
    1070 #: includes/REST/Controllers/Version1/ToolsController.php:910
    1071 msgid "Status check timestamp."
    1072 msgstr ""
    1073 
    1074 #: includes/REST/Controllers/Version1/ToolsController.php:942
    1075 msgid "Log file data."
    1076 msgstr ""
    1077 
    1078 #: includes/REST/Controllers/Version1/ToolsController.php:946
    1079 msgid "Log file name."
    1080 msgstr ""
    1081 
    1082 #: includes/REST/Controllers/Version1/ToolsController.php:950
    1083 msgid "Log file URL."
    1084 msgstr ""
    1085 
    1086 #: includes/REST/Controllers/Version1/ToolsController.php:955
    1087 msgid "Log file path."
    1088 msgstr ""
    1089 
    1090 #: includes/REST/Controllers/Version1/ToolsController.php:959
    1091 msgid "Log file size."
    1092 msgstr ""
    1093 
    1094 #: includes/REST/Controllers/Version1/ToolsController.php:963
    1095 msgid "File creation date."
    1096 msgstr ""
    1097 
    1098 #: includes/REST/Controllers/Version1/ToolsController.php:967
    1099 msgid "Creation timestamp."
     1115#: includes/REST/Controllers/Version1/ToolsController.php:1053
     1116msgid "Last status check timestamp."
     1117msgstr ""
     1118
     1119#: includes/REST/Controllers/Version1/ToolsController.php:1080
     1120msgid "System diagnostics information."
     1121msgstr ""
     1122
     1123#: includes/REST/Controllers/Version1/ToolsController.php:1084
     1124msgid "WordPress environment information."
     1125msgstr ""
     1126
     1127#: includes/REST/Controllers/Version1/ToolsController.php:1088
     1128msgid "PHP environment information."
     1129msgstr ""
     1130
     1131#: includes/REST/Controllers/Version1/ToolsController.php:1092
     1132msgid "Server environment information."
     1133msgstr ""
     1134
     1135#: includes/REST/Controllers/Version1/ToolsController.php:1096
     1136msgid "Dokan Kits specific information."
     1137msgstr ""
     1138
     1139#: includes/REST/Controllers/Version1/ToolsController.php:1100
     1140msgid "Dokan plugin information."
     1141msgstr ""
     1142
     1143#: includes/REST/Controllers/Version1/ToolsController.php:1104
     1144msgid "WooCommerce information."
     1145msgstr ""
     1146
     1147#: includes/REST/Controllers/Version1/ToolsController.php:1108
     1148msgid "System requirements check result."
     1149msgstr ""
     1150
     1151#: includes/REST/Controllers/Version1/ToolsController.php:1112
     1152msgid "Whether system check passed."
     1153msgstr ""
     1154
     1155#: includes/REST/Controllers/Version1/ToolsController.php:1116
     1156msgid "System check message."
     1157msgstr ""
     1158
     1159#: includes/REST/Controllers/Version1/ToolsController.php:1144
     1160msgid "Log file information."
     1161msgstr ""
     1162
     1163#: includes/REST/Controllers/Version1/ToolsController.php:1148
     1164msgid "Generated log file name."
     1165msgstr ""
     1166
     1167#: includes/REST/Controllers/Version1/ToolsController.php:1152
     1168msgid "URL to download the log file."
     1169msgstr ""
     1170
     1171#: includes/REST/Controllers/Version1/ToolsController.php:1157
     1172msgid "Server path to the log file."
     1173msgstr ""
     1174
     1175#: includes/REST/Controllers/Version1/ToolsController.php:1161
     1176msgid "Human-readable file size."
     1177msgstr ""
     1178
     1179#: includes/REST/Controllers/Version1/ToolsController.php:1165
     1180msgid "File creation date identifier."
     1181msgstr ""
     1182
     1183#: includes/REST/Controllers/Version1/ToolsController.php:1169
     1184msgid "File creation timestamp."
    11001185msgstr ""
    11011186
     
    13211406
    13221407#: src/admin/components/common/error-boundary.jsx:175
    1323 #: src/admin/pages/dashboard/index.js:447
    1324 #: src/admin/pages/tools/index.jsx:665
     1408#: src/admin/pages/dashboard/index.js:442
     1409#: src/admin/pages/tools/index.jsx:739
    13251410msgid "Need Help?"
    13261411msgstr ""
     
    13311416
    13321417#: src/admin/components/common/error-boundary.jsx:188
    1333 #: src/admin/pages/dashboard/index.js:456
    1334 #: src/admin/pages/tools/index.jsx:678
     1418#: src/admin/pages/dashboard/index.js:451
     1419#: src/admin/pages/tools/index.jsx:752
    13351420msgid "Get Support"
    13361421msgstr ""
     
    19282013
    19292014#: src/admin/pages/about.jsx:149
    1930 #: src/admin/pages/dashboard/index.js:298
     2015#: src/admin/pages/dashboard/index.js:293
    19312016msgid "Welcome to Dokan Kits"
    19322017msgstr ""
     
    19892074msgstr ""
    19902075
    1991 #: src/admin/pages/dashboard/index.js:57
     2076#: src/admin/pages/dashboard/index.js:55
    19922077msgid "Invalid response from the server"
    19932078msgstr ""
    19942079
    1995 #: src/admin/pages/dashboard/index.js:66
    1996 #: src/admin/pages/dashboard/index.js:149
     2080#: src/admin/pages/dashboard/index.js:64
     2081#: src/admin/pages/dashboard/index.js:146
     2082#: src/admin/pages/dashboard/index.js:216
     2083msgid "Not Detected"
     2084msgstr ""
     2085
     2086#: src/admin/pages/dashboard/index.js:69
     2087msgid "Failed to fetch dashboard data"
     2088msgstr ""
     2089
     2090#: src/admin/pages/dashboard/index.js:105
     2091msgid "Please select a file to import."
     2092msgstr ""
     2093
     2094#: src/admin/pages/dashboard/index.js:110
     2095msgid "Please select a valid JSON file."
     2096msgstr ""
     2097
     2098#: src/admin/pages/dashboard/index.js:133
     2099msgid "Settings imported successfully."
     2100msgstr ""
     2101
     2102#: src/admin/pages/dashboard/index.js:151
     2103msgid "Failed to import settings."
     2104msgstr ""
     2105
     2106#: src/admin/pages/dashboard/index.js:158
     2107#: src/admin/pages/dashboard/index.js:173
     2108msgid "Failed to import settings. Please try again."
     2109msgstr ""
     2110
     2111#: src/admin/pages/dashboard/index.js:166
     2112msgid "Failed to read the file. Please try again."
     2113msgstr ""
     2114
     2115#: src/admin/pages/dashboard/index.js:203
     2116msgid "Settings reset successfully."
     2117msgstr ""
     2118
    19972119#: src/admin/pages/dashboard/index.js:221
    1998 msgid "Not Detected"
    1999 msgstr ""
    2000 
    2001 #: src/admin/pages/dashboard/index.js:72
    2002 msgid "Failed to fetch dashboard data"
    2003 msgstr ""
    2004 
    2005 #: src/admin/pages/dashboard/index.js:108
    2006 msgid "Please select a file to import."
    2007 msgstr ""
    2008 
    2009 #: src/admin/pages/dashboard/index.js:113
    2010 msgid "Please select a valid JSON file."
    2011 msgstr ""
    2012 
    2013 #: src/admin/pages/dashboard/index.js:136
    2014 msgid "Settings imported successfully."
    2015 msgstr ""
    2016 
    2017 #: src/admin/pages/dashboard/index.js:155
    2018 msgid "Failed to import settings."
    2019 msgstr ""
    2020 
    2021 #: src/admin/pages/dashboard/index.js:162
    2022 #: src/admin/pages/dashboard/index.js:177
    2023 msgid "Failed to import settings. Please try again."
    2024 msgstr ""
    2025 
    2026 #: src/admin/pages/dashboard/index.js:170
    2027 msgid "Failed to read the file. Please try again."
    2028 msgstr ""
    2029 
    2030 #: src/admin/pages/dashboard/index.js:207
    2031 msgid "Settings reset successfully."
    2032 msgstr ""
    2033 
    2034 #: src/admin/pages/dashboard/index.js:226
    20352120msgid "Failed to reset settings."
    20362121msgstr ""
    20372122
    2038 #: src/admin/pages/dashboard/index.js:230
     2123#: src/admin/pages/dashboard/index.js:225
    20392124msgid "Failed to reset settings. Please try again."
    20402125msgstr ""
    20412126
    2042 #: src/admin/pages/dashboard/index.js:243
     2127#: src/admin/pages/dashboard/index.js:238
    20432128msgid "Preparing export file…"
    20442129msgstr ""
    20452130
    2046 #: src/admin/pages/dashboard/index.js:272
     2131#: src/admin/pages/dashboard/index.js:265
     2132msgid "Settings exported successfully."
     2133msgstr ""
     2134
     2135#: src/admin/pages/dashboard/index.js:267
    20472136msgid "No data received from the server."
    20482137msgstr ""
    20492138
    2050 #: src/admin/pages/dashboard/index.js:276
     2139#: src/admin/pages/dashboard/index.js:271
    20512140msgid "Failed to export settings. Please try again."
    20522141msgstr ""
    20532142
    2054 #: src/admin/pages/dashboard/index.js:300
     2143#: src/admin/pages/dashboard/index.js:295
    20552144msgid "You are running version"
    20562145msgstr ""
    20572146
    2058 #: src/admin/pages/dashboard/index.js:325
     2147#: src/admin/pages/dashboard/index.js:320
    20592148msgid "Total Active Features"
    20602149msgstr ""
    20612150
    2062 #: src/admin/pages/dashboard/index.js:351
     2151#: src/admin/pages/dashboard/index.js:346
    20632152msgid "Settings Management"
    20642153msgstr ""
    20652154
    2066 #: src/admin/pages/dashboard/index.js:353
     2155#: src/admin/pages/dashboard/index.js:348
    20672156msgid "Manage your Dokan Kits features with these options:"
    20682157msgstr ""
    20692158
    2070 #: src/admin/pages/dashboard/index.js:362
     2159#: src/admin/pages/dashboard/index.js:357
    20712160msgid "Configure Settings"
    20722161msgstr ""
    20732162
    2074 #: src/admin/pages/dashboard/index.js:372
     2163#: src/admin/pages/dashboard/index.js:367
    20752164msgid "Exporting…"
    20762165msgstr ""
    20772166
    2078 #: src/admin/pages/dashboard/index.js:372
     2167#: src/admin/pages/dashboard/index.js:367
    20792168msgid "Export Settings"
    20802169msgstr ""
    20812170
    2082 #: src/admin/pages/dashboard/index.js:381
    2083 #: src/admin/pages/dashboard/index.js:467
     2171#: src/admin/pages/dashboard/index.js:376
     2172#: src/admin/pages/dashboard/index.js:462
     2173#: src/admin/pages/dashboard/index.js:468
     2174msgid "Import Settings"
     2175msgstr ""
     2176
     2177#: src/admin/pages/dashboard/index.js:385
     2178#: src/admin/pages/dashboard/index.js:536
     2179#: src/admin/pages/dashboard/index.js:542
     2180msgid "Reset Settings"
     2181msgstr ""
     2182
     2183#: src/admin/pages/dashboard/index.js:393
     2184msgid "Documentation & Support"
     2185msgstr ""
     2186
     2187#: src/admin/pages/dashboard/index.js:395
     2188msgid "Need help with Dokan Kits? Check out these resources:"
     2189msgstr ""
     2190
     2191#: src/admin/pages/dashboard/index.js:408
     2192msgid "Support Forum"
     2193msgstr ""
     2194
     2195#: src/admin/pages/dashboard/index.js:421
     2196msgid "Submit your feedback"
     2197msgstr ""
     2198
     2199#: src/admin/pages/dashboard/index.js:434
     2200msgid "Feature Idea or Bug Report"
     2201msgstr ""
     2202
     2203#: src/admin/pages/dashboard/index.js:444
     2204msgid "If you need support or have a feature request, please visit our support forum."
     2205msgstr ""
     2206
    20842207#: src/admin/pages/dashboard/index.js:473
    2085 msgid "Import Settings"
    2086 msgstr ""
    2087 
    2088 #: src/admin/pages/dashboard/index.js:390
    2089 #: src/admin/pages/dashboard/index.js:541
    20902208#: src/admin/pages/dashboard/index.js:547
    2091 msgid "Reset Settings"
    2092 msgstr ""
    2093 
    2094 #: src/admin/pages/dashboard/index.js:398
    2095 msgid "Documentation & Support"
    2096 msgstr ""
    2097 
    2098 #: src/admin/pages/dashboard/index.js:400
    2099 msgid "Need help with Dokan Kits? Check out these resources:"
    2100 msgstr ""
    2101 
    2102 #: src/admin/pages/dashboard/index.js:413
    2103 msgid "Support Forum"
    2104 msgstr ""
    2105 
    2106 #: src/admin/pages/dashboard/index.js:426
    2107 msgid "Submit your feedback"
    2108 msgstr ""
    2109 
    2110 #: src/admin/pages/dashboard/index.js:439
    2111 msgid "Feature Idea or Bug Report"
    2112 msgstr ""
    2113 
    2114 #: src/admin/pages/dashboard/index.js:449
    2115 msgid "If you need support or have a feature request, please visit our support forum."
    2116 msgstr ""
    2117 
    2118 #: src/admin/pages/dashboard/index.js:478
    2119 #: src/admin/pages/dashboard/index.js:552
    2120 #: src/admin/pages/tools/index.jsx:391
     2209#: src/admin/pages/tools/index.jsx:461
    21212210msgid "Close modal"
    21222211msgstr ""
    21232212
    2124 #: src/admin/pages/dashboard/index.js:488
     2213#: src/admin/pages/dashboard/index.js:483
    21252214msgid "Select a Dokan Kits settings file to import. This will overwrite your current settings."
    21262215msgstr ""
    21272216
    2128 #: src/admin/pages/dashboard/index.js:492
     2217#: src/admin/pages/dashboard/index.js:487
    21292218msgid "Settings File"
    21302219msgstr ""
    21312220
     2221#: src/admin/pages/dashboard/index.js:502
     2222msgid "Choose a file or drag it here"
     2223msgstr ""
     2224
    21322225#: src/admin/pages/dashboard/index.js:507
    2133 msgid "Choose a file or drag it here"
    2134 msgstr ""
    2135 
    2136 #: src/admin/pages/dashboard/index.js:512
    21372226msgid "Only .json files exported from Dokan Kits are supported."
    21382227msgstr ""
    21392228
    2140 #: src/admin/pages/dashboard/index.js:522
    2141 #: src/admin/pages/dashboard/index.js:605
     2229#: src/admin/pages/dashboard/index.js:517
     2230#: src/admin/pages/dashboard/index.js:600
    21422231#: src/admin/pages/tailwind-demo.jsx:152
    2143 #: src/admin/pages/tools/index.jsx:439
     2232#: src/admin/pages/tools/index.jsx:513
    21442233msgid "Cancel"
    21452234msgstr ""
    21462235
    2147 #: src/admin/pages/dashboard/index.js:531
     2236#: src/admin/pages/dashboard/index.js:526
    21482237msgid "Importing…"
    21492238msgstr ""
    21502239
    2151 #: src/admin/pages/dashboard/index.js:531
     2240#: src/admin/pages/dashboard/index.js:526
    21522241msgid "Import"
    21532242msgstr ""
    21542243
    2155 #: src/admin/pages/dashboard/index.js:562
     2244#: src/admin/pages/dashboard/index.js:557
    21562245msgid "Are you sure you want to reset Dokan Kits settings? This action cannot be undone."
    21572246msgstr ""
    21582247
    2159 #: src/admin/pages/dashboard/index.js:566
     2248#: src/admin/pages/dashboard/index.js:561
    21602249msgid "Reset Scope"
    21612250msgstr ""
    21622251
    2163 #: src/admin/pages/dashboard/index.js:574
     2252#: src/admin/pages/dashboard/index.js:569
    21642253msgid "All Settings"
    21652254msgstr ""
    21662255
    2167 #: src/admin/pages/dashboard/index.js:586
     2256#: src/admin/pages/dashboard/index.js:581
    21682257msgid "Available Settings:"
    21692258msgstr ""
    21702259
    2171 #: src/admin/pages/dashboard/index.js:614
     2260#: src/admin/pages/dashboard/index.js:609
    21722261msgid "Resetting…"
    21732262msgstr ""
    21742263
    2175 #: src/admin/pages/dashboard/index.js:614
     2264#: src/admin/pages/dashboard/index.js:609
    21762265msgid "Reset"
    21772266msgstr ""
     
    23742463#: src/admin/pages/tailwind-demo.jsx:191
    23752464#: src/admin/pages/tailwind-demo.jsx:230
    2376 #: src/admin/pages/tools/index.jsx:239
     2465#: src/admin/pages/tools/index.jsx:271
    23772466msgid "Success"
    23782467msgstr ""
     
    24462535msgstr ""
    24472536
    2448 #: src/admin/pages/tools/index.jsx:113
     2537#: src/admin/pages/tools/index.jsx:116
    24492538msgid "Operation completed successfully."
    24502539msgstr ""
    24512540
    2452 #: src/admin/pages/tools/index.jsx:122
     2541#: src/admin/pages/tools/index.jsx:128
    24532542msgid "Failed to complete operation."
    24542543msgstr ""
     
    24582547msgstr ""
    24592548
    2460 #: src/admin/pages/tools/index.jsx:186
     2549#: src/admin/pages/tools/index.jsx:201
     2550msgid "Log file prepared for download successfully."
     2551msgstr ""
     2552
     2553#: src/admin/pages/tools/index.jsx:208
    24612554msgid "Failed to prepare log file."
    24622555msgstr ""
    24632556
    2464 #: src/admin/pages/tools/index.jsx:199
     2557#: src/admin/pages/tools/index.jsx:216
    24652558msgid "Failed to download logs."
    24662559msgstr ""
    24672560
    2468 #: src/admin/pages/tools/index.jsx:239
     2561#: src/admin/pages/tools/index.jsx:271
    24692562msgid "Failed"
    24702563msgstr ""
    24712564
    2472 #: src/admin/pages/tools/index.jsx:249
     2565#: src/admin/pages/tools/index.jsx:281
     2566msgid "Error Code:"
     2567msgstr ""
     2568
     2569#: src/admin/pages/tools/index.jsx:288
     2570msgid "Message:"
     2571msgstr ""
     2572
     2573#: src/admin/pages/tools/index.jsx:295
    24732574msgid "Tables affected:"
    24742575msgstr ""
    24752576
    2476 #: src/admin/pages/tools/index.jsx:253
     2577#: src/admin/pages/tools/index.jsx:299
    24772578msgid "and more…"
    24782579msgstr ""
    24792580
    2480 #: src/admin/pages/tools/index.jsx:261
     2581#: src/admin/pages/tools/index.jsx:307
    24812582msgid "Migrations executed:"
    24822583msgstr ""
    24832584
    2484 #: src/admin/pages/tools/index.jsx:267
     2585#: src/admin/pages/tools/index.jsx:313
    24852586msgid "Tables optimized:"
    24862587msgstr ""
    24872588
    2488 #: src/admin/pages/tools/index.jsx:270
     2589#: src/admin/pages/tools/index.jsx:316
    24892590msgid "Failed:"
    24902591msgstr ""
    24912592
    2492 #: src/admin/pages/tools/index.jsx:278
     2593#: src/admin/pages/tools/index.jsx:324
    24932594msgid "File:"
    24942595msgstr ""
    24952596
    2496 #: src/admin/pages/tools/index.jsx:298
     2597#: src/admin/pages/tools/index.jsx:331
     2598msgid "Validation Errors:"
     2599msgstr ""
     2600
     2601#: src/admin/pages/tools/index.jsx:362
    24972602msgid "Migration in Progress"
    24982603msgstr ""
    24992604
    2500 #: src/admin/pages/tools/index.jsx:299
     2605#: src/admin/pages/tools/index.jsx:363
    25012606msgid "A migration is currently running. Please wait for it to complete before running other tools."
    25022607msgstr ""
    25032608
    2504 #: src/admin/pages/tools/index.jsx:307
     2609#: src/admin/pages/tools/index.jsx:371
     2610#: src/admin/pages/tools/index.jsx:645
     2611msgid "Migration Required"
     2612msgstr ""
     2613
     2614#: src/admin/pages/tools/index.jsx:372
     2615msgid "Your database needs to be migrated to the latest version. Please run the migration tool below."
     2616msgstr ""
     2617
     2618#: src/admin/pages/tools/index.jsx:379
     2619msgid "Up to Date"
     2620msgstr ""
     2621
     2622#: src/admin/pages/tools/index.jsx:381
     2623msgid "All migrations are current."
     2624msgstr ""
     2625
     2626#: src/admin/pages/tools/index.jsx:384
     2627msgid "Last migration completed successfully."
     2628msgstr ""
     2629
     2630#: src/admin/pages/tools/index.jsx:411
     2631msgid "System Status Overview"
     2632msgstr ""
     2633
     2634#: src/admin/pages/tools/index.jsx:417
     2635msgid "WordPress:"
     2636msgstr ""
     2637
     2638#: src/admin/pages/tools/index.jsx:422
     2639msgid "PHP:"
     2640msgstr ""
     2641
     2642#: src/admin/pages/tools/index.jsx:427
     2643msgid "Plugin:"
     2644msgstr ""
     2645
     2646#: src/admin/pages/tools/index.jsx:432
     2647msgid "System Check:"
     2648msgstr ""
     2649
     2650#: src/admin/pages/tools/index.jsx:432
     2651msgid "Pass"
     2652msgstr ""
     2653
     2654#: src/admin/pages/tools/index.jsx:432
     2655msgid "Fail"
     2656msgstr ""
     2657
     2658#: src/admin/pages/tools/index.jsx:450
     2659#: src/admin/pages/tools/index.jsx:456
     2660msgid "Confirm Database Operation"
     2661msgstr ""
     2662
     2663#: src/admin/pages/tools/index.jsx:471
     2664msgid "This action will modify your database structure. Please ensure you have a backup before proceeding."
     2665msgstr ""
     2666
     2667#: src/admin/pages/tools/index.jsx:476
     2668msgid "Recommended precautions:"
     2669msgstr ""
     2670
     2671#: src/admin/pages/tools/index.jsx:482
     2672msgid "Create a full database backup"
     2673msgstr ""
     2674
     2675#: src/admin/pages/tools/index.jsx:483
     2676msgid "Ensure no other processes are accessing the database"
     2677msgstr ""
     2678
     2679#: src/admin/pages/tools/index.jsx:484
     2680msgid "Run this operation during low-traffic periods"
     2681msgstr ""
     2682
     2683#: src/admin/pages/tools/index.jsx:485
     2684msgid "Monitor your site after the operation completes"
     2685msgstr ""
     2686
     2687#: src/admin/pages/tools/index.jsx:492
     2688msgid "Operation Details:"
     2689msgstr ""
     2690
     2691#: src/admin/pages/tools/index.jsx:498
     2692msgid "Action:"
     2693msgstr ""
     2694
     2695#: src/admin/pages/tools/index.jsx:501
     2696msgid "Risk Level:"
     2697msgstr ""
     2698
     2699#: src/admin/pages/tools/index.jsx:502
     2700msgid "High - Database Structure Changes"
     2701msgstr ""
     2702
     2703#: src/admin/pages/tools/index.jsx:520
     2704msgid "Yes, I understand the risks"
     2705msgstr ""
     2706
     2707#: src/admin/pages/tools/index.jsx:532
     2708msgid "Tools & Utilities"
     2709msgstr ""
     2710
     2711#: src/admin/pages/tools/index.jsx:535
     2712msgid "Manage advanced Dokan Kits maintenance and migration tasks. Use these tools for troubleshooting, database management, and data migration."
     2713msgstr ""
     2714
     2715#: src/admin/pages/tools/index.jsx:538
     2716msgid "These utilities help you maintain and optimize your Dokan Kits installation for better performance and reliability."
     2717msgstr ""
     2718
     2719#: src/admin/pages/tools/index.jsx:543
     2720msgid "Maintenance"
     2721msgstr ""
     2722
     2723#: src/admin/pages/tools/index.jsx:547
     2724msgid "Database"
     2725msgstr ""
     2726
     2727#: src/admin/pages/tools/index.jsx:551
     2728msgid "Optimization"
     2729msgstr ""
     2730
     2731#: src/admin/pages/tools/index.jsx:563
     2732msgid "Database Tools"
     2733msgstr ""
     2734
    25052735#: src/admin/pages/tools/index.jsx:571
    2506 msgid "Migration Required"
    2507 msgstr ""
    2508 
    2509 #: src/admin/pages/tools/index.jsx:308
    2510 msgid "Your database needs to be migrated to the latest version. Please run the migration tool below."
    2511 msgstr ""
    2512 
    2513 #: src/admin/pages/tools/index.jsx:315
    2514 msgid "Up to Date"
    2515 msgstr ""
    2516 
    2517 #: src/admin/pages/tools/index.jsx:341
    2518 msgid "System Status Overview"
    2519 msgstr ""
    2520 
    2521 #: src/admin/pages/tools/index.jsx:347
    2522 msgid "WordPress:"
    2523 msgstr ""
    2524 
    2525 #: src/admin/pages/tools/index.jsx:352
    2526 msgid "PHP:"
    2527 msgstr ""
    2528 
    2529 #: src/admin/pages/tools/index.jsx:357
    2530 msgid "Plugin:"
    2531 msgstr ""
    2532 
    2533 #: src/admin/pages/tools/index.jsx:362
    2534 msgid "System Check:"
    2535 msgstr ""
    2536 
    2537 #: src/admin/pages/tools/index.jsx:362
    2538 msgid "Pass"
    2539 msgstr ""
    2540 
    2541 #: src/admin/pages/tools/index.jsx:362
    2542 msgid "Fail"
    2543 msgstr ""
    2544 
    2545 #: src/admin/pages/tools/index.jsx:380
    2546 #: src/admin/pages/tools/index.jsx:386
    2547 msgid "Confirm Database Operation"
    2548 msgstr ""
    2549 
    2550 #: src/admin/pages/tools/index.jsx:401
    2551 msgid "This action will modify your database structure. Please ensure you have a backup before proceeding."
    2552 msgstr ""
    2553 
    2554 #: src/admin/pages/tools/index.jsx:406
    2555 msgid "Recommended precautions:"
    2556 msgstr ""
    2557 
    2558 #: src/admin/pages/tools/index.jsx:410
    2559 msgid "Create a full database backup"
    2560 msgstr ""
    2561 
    2562 #: src/admin/pages/tools/index.jsx:411
    2563 msgid "Ensure no other processes are accessing the database"
    2564 msgstr ""
    2565 
    2566 #: src/admin/pages/tools/index.jsx:412
    2567 msgid "Run this operation during low-traffic periods"
    2568 msgstr ""
    2569 
    2570 #: src/admin/pages/tools/index.jsx:413
    2571 msgid "Monitor your site after the operation completes"
    2572 msgstr ""
    2573 
    2574 #: src/admin/pages/tools/index.jsx:420
    2575 msgid "Operation Details:"
    2576 msgstr ""
    2577 
    2578 #: src/admin/pages/tools/index.jsx:424
    2579 msgid "Action:"
    2580 msgstr ""
    2581 
    2582 #: src/admin/pages/tools/index.jsx:427
    2583 msgid "Risk Level:"
    2584 msgstr ""
    2585 
    2586 #: src/admin/pages/tools/index.jsx:428
    2587 msgid "High - Database Structure Changes"
    2588 msgstr ""
    2589 
    2590 #: src/admin/pages/tools/index.jsx:446
    2591 msgid "Yes, I understand the risks"
    2592 msgstr ""
    2593 
    2594 #: src/admin/pages/tools/index.jsx:458
    2595 msgid "Tools & Utilities"
    2596 msgstr ""
    2597 
    2598 #: src/admin/pages/tools/index.jsx:461
    2599 msgid "Manage advanced Dokan Kits maintenance and migration tasks. Use these tools for troubleshooting, database management, and data migration."
    2600 msgstr ""
    2601 
    2602 #: src/admin/pages/tools/index.jsx:464
    2603 msgid "These utilities help you maintain and optimize your Dokan Kits installation for better performance and reliability."
    2604 msgstr ""
    2605 
    2606 #: src/admin/pages/tools/index.jsx:469
    2607 msgid "Maintenance"
    2608 msgstr ""
    2609 
    2610 #: src/admin/pages/tools/index.jsx:473
    2611 msgid "Database"
    2612 msgstr ""
    2613 
    2614 #: src/admin/pages/tools/index.jsx:477
    2615 msgid "Optimization"
    2616 msgstr ""
    2617 
    2618 #: src/admin/pages/tools/index.jsx:489
    2619 msgid "Database Tools"
    2620 msgstr ""
    2621 
    2622 #: src/admin/pages/tools/index.jsx:497
    26232736msgid "Database Tables"
    26242737msgstr ""
    26252738
    2626 #: src/admin/pages/tools/index.jsx:502
     2739#: src/admin/pages/tools/index.jsx:576
    26272740msgid "Recreate missing or corrupted database tables. This will create new tables and verify their structure without affecting existing data."
    26282741msgstr ""
    26292742
    2630 #: src/admin/pages/tools/index.jsx:514
     2743#: src/admin/pages/tools/index.jsx:588
    26312744msgid "Processing…"
    26322745msgstr ""
    26332746
    2634 #: src/admin/pages/tools/index.jsx:514
     2747#: src/admin/pages/tools/index.jsx:588
    26352748msgid "Recreate Tables"
    26362749msgstr ""
    26372750
    2638 #: src/admin/pages/tools/index.jsx:524
    2639 #: src/admin/pages/tools/index.jsx:541
     2751#: src/admin/pages/tools/index.jsx:598
     2752#: src/admin/pages/tools/index.jsx:615
    26402753msgid "Optimize Tables"
    26412754msgstr ""
    26422755
    2643 #: src/admin/pages/tools/index.jsx:529
     2756#: src/admin/pages/tools/index.jsx:603
    26442757msgid "Repair and optimize database tables to improve performance and fix potential data corruption issues. This may take several minutes."
    26452758msgstr ""
    26462759
    2647 #: src/admin/pages/tools/index.jsx:541
     2760#: src/admin/pages/tools/index.jsx:615
    26482761msgid "Optimizing…"
    26492762msgstr ""
    26502763
    2651 #: src/admin/pages/tools/index.jsx:551
     2764#: src/admin/pages/tools/index.jsx:625
    26522765msgid "Data Migration"
    26532766msgstr ""
    26542767
    2655 #: src/admin/pages/tools/index.jsx:559
     2768#: src/admin/pages/tools/index.jsx:633
    26562769msgid "Migrate Settings"
    26572770msgstr ""
    26582771
    2659 #: src/admin/pages/tools/index.jsx:564
     2772#: src/admin/pages/tools/index.jsx:638
    26602773msgid "Migrate legacy Dokan Kits options to the new settings structure. This is required when upgrading from older versions."
    26612774msgstr ""
    26622775
    2663 #: src/admin/pages/tools/index.jsx:572
     2776#: src/admin/pages/tools/index.jsx:646
    26642777msgid "Your database needs to be migrated to work with the current version."
    26652778msgstr ""
    26662779
    2667 #: src/admin/pages/tools/index.jsx:587
     2780#: src/admin/pages/tools/index.jsx:661
    26682781msgid "Migrating…"
    26692782msgstr ""
    26702783
    2671 #: src/admin/pages/tools/index.jsx:587
     2784#: src/admin/pages/tools/index.jsx:661
    26722785msgid "Run Migration"
    26732786msgstr ""
    26742787
    2675 #: src/admin/pages/tools/index.jsx:597
     2788#: src/admin/pages/tools/index.jsx:671
    26762789msgid "Troubleshooting"
    26772790msgstr ""
    26782791
    2679 #: src/admin/pages/tools/index.jsx:605
     2792#: src/admin/pages/tools/index.jsx:679
    26802793msgid "System Diagnostics"
    26812794msgstr ""
    26822795
    2683 #: src/admin/pages/tools/index.jsx:610
     2796#: src/admin/pages/tools/index.jsx:684
    26842797msgid "Run comprehensive diagnostic tests to identify potential issues with your environment, dependencies, and configuration."
    26852798msgstr ""
    26862799
    2687 #: src/admin/pages/tools/index.jsx:623
     2800#: src/admin/pages/tools/index.jsx:697
    26882801msgid "Running Diagnostics…"
    26892802msgstr ""
    26902803
    2691 #: src/admin/pages/tools/index.jsx:623
     2804#: src/admin/pages/tools/index.jsx:697
    26922805msgid "Run System Check"
    26932806msgstr ""
    26942807
    2695 #: src/admin/pages/tools/index.jsx:633
     2808#: src/admin/pages/tools/index.jsx:707
    26962809msgid "Debug Logs"
    26972810msgstr ""
    26982811
    2699 #: src/admin/pages/tools/index.jsx:638
     2812#: src/admin/pages/tools/index.jsx:712
    27002813msgid "Generate and download comprehensive debug logs including system information, configuration, and error details for support purposes."
    27012814msgstr ""
    27022815
    2703 #: src/admin/pages/tools/index.jsx:650
     2816#: src/admin/pages/tools/index.jsx:724
    27042817msgid "Preparing Download…"
    27052818msgstr ""
    27062819
    2707 #: src/admin/pages/tools/index.jsx:650
     2820#: src/admin/pages/tools/index.jsx:724
    27082821msgid "Download Debug Logs"
    27092822msgstr ""
    27102823
    2711 #: src/admin/pages/tools/index.jsx:668
     2824#: src/admin/pages/tools/index.jsx:742
    27122825msgid "If you encounter issues while using these tools or need additional support, please visit our support forum or documentation. When contacting support, include your debug logs for faster assistance."
    27132826msgstr ""
    27142827
    2715 #: src/admin/pages/tools/index.jsx:696
     2828#: src/admin/pages/tools/index.jsx:770
    27162829msgid "Report Issue"
    27172830msgstr ""
    27182831
    2719 #: src/admin/pages/tools/index.jsx:703
     2832#: src/admin/pages/tools/index.jsx:777
    27202833msgid "Before contacting support:"
    27212834msgstr ""
    27222835
    2723 #: src/admin/pages/tools/index.jsx:706
     2836#: src/admin/pages/tools/index.jsx:780
    27242837msgid "Run system diagnostics to identify common issues"
    27252838msgstr ""
    27262839
    2727 #: src/admin/pages/tools/index.jsx:707
     2840#: src/admin/pages/tools/index.jsx:781
    27282841msgid "Download debug logs to include with your support request"
    27292842msgstr ""
    27302843
    2731 #: src/admin/pages/tools/index.jsx:708
     2844#: src/admin/pages/tools/index.jsx:782
    27322845msgid "Check if migrations are up to date"
    27332846msgstr ""
    27342847
    2735 #: src/admin/pages/tools/index.jsx:709
     2848#: src/admin/pages/tools/index.jsx:783
    27362849msgid "Try recreating database tables if experiencing data issues"
    27372850msgstr ""
  • dokan-kits/trunk/vendor/composer/installed.php

    r3320185 r3321393  
    44        'pretty_version' => 'dev-trunk',
    55        'version' => 'dev-trunk',
    6         'reference' => 'dbdb4dca48481a76e9b528a4b0a5edf9a5422bc3',
     6        'reference' => 'cf39e8ddd208e7c3681d2f0f866f33a74178dfa2',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-trunk',
    1515            'version' => 'dev-trunk',
    16             'reference' => 'dbdb4dca48481a76e9b528a4b0a5edf9a5422bc3',
     16            'reference' => 'cf39e8ddd208e7c3681d2f0f866f33a74178dfa2',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.