Plugin Directory

Changeset 3496650


Ignore:
Timestamp:
04/01/2026 01:41:01 PM (5 days ago)
Author:
wpcraftnet
Message:

database issue was fix

Location:
block-ip-address-for-woocommerce
Files:
17 added
6 edited

Legend:

Unmodified
Added
Removed
  • block-ip-address-for-woocommerce/trunk/blocipadwoo_store.php

    r3476615 r3496650  
    44 * Plugin URI: https://wpcraft.net/
    55 * Description: Block unwanted IPs from accessing your WooCommerce shop,home and specific category redirect them to another page and control access with start and end dates.
    6  * Version: 1.0.2
    7  * Tested up to: 6.9.1
     6 * Version: 1.0.3
     7 * Tested up to: 6.9.4
    88 * Author: wpcraft
    99 * Requires Plugins: woocommerce
     
    2525        add_action('rest_api_init', [$this, 'blocipadwoo_rest_routes']);
    2626        add_action('template_redirect', [$this, 'blocipadwoo_from_shop']); // Block access to shop
    27         register_activation_hook(__FILE__, [$this, 'blocipadwoo_db_activate']);         
     27        register_activation_hook(__FILE__, [$this, 'blocipadwoo_db_activate']);
     28
     29        // Disable LiteSpeed cache for plugin REST API requests
     30        add_action('rest_api_init', [$this, 'blocipadwoo_disable_litespeed_cache']);
     31    }
     32
     33    /* ========== Disable LiteSpeed Cache for REST API ================*/
     34
     35    public function blocipadwoo_disable_litespeed_cache() {
     36        // Disable LiteSpeed cache for our REST API endpoints
     37        if ( isset( $_SERVER['REQUEST_URI'] ) &&
     38             ( strpos( $_SERVER['REQUEST_URI'], 'wooip/v1' ) !== false ||
     39               strpos( $_SERVER['REQUEST_URI'], 'wprk/v1' ) !== false ) ) {
     40           
     41            // Tell LiteSpeed not to cache this request
     42            if ( ! defined( 'LSCWP_V' ) ) {
     43                return;
     44            }
     45            do_action( 'litespeed_control_set_nocache', 'blocipadwoo REST API' );
     46           
     47            // Also set no-cache headers
     48            header( 'Cache-Control: no-cache, no-store, must-revalidate' );
     49            header( 'Pragma: no-cache' );
     50            header( 'Expires: 0' );
     51        }
    2852    }   
    2953
     
    5478            id mediumint(9) NOT NULL AUTO_INCREMENT,
    5579            ipaddress varchar(100) NOT NULL,
    56             blocktype varchar(100) NOT NULL,
    57             blkcategory varchar(100) NOT NULL,
     80            blocktype varchar(100) NOT NULL DEFAULT '',
     81            blkcategory varchar(100) NOT NULL DEFAULT '',
    5882            startdate date NOT NULL,
    5983            enddate date NOT NULL,
     
    6589        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    6690        dbDelta($sql);
     91
     92        // Add missing columns for existing installations
     93        $columns = $wpdb->get_col("SHOW COLUMNS FROM $table_name");
     94        if (!in_array('blocktype', $columns)) {
     95            $wpdb->query("ALTER TABLE $table_name ADD COLUMN blocktype varchar(100) NOT NULL DEFAULT '' AFTER ipaddress");
     96        }
     97        if (!in_array('blkcategory', $columns)) {
     98            $wpdb->query("ALTER TABLE $table_name ADD COLUMN blkcategory varchar(100) NOT NULL DEFAULT '' AFTER blocktype");
     99        }
    67100    }
    68101
     
    103136            }
    104137        ]);
    105    
     138
     139        register_rest_route('wooip/v1', '/product_categories', [
     140            'methods'  => 'GET',
     141            'callback' => [$this, 'blocipadwoo_get_product_categories'],
     142            'permission_callback' => function () {
     143                return current_user_can( 'manage_options' );
     144            }
     145        ]);
     146   
     147    }
     148
     149    /* ========== Get WooCommerce Product Categories ================*/
     150
     151    public function blocipadwoo_get_product_categories() {
     152        $categories = get_terms([
     153            'taxonomy'   => 'product_cat',
     154            'hide_empty' => false,
     155        ]);
     156
     157        if (is_wp_error($categories)) {
     158            return rest_ensure_response([]);
     159        }
     160
     161        $result = [];
     162        foreach ($categories as $cat) {
     163            $result[] = [
     164                'id'   => $cat->term_id,
     165                'name' => html_entity_decode($cat->name),
     166                'slug' => $cat->slug,
     167            ];
     168        }
     169
     170        return rest_ensure_response($result);
    106171    }
    107172
     
    201266            $employees = $wpdb->get_results("SELECT * FROM $table_name");
    202267       
    203             return rest_ensure_response($employees);
     268            $response = rest_ensure_response($employees);
     269            $response->header( 'Cache-Control', 'no-cache, no-store, must-revalidate' );
     270            $response->header( 'Pragma', 'no-cache' );
     271            $response->header( 'Expires', '0' );
     272            return $response;
    204273        }
    205274       
     
    348417        }
    349418
    350         // Category-wise block (using category name)
     419        // Category-wise block (using category name, case-insensitive)
    351420        if (is_product_category()) {
    352421            $category = get_queried_object();
    353             $cat_name = $category ? $category->name : '';
     422            $cat_name = $category ? html_entity_decode($category->name) : '';
    354423            $blocked_ip = $wpdb->get_var($wpdb->prepare(
    355                 "SELECT ipaddress FROM $table_name WHERE ipaddress = %s AND blocktype = 'category' AND blkcategory = %s AND startdate <= NOW() AND enddate >= NOW()",
     424                "SELECT ipaddress FROM $table_name WHERE ipaddress = %s AND blocktype = 'category' AND LOWER(blkcategory) = LOWER(%s) AND startdate <= NOW() AND enddate >= NOW()",
    356425                $user_ip, $cat_name
    357426            ));
     
    397466        }
    398467
    399         // Category-wise block (using category name)
     468        // Category-wise block (using category name, case-insensitive)
    400469        if (is_product_category()) {
    401470            $category = get_queried_object();
    402             $cat_name = $category ? $category->name : '';
     471            $cat_name = $category ? html_entity_decode($category->name) : '';
    403472            $redirect_url = $wpdb->get_var($wpdb->prepare(
    404                 "SELECT redirect FROM $table_name WHERE ipaddress = %s AND blocktype = 'category' AND blkcategory = %s AND startdate <= NOW() AND enddate >= NOW()",
     473                "SELECT redirect FROM $table_name WHERE ipaddress = %s AND blocktype = 'category' AND LOWER(blkcategory) = LOWER(%s) AND startdate <= NOW() AND enddate >= NOW()",
    405474                $user_ip, $cat_name
    406475            ));
  • block-ip-address-for-woocommerce/trunk/build/index.asset.php

    r3467005 r3496650  
    1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-dom-ready', 'wp-element'), 'version' => '760a34d79c3021f24b68');
     1<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-dom-ready', 'wp-element'), 'version' => '726dc47a2bc5eb42dc44');
  • block-ip-address-for-woocommerce/trunk/build/index.js

    r3467005 r3496650  
    169169    pointer-events: auto;
    170170  }
    171 `,Z=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:o,children:s,containerStyle:i,containerClassName:a})=>{let{toasts:c,handlers:l}=(e=>{let{toasts:t,pausedAt:r}=((e={})=>{let[t,r]=(0,n.useState)(S),o=(0,n.useRef)(S);(0,n.useEffect)((()=>(o.current!==S&&r(S),E.push(r),()=>{let e=E.indexOf(r);e>-1&&E.splice(e,1)})),[]);let s=t.toasts.map((t=>{var n,r,o;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(n=e[t.type])?void 0:n.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)||j[t.type],style:{...e.style,...null==(o=e[t.type])?void 0:o.style,...t.style}}}));return{...t,toasts:s}})(e);(0,n.useEffect)((()=>{if(r)return;let e=Date.now(),n=t.map((t=>{if(t.duration===1/0)return;let n=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(n<0))return setTimeout((()=>T.dismiss(t.id)),n);t.visible&&T.dismiss(t.id)}));return()=>{n.forEach((e=>e&&clearTimeout(e)))}}),[t,r]);let o=(0,n.useCallback)((()=>{r&&O({type:6,time:Date.now()})}),[r]),s=(0,n.useCallback)(((e,n)=>{let{reverseOrder:r=!1,gutter:o=8,defaultPosition:s}=n||{},i=t.filter((t=>(t.position||s)===(e.position||s)&&t.height)),a=i.findIndex((t=>t.id===e.id)),c=i.filter(((e,t)=>t<a&&e.visible)).length;return i.filter((e=>e.visible)).slice(...r?[c+1]:[0,c]).reduce(((e,t)=>e+(t.height||0)+o),0)}),[t]);return(0,n.useEffect)((()=>{t.forEach((e=>{if(e.dismissed)((e,t=1e3)=>{if(N.has(e))return;let n=setTimeout((()=>{N.delete(e),O({type:4,toastId:e})}),t);N.set(e,n)})(e.id,e.removeDelay);else{let t=N.get(e.id);t&&(clearTimeout(t),N.delete(e.id))}}))}),[t]),{toasts:t,handlers:{updateHeight:A,startPause:C,endPause:o,calculateOffset:s}}})(r);return n.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...i},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},c.map((r=>{let i=r.position||t,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:x()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}})(i,l.calculateOffset(r,{reverseOrder:e,gutter:o,defaultPosition:t}));return n.createElement(G,{id:r.id,key:r.id,onHeightUpdate:l.updateHeight,className:r.visible?Q:"",style:a},"custom"===r.type?b(r.message,r):s?s(r):n.createElement(X,{toast:r,position:i}))})))},Y=T;const ee=window.ReactJSXRuntime,te=function(){return(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)("h1",{children:" Add Block IP "}),(0,ee.jsx)(Z,{position:"top-center"})]})};function ne(e,t){return function(){return e.apply(t,arguments)}}const{toString:re}=Object.prototype,{getPrototypeOf:oe}=Object,se=(ie=Object.create(null),e=>{const t=re.call(e);return ie[t]||(ie[t]=t.slice(8,-1).toLowerCase())});var ie;const ae=e=>(e=e.toLowerCase(),t=>se(t)===e),ce=e=>t=>typeof t===e,{isArray:le}=Array,de=ce("undefined"),ue=ae("ArrayBuffer"),pe=ce("string"),fe=ce("function"),he=ce("number"),me=e=>null!==e&&"object"==typeof e,ge=e=>{if("object"!==se(e))return!1;const t=oe(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ye=ae("Date"),be=ae("File"),we=ae("Blob"),xe=ae("FileList"),ve=ae("URLSearchParams"),[Ee,Se,Oe,je]=["ReadableStream","Request","Response","Headers"].map(ae);function Re(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),le(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function Te(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ce=e=>!de(e)&&e!==Ae,Ne=(Pe="undefined"!=typeof Uint8Array&&oe(Uint8Array),e=>Pe&&e instanceof Pe);var Pe;const ke=ae("HTMLFormElement"),De=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Fe=ae("RegExp"),Ue=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Re(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},Le="abcdefghijklmnopqrstuvwxyz",_e="0123456789",Be={DIGIT:_e,ALPHA:Le,ALPHA_DIGIT:Le+Le.toUpperCase()+_e},Ie=ae("AsyncFunction"),qe=(Me="function"==typeof setImmediate,$e=fe(Ae.postMessage),Me?setImmediate:$e?(ze=`axios@${Math.random()}`,He=[],Ae.addEventListener("message",(({source:e,data:t})=>{e===Ae&&t===ze&&He.length&&He.shift()()}),!1),e=>{He.push(e),Ae.postMessage(ze,"*")}):e=>setTimeout(e));var Me,$e,ze,He;const We="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Ae):"undefined"!=typeof process&&process.nextTick||qe,Je={isArray:le,isArrayBuffer:ue,isBuffer:function(e){return null!==e&&!de(e)&&null!==e.constructor&&!de(e.constructor)&&fe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||fe(e.append)&&("formdata"===(t=se(e))||"object"===t&&fe(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ue(e.buffer),t},isString:pe,isNumber:he,isBoolean:e=>!0===e||!1===e,isObject:me,isPlainObject:ge,isReadableStream:Ee,isRequest:Se,isResponse:Oe,isHeaders:je,isUndefined:de,isDate:ye,isFile:be,isBlob:we,isRegExp:Fe,isFunction:fe,isStream:e=>me(e)&&fe(e.pipe),isURLSearchParams:ve,isTypedArray:Ne,isFileList:xe,forEach:Re,merge:function e(){const{caseless:t}=Ce(this)&&this||{},n={},r=(r,o)=>{const s=t&&Te(n,o)||o;ge(n[s])&&ge(r)?n[s]=e(n[s],r):ge(r)?n[s]=e({},r):le(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Re(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(Re(t,((t,r)=>{n&&fe(t)?e[r]=ne(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&oe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:se,kindOfTest:ae,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(le(e))return e;let t=e.length;if(!he(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ke,hasOwnProperty:De,hasOwnProp:De,reduceDescriptors:Ue,freezeMethods:e=>{Ue(e,((t,n)=>{if(fe(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];fe(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return le(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Te,global:Ae,isContextDefined:Ce,ALPHABET:Be,generateString:(e=16,t=Be.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&fe(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(me(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=le(e)?[]:{};return Re(e,((e,t)=>{const s=n(e,r+1);!de(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Ie,isThenable:e=>e&&(me(e)||fe(e))&&fe(e.then)&&fe(e.catch),setImmediate:qe,asap:We};function Ke(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Je.inherits(Ke,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Je.toJSONObject(this.config),code:this.code,status:this.status}}});const Ve=Ke.prototype,Xe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Xe[e]={value:e}})),Object.defineProperties(Ke,Xe),Object.defineProperty(Ve,"isAxiosError",{value:!0}),Ke.from=(e,t,n,r,o,s)=>{const i=Object.create(Ve);return Je.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ke.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const Ge=Ke;function Qe(e){return Je.isPlainObject(e)||Je.isArray(e)}function Ze(e){return Je.endsWith(e,"[]")?e.slice(0,-2):e}function Ye(e,t,n){return e?e.concat(t).map((function(e,t){return e=Ze(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const et=Je.toFlatObject(Je,{},null,(function(e){return/^is[A-Z]/.test(e)})),tt=function(e,t,n){if(!Je.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Je.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Je.isUndefined(t[e])}))).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Je.isSpecCompliantForm(t);if(!Je.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Je.isDate(e))return e.toISOString();if(!a&&Je.isBlob(e))throw new Ge("Blob is not supported. Use a Buffer instead.");return Je.isArrayBuffer(e)||Je.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(Je.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Je.isArray(e)&&function(e){return Je.isArray(e)&&!e.some(Qe)}(e)||(Je.isFileList(e)||Je.endsWith(n,"[]"))&&(a=Je.toArray(e)))return n=Ze(n),a.forEach((function(e,r){!Je.isUndefined(e)&&null!==e&&t.append(!0===i?Ye([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!Qe(e)||(t.append(Ye(o,n,s),c(e)),!1)}const d=[],u=Object.assign(et,{defaultVisitor:l,convertValue:c,isVisitable:Qe});if(!Je.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Je.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+r.join("."));d.push(n),Je.forEach(n,(function(n,s){!0===(!(Je.isUndefined(n)||null===n)&&o.call(t,n,Je.isString(s)?s.trim():s,r,u))&&e(n,r?r.concat(s):[s])})),d.pop()}}(e),t};function nt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function rt(e,t){this._pairs=[],e&&tt(e,this,t)}const ot=rt.prototype;ot.append=function(e,t){this._pairs.push([e,t])},ot.toString=function(e){const t=e?function(t){return e.call(this,t,nt)}:nt;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const st=rt;function it(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function at(e,t,n){if(!t)return e;const r=n&&n.encode||it;Je.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):Je.isURLSearchParams(t)?t.toString():new st(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const ct=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Je.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},lt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:st,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ut="undefined"!=typeof window&&"undefined"!=typeof document,pt="object"==typeof navigator&&navigator||void 0,ft=ut&&(!pt||["ReactNative","NativeScript","NS"].indexOf(pt.product)<0),ht="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,mt=ut&&window.location.href||"http://localhost",gt={...t,...dt},yt=function(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&Je.isArray(r)?r.length:s,a?(Je.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i):(r[s]&&Je.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&Je.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(Je.isFormData(e)&&Je.isFunction(e.entries)){const n={};return Je.forEachEntry(e,((e,r)=>{t(function(e){return Je.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},bt={transitional:lt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Je.isObject(e);if(o&&Je.isHTMLForm(e)&&(e=new FormData(e)),Je.isFormData(e))return r?JSON.stringify(yt(e)):e;if(Je.isArrayBuffer(e)||Je.isBuffer(e)||Je.isStream(e)||Je.isFile(e)||Je.isBlob(e)||Je.isReadableStream(e))return e;if(Je.isArrayBufferView(e))return e.buffer;if(Je.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return tt(e,new gt.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return gt.isNode&&Je.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=Je.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return tt(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e){if(Je.isString(e))try{return(0,JSON.parse)(e),Je.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||bt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Je.isResponse(e)||Je.isReadableStream(e))return e;if(e&&Je.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Ge.from(e,Ge.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gt.classes.FormData,Blob:gt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Je.forEach(["delete","get","head","post","put","patch"],(e=>{bt.headers[e]={}}));const wt=bt,xt=Je.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),vt=Symbol("internals");function Et(e){return e&&String(e).trim().toLowerCase()}function St(e){return!1===e||null==e?e:Je.isArray(e)?e.map(St):String(e)}function Ot(e,t,n,r,o){return Je.isFunction(r)?r.call(this,t,n):(o&&(t=n),Je.isString(t)?Je.isString(r)?-1!==t.indexOf(r):Je.isRegExp(r)?r.test(t):void 0:void 0)}class jt{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Et(t);if(!o)throw new Error("header name must be a non-empty string");const s=Je.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=St(e))}const s=(e,t)=>Je.forEach(e,((e,n)=>o(e,n,t)));if(Je.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(Je.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&xt[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(Je.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=Et(e)){const n=Je.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Je.isFunction(t))return t.call(this,e,n);if(Je.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Et(e)){const n=Je.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ot(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Et(e)){const o=Je.findKey(n,e);!o||t&&!Ot(0,n[o],o,t)||(delete n[o],r=!0)}}return Je.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Ot(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Je.forEach(this,((r,o)=>{const s=Je.findKey(n,o);if(s)return t[s]=St(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=St(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Je.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Je.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[vt]=this[vt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Et(e);t[r]||(function(e,t){const n=Je.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return Je.isArray(e)?e.forEach(r):r(e),this}}jt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Je.reduceDescriptors(jt.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Je.freezeMethods(jt);const Rt=jt;function Tt(e,t){const n=this||wt,r=t||n,o=Rt.from(r.headers);let s=r.data;return Je.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function At(e){return!(!e||!e.__CANCEL__)}function Ct(e,t,n){Ge.call(this,null==e?"canceled":e,Ge.ERR_CANCELED,t,n),this.name="CanceledError"}Je.inherits(Ct,Ge,{__CANCEL__:!0});const Nt=Ct;function Pt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ge("Request failed with status code "+n.status,[Ge.ERR_BAD_REQUEST,Ge.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const kt=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let d=i,u=0;for(;d!==s;)u+=n[d++],d%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(1e3*u/p):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout((()=>{r=null,i(n)}),s-a)))},()=>n&&i(n)]}((n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s,e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),n)},Dt=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ft=e=>(...t)=>Je.asap((()=>e(...t))),Ut=gt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,gt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(gt.origin),gt.navigator&&/(msie|trident)/i.test(gt.navigator.userAgent)):()=>!0,Lt=gt.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];Je.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Je.isString(r)&&i.push("path="+r),Je.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function _t(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Bt=e=>e instanceof Rt?{...e}:e;function It(e,t){t=t||{};const n={};function r(e,t,n,r){return Je.isPlainObject(e)&&Je.isPlainObject(t)?Je.merge.call({caseless:r},e,t):Je.isPlainObject(t)?Je.merge({},t):Je.isArray(t)?t.slice():t}function o(e,t,n,o){return Je.isUndefined(t)?Je.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!Je.isUndefined(t))return r(void 0,t)}function i(e,t){return Je.isUndefined(t)?Je.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(Bt(e),Bt(t),0,!0)};return Je.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);Je.isUndefined(i)&&s!==a||(n[r]=i)})),n}const qt=e=>{const t=It({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:c}=t;if(t.headers=a=Rt.from(a),t.url=at(_t(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Je.isFormData(r))if(gt.hasStandardBrowserEnv||gt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(gt.hasStandardBrowserEnv&&(o&&Je.isFunction(o)&&(o=o(t)),o||!1!==o&&Ut(t.url))){const e=s&&i&&Lt.read(i);e&&a.set(s,e)}return t},Mt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=qt(e);let o=r.data;const s=Rt.from(r.headers).normalize();let i,a,c,l,d,{responseType:u,onUploadProgress:p,onDownloadProgress:f}=r;function h(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Rt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Pt((function(e){t(e),h()}),(function(e){n(e),h()}),{data:u&&"text"!==u&&"json"!==u?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Ge("Request aborted",Ge.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Ge("Network Error",Ge.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||lt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ge(t,o.clarifyTimeoutError?Ge.ETIMEDOUT:Ge.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&Je.forEach(s.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),Je.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),u&&"json"!==u&&(m.responseType=r.responseType),f&&([c,d]=kt(f,!0),m.addEventListener("progress",c)),p&&m.upload&&([a,l]=kt(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new Nt(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===gt.protocols.indexOf(y)?n(new Ge("Unsupported protocol "+y+":",Ge.ERR_BAD_REQUEST,e)):m.send(o||null)}))},$t=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ge?t:new Nt(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,o(new Ge(`timeout ${t} of ms exceeded`,Ge.ETIMEDOUT))}),t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>Je.asap(i),a}},zt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ht=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*zt(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},Wt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Jt=Wt&&"function"==typeof ReadableStream,Kt=Wt&&("function"==typeof TextEncoder?(Vt=new TextEncoder,e=>Vt.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Vt;const Xt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Gt=Jt&&Xt((()=>{let e=!1;const t=new Request(gt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Qt=Jt&&Xt((()=>Je.isReadableStream(new Response("").body))),Zt={stream:Qt&&(e=>e.body)};var Yt;Wt&&(Yt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Zt[e]&&(Zt[e]=Je.isFunction(Yt[e])?t=>t[e]():(t,n)=>{throw new Ge(`Response type '${e}' is not supported`,Ge.ERR_NOT_SUPPORT,n)})})));const en={http:null,xhr:Mt,fetch:Wt&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:d,withCredentials:u="same-origin",fetchOptions:p}=qt(e);l=l?(l+"").toLowerCase():"text";let f,h=$t([o,s&&s.toAbortSignal()],i);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(c&&Gt&&"get"!==n&&"head"!==n&&0!==(g=await(async(e,t)=>{const n=Je.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Je.isBlob(e))return e.size;if(Je.isSpecCompliantForm(e)){const t=new Request(gt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Je.isArrayBufferView(e)||Je.isArrayBuffer(e)?e.byteLength:(Je.isURLSearchParams(e)&&(e+=""),Je.isString(e)?(await Kt(e)).byteLength:void 0)})(t):n})(d,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(Je.isFormData(r)&&(e=n.headers.get("content-type"))&&d.setContentType(e),n.body){const[e,t]=Dt(g,kt(Ft(c)));r=Ht(n.body,65536,e,t)}}Je.isString(u)||(u=u?"include":"omit");const o="credentials"in Request.prototype;f=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:o?u:void 0});let s=await fetch(f);const i=Qt&&("stream"===l||"response"===l);if(Qt&&(a||i&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=Je.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&Dt(t,kt(Ft(a),!0))||[];s=new Response(Ht(s.body,65536,n,(()=>{r&&r(),m&&m()})),e)}l=l||"text";let y=await Zt[Je.findKey(Zt,l)||"text"](s,e);return!i&&m&&m(),await new Promise(((t,n)=>{Pt(t,n,{data:y,headers:Rt.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:f})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Ge("Network Error",Ge.ERR_NETWORK,e,f),{cause:t.cause||t});throw Ge.from(t,t&&t.code,e,f)}})};Je.forEach(en,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const tn=e=>`- ${e}`,nn=e=>Je.isFunction(e)||null===e||!1===e,rn=e=>{e=Je.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!nn(n)&&(r=en[(t=String(n)).toLowerCase()],void 0===r))throw new Ge(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(tn).join("\n"):" "+tn(e[0]):"as no adapter specified";throw new Ge("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function on(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function sn(e){return on(e),e.headers=Rt.from(e.headers),e.data=Tt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),rn(e.adapter||wt.adapter)(e).then((function(t){return on(e),t.data=Tt.call(e,e.transformResponse,t),t.headers=Rt.from(t.headers),t}),(function(t){return At(t)||(on(e),t&&t.response&&(t.response.data=Tt.call(e,e.transformResponse,t.response),t.response.headers=Rt.from(t.response.headers))),Promise.reject(t)}))}const an={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{an[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const cn={};an.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.9] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new Ge(r(o," has been removed"+(t?" in "+t:"")),Ge.ERR_DEPRECATED);return t&&!cn[o]&&(cn[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},an.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const ln={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ge("options must be an object",Ge.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new Ge("option "+s+" must be "+n,Ge.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ge("Unknown option "+s,Ge.ERR_BAD_OPTION)}},validators:an},dn=ln.validators;class un{constructor(e){this.defaults=e,this.interceptors={request:new ct,response:new ct}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=It(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ln.assertOptions(n,{silentJSONParsing:dn.transitional(dn.boolean),forcedJSONParsing:dn.transitional(dn.boolean),clarifyTimeoutError:dn.transitional(dn.boolean)},!1),null!=r&&(Je.isFunction(r)?t.paramsSerializer={serialize:r}:ln.assertOptions(r,{encode:dn.function,serialize:dn.function},!0)),ln.assertOptions(t,{baseUrl:dn.spelling("baseURL"),withXsrfToken:dn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&Je.merge(o.common,o[t.method]);o&&Je.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Rt.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,u=0;if(!a){const e=[sn.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=i.length;let p=t;for(u=0;u<d;){const e=i[u++],t=i[u++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=sn.call(this,p)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return at(_t((e=It(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Je.forEach(["delete","get","head","options"],(function(e){un.prototype[e]=function(t,n){return this.request(It(n||{},{method:e,url:t,data:(n||{}).data}))}})),Je.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(It(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}un.prototype[e]=t(),un.prototype[e+"Form"]=t(!0)}));const pn=un;class fn{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Nt(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new fn((function(t){e=t}));return{token:t,cancel:e}}}const hn=fn,mn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(mn).forEach((([e,t])=>{mn[t]=e}));const gn=mn,yn=function e(t){const n=new pn(t),r=ne(pn.prototype.request,n);return Je.extend(r,pn.prototype,n,{allOwnKeys:!0}),Je.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(It(t,n))},r}(wt);yn.Axios=pn,yn.CanceledError=Nt,yn.CancelToken=hn,yn.isCancel=At,yn.VERSION="1.7.9",yn.toFormData=tt,yn.AxiosError=Ge,yn.Cancel=yn.CanceledError,yn.all=function(e){return Promise.all(e)},yn.spread=function(e){return function(t){return e.apply(null,t)}},yn.isAxiosError=function(e){return Je.isObject(e)&&!0===e.isAxiosError},yn.mergeConfig=It,yn.AxiosHeaders=Rt,yn.formToJSON=e=>yt(Je.isHTMLForm(e)?new FormData(e):e),yn.getAdapter=rn,yn.HttpStatusCode=gn,yn.default=yn;const bn=yn,wn=({onIpAdded:e})=>{const[t,r]=(0,n.useState)(""),[o,s]=(0,n.useState)(""),[i,a]=(0,n.useState)(""),[c,l]=(0,n.useState)(""),[d,u]=(0,n.useState)("Save Settings"),[p,f]=(0,n.useState)([]),[h,m]=(0,n.useState)(""),[g,y]=(0,n.useState)(""),[b,w]=(0,n.useState)(""),[x,v]=(0,n.useState)("");return(0,n.useEffect)((()=>{bn.get(`${blocipadwoo.apiUrl}/wp/v2/product_cat`).then((e=>{f(e.data)})).catch((()=>{f([])}))}),[]),(0,ee.jsx)("form",{onSubmit:n=>{if(n.preventDefault(),u("Saving..."),console.log("IP Address:",t),!/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$|^([a-fA-F0-9:]+:+)+[a-fA-F0-9]+$/.test(t))return Y.error("Invalid IP address! Please enter a valid IP.",{position:"top-center",duration:4e3,style:{color:"#D32F2F",marginTop:"20px",padding:"10px"}}),void u("Save Settings");const d=new Date(i);if(new Date(c)<=d)return Y.error("End Date must be later than Start Date",{position:"top-center",duration:4e3,style:{color:"#D32F2F",marginTop:"20px",padding:"10px"}}),void u("Save Settings");console.log("IP Address:");let p=x,f="category"===x?b:"";bn.post(`${blocipadwoo.apiUrl}/wooip/v1/new_ip`,{ipaddress:t,blocktype:p,blkcategory:f,redirect:o,startdate:i,enddate:c},{headers:{"Content-Type":"application/json","X-WP-NONCE":blocipadwoo.nonce}}).then((t=>{const n=t?.data;"success"===n?.status?(Y.success(n.message,{position:"top-center",duration:4e3,style:{color:"#2e7d32",marginTop:"20px",padding:"10px"}}),r(""),s(""),a(""),l(""),m(""),y(""),e?.()):"error"===n?.status&&Y.error(n.message,{position:"top-center",duration:4e3,style:{color:"#D32F2F",marginTop:"20px",padding:"10px"}}),u("Save Settings")})).catch((e=>{Y.error("Something went wrong. Please try again.",{position:"top-center",duration:4e3,style:{background:"#fff3cd",color:"#856404",padding:"12px"}}),u("Save Settings")}))},children:(0,ee.jsxs)("div",{className:"form-section",children:[(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{children:"Page Option :"}),(0,ee.jsxs)("div",{style:{display:"flex",gap:"20px",marginBottom:"10px"},children:[(0,ee.jsxs)("label",{children:[(0,ee.jsx)("input",{type:"radio",name:"pageOption",value:"home",checked:"home"===x,onChange:()=>v("home")}),"Home Page"]}),(0,ee.jsxs)("label",{children:[(0,ee.jsx)("input",{type:"radio",name:"pageOption",value:"shop",checked:"shop"===x,onChange:()=>v("shop")}),"Shop Page"]}),(0,ee.jsxs)("label",{children:[(0,ee.jsx)("input",{type:"radio",name:"pageOption",value:"category",checked:"category"===x,onChange:()=>v("category")}),"Category"]})]})]}),"category"===x&&(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{htmlFor:"product-category",children:"Product Category :"}),(0,ee.jsxs)("select",{id:"product-category",value:b,onChange:e=>w(e.target.value),children:[(0,ee.jsx)("option",{value:"",children:"Select a category"}),p.map((e=>(0,ee.jsx)("option",{value:e.name,children:e.name},e.id)))]})]}),(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{htmlFor:"ipaddress",children:"Ip Address :"}),(0,ee.jsx)("input",{type:"text",name:"ipaddress",id:"ipaddress",placeholder:"Type your block IP address",value:t,onChange:e=>r(e.target.value)})]}),(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{htmlFor:"redirect",children:"Redirect URL :"}),(0,ee.jsx)("input",{type:"url",name:"redirect",id:"redirect",placeholder:"Redirect Url",value:o,onChange:e=>s(e.target.value)})]}),(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{htmlFor:"startdate",children:"Start Date :"}),(0,ee.jsx)("input",{type:"date",name:"startdate",id:"startdate",value:i,onChange:e=>a(e.target.value)})]}),(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{htmlFor:"enddate",children:"End Date :"}),(0,ee.jsx)("input",{type:"date",name:"enddate",id:"enddate",value:c,onChange:e=>l(e.target.value)})]}),(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("div",{className:"col-sm-4",children:(0,ee.jsx)("button",{type:"submit",className:"button button-primary",children:d})}),(0,ee.jsx)("div",{className:"col-sm-8"})]})]})})},xn=({blockedIps:e=[],refresh:t})=>{const[r,o]=(0,n.useState)(null),[s,i]=(0,n.useState)(""),[a,c]=(0,n.useState)(""),[l,d]=(0,n.useState)(""),[u,p]=(0,n.useState)(""),[f,h]=(0,n.useState)(""),[m,g]=(0,n.useState)("");return(0,ee.jsxs)("div",{className:"table-container",children:[(0,ee.jsx)("div",{className:"section-title",children:"Blocked IP List"}),(0,ee.jsxs)("table",{children:[(0,ee.jsx)("thead",{children:(0,ee.jsxs)("tr",{children:[(0,ee.jsx)("th",{children:"IP Address"}),(0,ee.jsx)("th",{children:"Redirect URL"}),(0,ee.jsx)("th",{children:"Block Type"}),(0,ee.jsx)("th",{children:"Block Category"}),(0,ee.jsx)("th",{children:"Start Date"}),(0,ee.jsx)("th",{children:"End Date"}),(0,ee.jsx)("th",{children:"Action"})]})}),(0,ee.jsx)("tbody",{children:e.length>0?e.map(((e,n)=>(0,ee.jsxs)("tr",{children:[(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"text",value:s,onChange:e=>i(e.target.value)}):e.ipaddress}),(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"text",value:a,onChange:e=>c(e.target.value)}):e.redirect}),(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"text",value:f,onChange:e=>h(e.target.value)}):e.blocktype}),(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"text",value:m,onChange:e=>g(e.target.value)}):e.blkcategory}),(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"date",value:l,onChange:e=>d(e.target.value)}):e.startdate}),(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"date",value:u,onChange:e=>p(e.target.value)}):e.enddate}),(0,ee.jsxs)("td",{children:[r===n?(0,ee.jsx)("button",{className:"btn btn-edit",onClick:()=>(e=>{if(!/^(?:(?:25[0-5]|2[0-4][0-9]|1\d{2}|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4][0-9]|1\d{2}|[1-9]?\d)$|^([a-fA-F0-9:]+:+)+[a-fA-F0-9]+$/.test(s))return void alert("❌ Invalid IP address format.");if(a&&!/^(https?:\/\/)?([\w\-])+(\.[\w\-]+)+[/#?]?.*$/.test(a))return void alert("❌ Invalid Redirect URL format.");const n=new Date(l);new Date(u)<=n?alert("❌ End date must be later than start date."):bn.post(`${blocipadwoo.apiUrl}/wprk/v1/update_blkip`,{id:e.id,ipaddress:s,blocktype:f,blkcategory:m,redirect:a,startdate:l,enddate:u},{headers:{"Content-Type":"application/json","X-WP-NONCE":blocipadwoo.nonce}}).then((()=>{alert("IP updated successfully!"),o(null),t()})).catch((e=>console.error("Error updating IP:",e)))})(e),children:"Update"}):(0,ee.jsx)("button",{className:"btn btn-edit",onClick:()=>((e,t)=>{o(e),i(t.ipaddress),h(t.blocktype),g(t.blkcategory),c(t.redirect),d(t.startdate),p(t.enddate)})(n,e),children:"Edit"}),(0,ee.jsx)("button",{className:"btn btn-delete",onClick:()=>{return n=e.id,void(window.confirm("Are you sure you want to delete this blocked IP?")&&bn.post(`${blocipadwoo.apiUrl}/wprk/v1/delete_blkip`,{id:n},{headers:{"Content-Type":"application/json","X-WP-NONCE":blocipadwoo.nonce}}).then((()=>{alert("IP deleted successfully!"),t()})).catch((e=>console.error("Error deleting IP:",e))));var n},style:{marginLeft:"10px"},children:"Delete"})]})]},e.id))):(0,ee.jsx)("tr",{children:(0,ee.jsx)("td",{colSpan:"5",children:"No blocked IPs found."})})})]})]})},vn=()=>{const[e,t]=(0,n.useState)([]),[r,o]=(0,n.useState)(!0),s=()=>{bn.get(`${blocipadwoo.apiUrl}/wprk/v1/get_blkip`,{headers:{"Content-Type":"application/json","X-WP-NONCE":blocipadwoo.nonce}}).then((e=>{t(e.data),o(!1)})).catch((e=>{console.error("Error fetching blocked IPs:",e),o(!1)}))};return(0,n.useEffect)((()=>{s()}),[]),(0,ee.jsxs)("div",{children:[(0,ee.jsx)(wn,{onIpAdded:s}),(0,ee.jsx)(xn,{blockedIps:e,loading:r,refresh:s})]})};document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("ip-admin");ReactDOM.render((0,ee.jsx)(te,{}),e)}));let En=document.getElementById("new-ipaddress");En&&ReactDOM.render((0,ee.jsx)(vn,{}),En);let Sn=document.getElementById("view-iplist");Sn&&ReactDOM.render((0,ee.jsx)(xn,{}),Sn)})();
     171`,Z=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:o,children:s,containerStyle:i,containerClassName:a})=>{let{toasts:c,handlers:l}=(e=>{let{toasts:t,pausedAt:r}=((e={})=>{let[t,r]=(0,n.useState)(S),o=(0,n.useRef)(S);(0,n.useEffect)((()=>(o.current!==S&&r(S),E.push(r),()=>{let e=E.indexOf(r);e>-1&&E.splice(e,1)})),[]);let s=t.toasts.map((t=>{var n,r,o;return{...e,...e[t.type],...t,removeDelay:t.removeDelay||(null==(n=e[t.type])?void 0:n.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)||j[t.type],style:{...e.style,...null==(o=e[t.type])?void 0:o.style,...t.style}}}));return{...t,toasts:s}})(e);(0,n.useEffect)((()=>{if(r)return;let e=Date.now(),n=t.map((t=>{if(t.duration===1/0)return;let n=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(n<0))return setTimeout((()=>T.dismiss(t.id)),n);t.visible&&T.dismiss(t.id)}));return()=>{n.forEach((e=>e&&clearTimeout(e)))}}),[t,r]);let o=(0,n.useCallback)((()=>{r&&O({type:6,time:Date.now()})}),[r]),s=(0,n.useCallback)(((e,n)=>{let{reverseOrder:r=!1,gutter:o=8,defaultPosition:s}=n||{},i=t.filter((t=>(t.position||s)===(e.position||s)&&t.height)),a=i.findIndex((t=>t.id===e.id)),c=i.filter(((e,t)=>t<a&&e.visible)).length;return i.filter((e=>e.visible)).slice(...r?[c+1]:[0,c]).reduce(((e,t)=>e+(t.height||0)+o),0)}),[t]);return(0,n.useEffect)((()=>{t.forEach((e=>{if(e.dismissed)((e,t=1e3)=>{if(N.has(e))return;let n=setTimeout((()=>{N.delete(e),O({type:4,toastId:e})}),t);N.set(e,n)})(e.id,e.removeDelay);else{let t=N.get(e.id);t&&(clearTimeout(t),N.delete(e.id))}}))}),[t]),{toasts:t,handlers:{updateHeight:A,startPause:C,endPause:o,calculateOffset:s}}})(r);return n.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...i},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},c.map((r=>{let i=r.position||t,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:x()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}})(i,l.calculateOffset(r,{reverseOrder:e,gutter:o,defaultPosition:t}));return n.createElement(G,{id:r.id,key:r.id,onHeightUpdate:l.updateHeight,className:r.visible?Q:"",style:a},"custom"===r.type?b(r.message,r):s?s(r):n.createElement(X,{toast:r,position:i}))})))},Y=T;const ee=window.ReactJSXRuntime,te=function(){return(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)("h1",{children:" Add Block IP "}),(0,ee.jsx)(Z,{position:"top-center"})]})};function ne(e,t){return function(){return e.apply(t,arguments)}}const{toString:re}=Object.prototype,{getPrototypeOf:oe}=Object,se=(ie=Object.create(null),e=>{const t=re.call(e);return ie[t]||(ie[t]=t.slice(8,-1).toLowerCase())});var ie;const ae=e=>(e=e.toLowerCase(),t=>se(t)===e),ce=e=>t=>typeof t===e,{isArray:le}=Array,de=ce("undefined"),ue=ae("ArrayBuffer"),pe=ce("string"),fe=ce("function"),he=ce("number"),me=e=>null!==e&&"object"==typeof e,ge=e=>{if("object"!==se(e))return!1;const t=oe(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ye=ae("Date"),be=ae("File"),we=ae("Blob"),xe=ae("FileList"),ve=ae("URLSearchParams"),[Ee,Se,Oe,je]=["ReadableStream","Request","Response","Headers"].map(ae);function Re(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),le(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function Te(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ce=e=>!de(e)&&e!==Ae,Ne=(Pe="undefined"!=typeof Uint8Array&&oe(Uint8Array),e=>Pe&&e instanceof Pe);var Pe;const ke=ae("HTMLFormElement"),De=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Fe=ae("RegExp"),Ue=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Re(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},Le="abcdefghijklmnopqrstuvwxyz",_e="0123456789",Be={DIGIT:_e,ALPHA:Le,ALPHA_DIGIT:Le+Le.toUpperCase()+_e},Ie=ae("AsyncFunction"),qe=(Me="function"==typeof setImmediate,$e=fe(Ae.postMessage),Me?setImmediate:$e?(ze=`axios@${Math.random()}`,He=[],Ae.addEventListener("message",(({source:e,data:t})=>{e===Ae&&t===ze&&He.length&&He.shift()()}),!1),e=>{He.push(e),Ae.postMessage(ze,"*")}):e=>setTimeout(e));var Me,$e,ze,He;const We="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Ae):"undefined"!=typeof process&&process.nextTick||qe,Je={isArray:le,isArrayBuffer:ue,isBuffer:function(e){return null!==e&&!de(e)&&null!==e.constructor&&!de(e.constructor)&&fe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||fe(e.append)&&("formdata"===(t=se(e))||"object"===t&&fe(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ue(e.buffer),t},isString:pe,isNumber:he,isBoolean:e=>!0===e||!1===e,isObject:me,isPlainObject:ge,isReadableStream:Ee,isRequest:Se,isResponse:Oe,isHeaders:je,isUndefined:de,isDate:ye,isFile:be,isBlob:we,isRegExp:Fe,isFunction:fe,isStream:e=>me(e)&&fe(e.pipe),isURLSearchParams:ve,isTypedArray:Ne,isFileList:xe,forEach:Re,merge:function e(){const{caseless:t}=Ce(this)&&this||{},n={},r=(r,o)=>{const s=t&&Te(n,o)||o;ge(n[s])&&ge(r)?n[s]=e(n[s],r):ge(r)?n[s]=e({},r):le(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Re(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(Re(t,((t,r)=>{n&&fe(t)?e[r]=ne(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&oe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:se,kindOfTest:ae,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(le(e))return e;let t=e.length;if(!he(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ke,hasOwnProperty:De,hasOwnProp:De,reduceDescriptors:Ue,freezeMethods:e=>{Ue(e,((t,n)=>{if(fe(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];fe(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return le(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Te,global:Ae,isContextDefined:Ce,ALPHABET:Be,generateString:(e=16,t=Be.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&fe(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(me(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=le(e)?[]:{};return Re(e,((e,t)=>{const s=n(e,r+1);!de(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Ie,isThenable:e=>e&&(me(e)||fe(e))&&fe(e.then)&&fe(e.catch),setImmediate:qe,asap:We};function Ke(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Je.inherits(Ke,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Je.toJSONObject(this.config),code:this.code,status:this.status}}});const Ve=Ke.prototype,Xe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Xe[e]={value:e}})),Object.defineProperties(Ke,Xe),Object.defineProperty(Ve,"isAxiosError",{value:!0}),Ke.from=(e,t,n,r,o,s)=>{const i=Object.create(Ve);return Je.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ke.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const Ge=Ke;function Qe(e){return Je.isPlainObject(e)||Je.isArray(e)}function Ze(e){return Je.endsWith(e,"[]")?e.slice(0,-2):e}function Ye(e,t,n){return e?e.concat(t).map((function(e,t){return e=Ze(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const et=Je.toFlatObject(Je,{},null,(function(e){return/^is[A-Z]/.test(e)})),tt=function(e,t,n){if(!Je.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Je.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Je.isUndefined(t[e])}))).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Je.isSpecCompliantForm(t);if(!Je.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Je.isDate(e))return e.toISOString();if(!a&&Je.isBlob(e))throw new Ge("Blob is not supported. Use a Buffer instead.");return Je.isArrayBuffer(e)||Je.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(Je.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Je.isArray(e)&&function(e){return Je.isArray(e)&&!e.some(Qe)}(e)||(Je.isFileList(e)||Je.endsWith(n,"[]"))&&(a=Je.toArray(e)))return n=Ze(n),a.forEach((function(e,r){!Je.isUndefined(e)&&null!==e&&t.append(!0===i?Ye([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!Qe(e)||(t.append(Ye(o,n,s),c(e)),!1)}const d=[],u=Object.assign(et,{defaultVisitor:l,convertValue:c,isVisitable:Qe});if(!Je.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Je.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+r.join("."));d.push(n),Je.forEach(n,(function(n,s){!0===(!(Je.isUndefined(n)||null===n)&&o.call(t,n,Je.isString(s)?s.trim():s,r,u))&&e(n,r?r.concat(s):[s])})),d.pop()}}(e),t};function nt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function rt(e,t){this._pairs=[],e&&tt(e,this,t)}const ot=rt.prototype;ot.append=function(e,t){this._pairs.push([e,t])},ot.toString=function(e){const t=e?function(t){return e.call(this,t,nt)}:nt;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const st=rt;function it(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function at(e,t,n){if(!t)return e;const r=n&&n.encode||it;Je.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):Je.isURLSearchParams(t)?t.toString():new st(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const ct=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Je.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},lt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:st,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ut="undefined"!=typeof window&&"undefined"!=typeof document,pt="object"==typeof navigator&&navigator||void 0,ft=ut&&(!pt||["ReactNative","NativeScript","NS"].indexOf(pt.product)<0),ht="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,mt=ut&&window.location.href||"http://localhost",gt={...t,...dt},yt=function(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&Je.isArray(r)?r.length:s,a?(Je.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i):(r[s]&&Je.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&Je.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(Je.isFormData(e)&&Je.isFunction(e.entries)){const n={};return Je.forEachEntry(e,((e,r)=>{t(function(e){return Je.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},bt={transitional:lt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Je.isObject(e);if(o&&Je.isHTMLForm(e)&&(e=new FormData(e)),Je.isFormData(e))return r?JSON.stringify(yt(e)):e;if(Je.isArrayBuffer(e)||Je.isBuffer(e)||Je.isStream(e)||Je.isFile(e)||Je.isBlob(e)||Je.isReadableStream(e))return e;if(Je.isArrayBufferView(e))return e.buffer;if(Je.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return tt(e,new gt.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return gt.isNode&&Je.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=Je.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return tt(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e){if(Je.isString(e))try{return(0,JSON.parse)(e),Je.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||bt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Je.isResponse(e)||Je.isReadableStream(e))return e;if(e&&Je.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Ge.from(e,Ge.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gt.classes.FormData,Blob:gt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Je.forEach(["delete","get","head","post","put","patch"],(e=>{bt.headers[e]={}}));const wt=bt,xt=Je.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),vt=Symbol("internals");function Et(e){return e&&String(e).trim().toLowerCase()}function St(e){return!1===e||null==e?e:Je.isArray(e)?e.map(St):String(e)}function Ot(e,t,n,r,o){return Je.isFunction(r)?r.call(this,t,n):(o&&(t=n),Je.isString(t)?Je.isString(r)?-1!==t.indexOf(r):Je.isRegExp(r)?r.test(t):void 0:void 0)}class jt{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Et(t);if(!o)throw new Error("header name must be a non-empty string");const s=Je.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=St(e))}const s=(e,t)=>Je.forEach(e,((e,n)=>o(e,n,t)));if(Je.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(Je.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&xt[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(Je.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=Et(e)){const n=Je.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Je.isFunction(t))return t.call(this,e,n);if(Je.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Et(e)){const n=Je.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ot(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Et(e)){const o=Je.findKey(n,e);!o||t&&!Ot(0,n[o],o,t)||(delete n[o],r=!0)}}return Je.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Ot(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Je.forEach(this,((r,o)=>{const s=Je.findKey(n,o);if(s)return t[s]=St(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=St(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Je.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Je.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[vt]=this[vt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Et(e);t[r]||(function(e,t){const n=Je.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return Je.isArray(e)?e.forEach(r):r(e),this}}jt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Je.reduceDescriptors(jt.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Je.freezeMethods(jt);const Rt=jt;function Tt(e,t){const n=this||wt,r=t||n,o=Rt.from(r.headers);let s=r.data;return Je.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function At(e){return!(!e||!e.__CANCEL__)}function Ct(e,t,n){Ge.call(this,null==e?"canceled":e,Ge.ERR_CANCELED,t,n),this.name="CanceledError"}Je.inherits(Ct,Ge,{__CANCEL__:!0});const Nt=Ct;function Pt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ge("Request failed with status code "+n.status,[Ge.ERR_BAD_REQUEST,Ge.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const kt=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let d=i,u=0;for(;d!==s;)u+=n[d++],d%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(1e3*u/p):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout((()=>{r=null,i(n)}),s-a)))},()=>n&&i(n)]}((n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s,e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),n)},Dt=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ft=e=>(...t)=>Je.asap((()=>e(...t))),Ut=gt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,gt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(gt.origin),gt.navigator&&/(msie|trident)/i.test(gt.navigator.userAgent)):()=>!0,Lt=gt.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];Je.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Je.isString(r)&&i.push("path="+r),Je.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function _t(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Bt=e=>e instanceof Rt?{...e}:e;function It(e,t){t=t||{};const n={};function r(e,t,n,r){return Je.isPlainObject(e)&&Je.isPlainObject(t)?Je.merge.call({caseless:r},e,t):Je.isPlainObject(t)?Je.merge({},t):Je.isArray(t)?t.slice():t}function o(e,t,n,o){return Je.isUndefined(t)?Je.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!Je.isUndefined(t))return r(void 0,t)}function i(e,t){return Je.isUndefined(t)?Je.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(Bt(e),Bt(t),0,!0)};return Je.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);Je.isUndefined(i)&&s!==a||(n[r]=i)})),n}const qt=e=>{const t=It({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:c}=t;if(t.headers=a=Rt.from(a),t.url=at(_t(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Je.isFormData(r))if(gt.hasStandardBrowserEnv||gt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(gt.hasStandardBrowserEnv&&(o&&Je.isFunction(o)&&(o=o(t)),o||!1!==o&&Ut(t.url))){const e=s&&i&&Lt.read(i);e&&a.set(s,e)}return t},Mt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=qt(e);let o=r.data;const s=Rt.from(r.headers).normalize();let i,a,c,l,d,{responseType:u,onUploadProgress:p,onDownloadProgress:f}=r;function h(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Rt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Pt((function(e){t(e),h()}),(function(e){n(e),h()}),{data:u&&"text"!==u&&"json"!==u?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Ge("Request aborted",Ge.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Ge("Network Error",Ge.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||lt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ge(t,o.clarifyTimeoutError?Ge.ETIMEDOUT:Ge.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&Je.forEach(s.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),Je.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),u&&"json"!==u&&(m.responseType=r.responseType),f&&([c,d]=kt(f,!0),m.addEventListener("progress",c)),p&&m.upload&&([a,l]=kt(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new Nt(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===gt.protocols.indexOf(y)?n(new Ge("Unsupported protocol "+y+":",Ge.ERR_BAD_REQUEST,e)):m.send(o||null)}))},$t=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ge?t:new Nt(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,o(new Ge(`timeout ${t} of ms exceeded`,Ge.ETIMEDOUT))}),t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>Je.asap(i),a}},zt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ht=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*zt(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},Wt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Jt=Wt&&"function"==typeof ReadableStream,Kt=Wt&&("function"==typeof TextEncoder?(Vt=new TextEncoder,e=>Vt.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Vt;const Xt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Gt=Jt&&Xt((()=>{let e=!1;const t=new Request(gt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Qt=Jt&&Xt((()=>Je.isReadableStream(new Response("").body))),Zt={stream:Qt&&(e=>e.body)};var Yt;Wt&&(Yt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Zt[e]&&(Zt[e]=Je.isFunction(Yt[e])?t=>t[e]():(t,n)=>{throw new Ge(`Response type '${e}' is not supported`,Ge.ERR_NOT_SUPPORT,n)})})));const en={http:null,xhr:Mt,fetch:Wt&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:d,withCredentials:u="same-origin",fetchOptions:p}=qt(e);l=l?(l+"").toLowerCase():"text";let f,h=$t([o,s&&s.toAbortSignal()],i);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(c&&Gt&&"get"!==n&&"head"!==n&&0!==(g=await(async(e,t)=>{const n=Je.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Je.isBlob(e))return e.size;if(Je.isSpecCompliantForm(e)){const t=new Request(gt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Je.isArrayBufferView(e)||Je.isArrayBuffer(e)?e.byteLength:(Je.isURLSearchParams(e)&&(e+=""),Je.isString(e)?(await Kt(e)).byteLength:void 0)})(t):n})(d,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(Je.isFormData(r)&&(e=n.headers.get("content-type"))&&d.setContentType(e),n.body){const[e,t]=Dt(g,kt(Ft(c)));r=Ht(n.body,65536,e,t)}}Je.isString(u)||(u=u?"include":"omit");const o="credentials"in Request.prototype;f=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:o?u:void 0});let s=await fetch(f);const i=Qt&&("stream"===l||"response"===l);if(Qt&&(a||i&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=Je.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&Dt(t,kt(Ft(a),!0))||[];s=new Response(Ht(s.body,65536,n,(()=>{r&&r(),m&&m()})),e)}l=l||"text";let y=await Zt[Je.findKey(Zt,l)||"text"](s,e);return!i&&m&&m(),await new Promise(((t,n)=>{Pt(t,n,{data:y,headers:Rt.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:f})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Ge("Network Error",Ge.ERR_NETWORK,e,f),{cause:t.cause||t});throw Ge.from(t,t&&t.code,e,f)}})};Je.forEach(en,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const tn=e=>`- ${e}`,nn=e=>Je.isFunction(e)||null===e||!1===e,rn=e=>{e=Je.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!nn(n)&&(r=en[(t=String(n)).toLowerCase()],void 0===r))throw new Ge(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(tn).join("\n"):" "+tn(e[0]):"as no adapter specified";throw new Ge("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function on(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function sn(e){return on(e),e.headers=Rt.from(e.headers),e.data=Tt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),rn(e.adapter||wt.adapter)(e).then((function(t){return on(e),t.data=Tt.call(e,e.transformResponse,t),t.headers=Rt.from(t.headers),t}),(function(t){return At(t)||(on(e),t&&t.response&&(t.response.data=Tt.call(e,e.transformResponse,t.response),t.response.headers=Rt.from(t.response.headers))),Promise.reject(t)}))}const an={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{an[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const cn={};an.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.9] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new Ge(r(o," has been removed"+(t?" in "+t:"")),Ge.ERR_DEPRECATED);return t&&!cn[o]&&(cn[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},an.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const ln={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ge("options must be an object",Ge.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new Ge("option "+s+" must be "+n,Ge.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ge("Unknown option "+s,Ge.ERR_BAD_OPTION)}},validators:an},dn=ln.validators;class un{constructor(e){this.defaults=e,this.interceptors={request:new ct,response:new ct}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=It(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ln.assertOptions(n,{silentJSONParsing:dn.transitional(dn.boolean),forcedJSONParsing:dn.transitional(dn.boolean),clarifyTimeoutError:dn.transitional(dn.boolean)},!1),null!=r&&(Je.isFunction(r)?t.paramsSerializer={serialize:r}:ln.assertOptions(r,{encode:dn.function,serialize:dn.function},!0)),ln.assertOptions(t,{baseUrl:dn.spelling("baseURL"),withXsrfToken:dn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&Je.merge(o.common,o[t.method]);o&&Je.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Rt.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,u=0;if(!a){const e=[sn.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=i.length;let p=t;for(u=0;u<d;){const e=i[u++],t=i[u++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=sn.call(this,p)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return at(_t((e=It(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Je.forEach(["delete","get","head","options"],(function(e){un.prototype[e]=function(t,n){return this.request(It(n||{},{method:e,url:t,data:(n||{}).data}))}})),Je.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(It(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}un.prototype[e]=t(),un.prototype[e+"Form"]=t(!0)}));const pn=un;class fn{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Nt(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new fn((function(t){e=t}));return{token:t,cancel:e}}}const hn=fn,mn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(mn).forEach((([e,t])=>{mn[t]=e}));const gn=mn,yn=function e(t){const n=new pn(t),r=ne(pn.prototype.request,n);return Je.extend(r,pn.prototype,n,{allOwnKeys:!0}),Je.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(It(t,n))},r}(wt);yn.Axios=pn,yn.CanceledError=Nt,yn.CancelToken=hn,yn.isCancel=At,yn.VERSION="1.7.9",yn.toFormData=tt,yn.AxiosError=Ge,yn.Cancel=yn.CanceledError,yn.all=function(e){return Promise.all(e)},yn.spread=function(e){return function(t){return e.apply(null,t)}},yn.isAxiosError=function(e){return Je.isObject(e)&&!0===e.isAxiosError},yn.mergeConfig=It,yn.AxiosHeaders=Rt,yn.formToJSON=e=>yt(Je.isHTMLForm(e)?new FormData(e):e),yn.getAdapter=rn,yn.HttpStatusCode=gn,yn.default=yn;const bn=yn,wn=({onIpAdded:e})=>{const[t,r]=(0,n.useState)(""),[o,s]=(0,n.useState)(""),[i,a]=(0,n.useState)(""),[c,l]=(0,n.useState)(""),[d,u]=(0,n.useState)("Save Settings"),[p,f]=(0,n.useState)([]),[h,m]=(0,n.useState)(""),[g,y]=(0,n.useState)(""),[b,w]=(0,n.useState)(""),[x,v]=(0,n.useState)("");return(0,n.useEffect)((()=>{bn.get(`${blocipadwoo.apiUrl}/wooip/v1/product_categories`,{headers:{"X-WP-NONCE":blocipadwoo.nonce}}).then((e=>{f(e.data)})).catch((()=>{f([])}))}),[]),(0,ee.jsx)("form",{onSubmit:n=>{if(n.preventDefault(),u("Saving..."),console.log("IP Address:",t),!/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$|^([a-fA-F0-9:]+:+)+[a-fA-F0-9]+$/.test(t))return Y.error("Invalid IP address! Please enter a valid IP.",{position:"top-center",duration:4e3,style:{color:"#D32F2F",marginTop:"20px",padding:"10px"}}),void u("Save Settings");const d=new Date(i);if(new Date(c)<=d)return Y.error("End Date must be later than Start Date",{position:"top-center",duration:4e3,style:{color:"#D32F2F",marginTop:"20px",padding:"10px"}}),void u("Save Settings");console.log("IP Address:");let p=x,f="category"===x?b:"";bn.post(`${blocipadwoo.apiUrl}/wooip/v1/new_ip`,{ipaddress:t,blocktype:p,blkcategory:f,redirect:o,startdate:i,enddate:c},{headers:{"Content-Type":"application/json","X-WP-NONCE":blocipadwoo.nonce}}).then((t=>{const n=t?.data;"success"===n?.status?(Y.success(n.message,{position:"top-center",duration:4e3,style:{color:"#2e7d32",marginTop:"20px",padding:"10px"}}),r(""),s(""),a(""),l(""),m(""),y(""),e?.()):"error"===n?.status&&Y.error(n.message,{position:"top-center",duration:4e3,style:{color:"#D32F2F",marginTop:"20px",padding:"10px"}}),u("Save Settings")})).catch((e=>{Y.error("Something went wrong. Please try again.",{position:"top-center",duration:4e3,style:{background:"#fff3cd",color:"#856404",padding:"12px"}}),u("Save Settings")}))},children:(0,ee.jsxs)("div",{className:"form-section",children:[(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{children:"Page Option :"}),(0,ee.jsxs)("div",{style:{display:"flex",gap:"20px",marginBottom:"10px"},children:[(0,ee.jsxs)("label",{children:[(0,ee.jsx)("input",{type:"radio",name:"pageOption",value:"home",checked:"home"===x,onChange:()=>v("home")}),"Home Page"]}),(0,ee.jsxs)("label",{children:[(0,ee.jsx)("input",{type:"radio",name:"pageOption",value:"shop",checked:"shop"===x,onChange:()=>v("shop")}),"Shop Page"]}),(0,ee.jsxs)("label",{children:[(0,ee.jsx)("input",{type:"radio",name:"pageOption",value:"category",checked:"category"===x,onChange:()=>v("category")}),"Category"]})]})]}),"category"===x&&(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{htmlFor:"product-category",children:"Product Category :"}),(0,ee.jsxs)("select",{id:"product-category",value:b,onChange:e=>w(e.target.value),children:[(0,ee.jsx)("option",{value:"",children:"Select a category"}),p.map((e=>(0,ee.jsx)("option",{value:e.name,children:e.name},e.id)))]})]}),(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{htmlFor:"ipaddress",children:"Ip Address :"}),(0,ee.jsx)("input",{type:"text",name:"ipaddress",id:"ipaddress",placeholder:"Type your block IP address",value:t,onChange:e=>r(e.target.value)})]}),(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{htmlFor:"redirect",children:"Redirect URL :"}),(0,ee.jsx)("input",{type:"url",name:"redirect",id:"redirect",placeholder:"Redirect Url",value:o,onChange:e=>s(e.target.value)})]}),(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{htmlFor:"startdate",children:"Start Date :"}),(0,ee.jsx)("input",{type:"date",name:"startdate",id:"startdate",value:i,onChange:e=>a(e.target.value)})]}),(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("label",{htmlFor:"enddate",children:"End Date :"}),(0,ee.jsx)("input",{type:"date",name:"enddate",id:"enddate",value:c,onChange:e=>l(e.target.value)})]}),(0,ee.jsxs)("div",{className:"form-group",children:[(0,ee.jsx)("div",{className:"col-sm-4",children:(0,ee.jsx)("button",{type:"submit",className:"button button-primary",children:d})}),(0,ee.jsx)("div",{className:"col-sm-8"})]})]})})},xn=({blockedIps:e=[],refresh:t})=>{const[r,o]=(0,n.useState)(null),[s,i]=(0,n.useState)(""),[a,c]=(0,n.useState)(""),[l,d]=(0,n.useState)(""),[u,p]=(0,n.useState)(""),[f,h]=(0,n.useState)(""),[m,g]=(0,n.useState)("");return(0,ee.jsxs)("div",{className:"table-container",children:[(0,ee.jsx)("div",{className:"section-title",children:"Blocked IP List"}),(0,ee.jsxs)("table",{children:[(0,ee.jsx)("thead",{children:(0,ee.jsxs)("tr",{children:[(0,ee.jsx)("th",{children:"IP Address"}),(0,ee.jsx)("th",{children:"Redirect URL"}),(0,ee.jsx)("th",{children:"Block Type"}),(0,ee.jsx)("th",{children:"Block Category"}),(0,ee.jsx)("th",{children:"Start Date"}),(0,ee.jsx)("th",{children:"End Date"}),(0,ee.jsx)("th",{children:"Action"})]})}),(0,ee.jsx)("tbody",{children:e.length>0?e.map(((e,n)=>(0,ee.jsxs)("tr",{children:[(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"text",value:s,onChange:e=>i(e.target.value)}):e.ipaddress}),(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"text",value:a,onChange:e=>c(e.target.value)}):e.redirect}),(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"text",value:f,onChange:e=>h(e.target.value)}):e.blocktype}),(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"text",value:m,onChange:e=>g(e.target.value)}):e.blkcategory}),(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"date",value:l,onChange:e=>d(e.target.value)}):e.startdate}),(0,ee.jsx)("td",{children:r===n?(0,ee.jsx)("input",{type:"date",value:u,onChange:e=>p(e.target.value)}):e.enddate}),(0,ee.jsxs)("td",{children:[r===n?(0,ee.jsx)("button",{className:"btn btn-edit",onClick:()=>(e=>{if(!/^(?:(?:25[0-5]|2[0-4][0-9]|1\d{2}|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4][0-9]|1\d{2}|[1-9]?\d)$|^([a-fA-F0-9:]+:+)+[a-fA-F0-9]+$/.test(s))return void alert("❌ Invalid IP address format.");if(a&&!/^(https?:\/\/)?([\w\-])+(\.[\w\-]+)+[/#?]?.*$/.test(a))return void alert("❌ Invalid Redirect URL format.");const n=new Date(l);new Date(u)<=n?alert("❌ End date must be later than start date."):bn.post(`${blocipadwoo.apiUrl}/wprk/v1/update_blkip`,{id:e.id,ipaddress:s,blocktype:f,blkcategory:m,redirect:a,startdate:l,enddate:u},{headers:{"Content-Type":"application/json","X-WP-NONCE":blocipadwoo.nonce}}).then((()=>{alert("IP updated successfully!"),o(null),t()})).catch((e=>console.error("Error updating IP:",e)))})(e),children:"Update"}):(0,ee.jsx)("button",{className:"btn btn-edit",onClick:()=>((e,t)=>{o(e),i(t.ipaddress),h(t.blocktype),g(t.blkcategory),c(t.redirect),d(t.startdate),p(t.enddate)})(n,e),children:"Edit"}),(0,ee.jsx)("button",{className:"btn btn-delete",onClick:()=>{return n=e.id,void(window.confirm("Are you sure you want to delete this blocked IP?")&&bn.post(`${blocipadwoo.apiUrl}/wprk/v1/delete_blkip`,{id:n},{headers:{"Content-Type":"application/json","X-WP-NONCE":blocipadwoo.nonce}}).then((()=>{alert("IP deleted successfully!"),t()})).catch((e=>console.error("Error deleting IP:",e))));var n},style:{marginLeft:"10px"},children:"Delete"})]})]},e.id))):(0,ee.jsx)("tr",{children:(0,ee.jsx)("td",{colSpan:"5",children:"No blocked IPs found."})})})]})]})},vn=()=>{const[e,t]=(0,n.useState)([]),[r,o]=(0,n.useState)(!0),s=()=>{bn.get(`${blocipadwoo.apiUrl}/wprk/v1/get_blkip`,{headers:{"Content-Type":"application/json","X-WP-NONCE":blocipadwoo.nonce,"Cache-Control":"no-cache"},params:{_t:Date.now()}}).then((e=>{t(e.data),o(!1)})).catch((e=>{console.error("Error fetching blocked IPs:",e),o(!1)}))};return(0,n.useEffect)((()=>{s()}),[]),(0,ee.jsxs)("div",{children:[(0,ee.jsx)(wn,{onIpAdded:s}),(0,ee.jsx)(xn,{blockedIps:e,loading:r,refresh:s})]})};document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("ip-admin");ReactDOM.render((0,ee.jsx)(te,{}),e)}));let En=document.getElementById("new-ipaddress");En&&ReactDOM.render((0,ee.jsx)(vn,{}),En);let Sn=document.getElementById("view-iplist");Sn&&ReactDOM.render((0,ee.jsx)(xn,{}),Sn)})();
  • block-ip-address-for-woocommerce/trunk/readme.txt

    r3486253 r3496650  
    33Tags: ip blocker, block ip address, woocommerce security, ip restriction, ip ban
    44Requires at least: 5.5 
    5 Tested up to: 6.9.1
     5Tested up to: 6.9.4
    66Requires PHP: 7.2 
    7 Stable tag: 1.0.2 
     7Stable tag: 1.0.3 
    88License: GPLv2 or later 
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html 
     
    8585== Changelog ==
    8686
     87= 1.0.3 = 
     88* database issue arise.
     89
    8790= 1.0.2 = 
    8891* Initial release with support for blocking IP addresses and defining block duration using start and end dates.
  • block-ip-address-for-woocommerce/trunk/src/components/IpManager.js

    r3322565 r3496650  
    1313            headers: {
    1414                'Content-Type': 'application/json',
    15                 'X-WP-NONCE': blocipadwoo.nonce
     15                'X-WP-NONCE': blocipadwoo.nonce,
     16                'Cache-Control': 'no-cache'
     17            },
     18            params: {
     19                _t: Date.now() // Cache-busting for LiteSpeed
    1620            }
    1721        })
  • block-ip-address-for-woocommerce/trunk/src/components/NewIp.js

    r3467005 r3496650  
    1717
    1818    useEffect(() => {
    19         axios.get(`${blocipadwoo.apiUrl}/wp/v2/product_cat`)
     19        axios.get(`${blocipadwoo.apiUrl}/wooip/v1/product_categories`, {
     20            headers: {
     21                'X-WP-NONCE': blocipadwoo.nonce
     22            }
     23        })
    2024            .then(res => {
    2125                setCategories(res.data);
Note: See TracChangeset for help on using the changeset viewer.