@ideal-postcodes/address-finder-bundled
Version:
JS bundles for Address Finder library
9 lines • 77.8 kB
JavaScript
/**
* @license
* Ideal Postcodes <https://ideal-postcodes.co.uk>
* Copyright IDDQD Limited
* Address Finder Bundled 5.0.3
* Built on Address Finder ~5.2.4
* AGPL-3.0 Licence
*/
var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var e=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},n="object"==typeof t&&t&&t.Object===Object&&t,o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")(),r=i,s=function(){return r.Date.now()},a=/\s/;var c=function(t){for(var e=t.length;e--&&a.test(t.charAt(e)););return e},u=/^\s+/;var l=function(t){return t?t.slice(0,c(t)+1).replace(u,""):t},d=i.Symbol,h=d,p=Object.prototype,f=p.hasOwnProperty,m=p.toString,g=h?h.toStringTag:void 0;var y=function(t){var e=f.call(t,g),n=t[g];try{t[g]=void 0;var o=!0}catch(t){}var i=m.call(t);return o&&(e?t[g]=n:delete t[g]),i},b=Object.prototype.toString;var v=y,w=function(t){return b.call(t)},E=d?d.toStringTag:void 0;var S=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":E&&E in Object(t)?v(t):w(t)},x=function(t){return null!=t&&"object"==typeof t};var C=l,T=e,O=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==S(t)},A=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,R=/^0o[0-7]+$/i,N=parseInt;var L=e,U=s,k=function(t){if("number"==typeof t)return t;if(O(t))return NaN;if(T(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=T(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=C(t);var n=_.test(t);return n||R.test(t)?N(t.slice(2),n?2:8):A.test(t)?NaN:+t},j=Math.max,P=Math.min;var F=function(t,e,n){var o,i,r,s,a,c,u=0,l=!1,d=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var n=o,r=i;return o=i=void 0,u=e,s=t.apply(r,n)}function f(t){var n=t-c;return void 0===c||n>=e||n<0||d&&t-u>=r}function m(){var t=U();if(f(t))return g(t);a=setTimeout(m,function(t){var n=e-(t-c);return d?P(n,r-(t-u)):n}(t))}function g(t){return a=void 0,h&&o?p(t):(o=i=void 0,s)}function y(){var t=U(),n=f(t);if(o=arguments,i=this,c=t,n){if(void 0===a)return function(t){return u=t,a=setTimeout(m,e),l?p(t):s}(c);if(d)return clearTimeout(a),a=setTimeout(m,e),p(c)}return void 0===a&&(a=setTimeout(m,e)),s}return e=k(e)||0,L(n)&&(l=!!n.leading,r=(d="maxWait"in n)?j(k(n.maxWait)||0,e):r,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==a&&clearTimeout(a),u=0,o=c=i=a=void 0},y.flush=function(){return void 0===a?s:g(U())},y};const D=(t,e)=>(t.id=e,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t),I=t=>{const e={};for(const n of t)e[n.iso_3]=n;return e},B={tls:!0,api_key:"",baseUrl:"api.ideal-postcodes.co.uk",version:"v1",strictAuthorisation:!1,timeout:1e4,header:{Accept:"application/json","Content-Type":"application/json"},tags:[],agent:{}};class q{constructor(t){this.config={...B,...t},this.config.header={...B.header,...t.header&&t.header}}url(){const{baseUrl:t,version:e}=this.config;return`${this.protocol()}://${t}/${e}`}protocol(){return this.config.tls?"https":"http"}}const M=t=>void 0===t?{}:Object.keys(t).reduce(((e,n)=>{const o=t[n],i=$(o);return i.length>0&&(e[n]=i),e}),{}),H=t=>"string"==typeof t,$=t=>{const e=[];return(t=>Array.isArray(t))(t)?(t.forEach((t=>{z(t)&&e.push(t.toString()),H(t)&&e.push(t)})),e.join(",")):z(t)?t.toString():H(t)?t:""},z=t=>"number"==typeof t,G=(t,e)=>{let{timeout:n}=t;return z(n)?n:e.config.timeout},K=(t,e)=>{let{header:n={}}=t;return{...e.config.header,...M(n)}};class W extends Error{constructor(t){const e=new.target.prototype;super(),this.__proto__=e;const{message:n,httpStatus:o,metadata:i={}}=t;this.message=n,this.name="Ideal Postcodes Error",this.httpStatus=o,this.metadata=i,Error.captureStackTrace&&Error.captureStackTrace(this,W)}}class V extends W{constructor(t){super({httpStatus:t.httpStatus,message:t.body.message}),this.response=t}}class J extends V{}class Y extends V{}class X extends Y{}class Q extends V{}class Z extends Q{}class tt extends Q{}class et extends V{}class nt extends et{}class ot extends et{}class it extends et{}class rt extends et{}class st extends V{}const at=t=>{const{httpStatus:e,body:n}=t;if((o=e)<200||o>=300){var o;if((t=>{return null!==(e=t)&&"object"==typeof e&&"string"==typeof t.message&&"number"==typeof t.code;var e})(n)){const{code:o}=n;if(4010===o)return new X(t);if(4040===o)return new nt(t);if(4042===o)return new ot(t);if(4044===o)return new it(t);if(4046===o)return new rt(t);if(4020===o)return new Z(t);if(4021===o)return new tt(t);if(404===e)return new et(t);if(400===e)return new J(t);if(402===e)return new Q(t);if(401===e)return new Y(t);if(500===e)return new st(t)}return new W({httpStatus:e,message:JSON.stringify(n)})}};var ct=Object.freeze({__proto__:null,IdealPostcodesError:W,IdpcApiError:V,IdpcBadRequestError:J,IdpcUnauthorisedError:Y,IdpcInvalidKeyError:X,IdpcRequestFailedError:Q,IdpcBalanceDepletedError:Z,IdpcLimitReachedError:tt,IdpcResourceNotFoundError:et,IdpcPostcodeNotFoundError:nt,IdpcKeyNotFoundError:ot,IdpcUdprnNotFoundError:it,IdpcUmprnNotFoundError:rt,IdpcServerError:st,parse:at});const ut=(t,e)=>[t.client.url(),t.resource,encodeURIComponent(e),t.action].filter((t=>void 0!==t)).join("/"),lt=t=>{const{client:e}=t;return(n,o)=>e.config.agent.http({method:"GET",url:ut(t,n),query:M(o.query),header:K(o,e),timeout:G(o,e)}).then((t=>{const e=at(t);if(e)throw e;return t}))},dt=t=>{const{client:e,timeout:n}=t,o=t.api_key||t.client.config.api_key,{licensee:i}=t;let r;r=void 0===i?{}:{licensee:i};const s={query:r,header:{}};return void 0!==n&&(s.timeout=n),((t,e,n)=>lt({resource:"keys",client:t})(e,n))(e,o,s).then((t=>t.body.result))},ht="autocomplete/addresses",pt=(t,e)=>(t=>{const{client:e,resource:n}=t;return t=>e.config.agent.http({method:"GET",url:`${e.url()}/${n}`,query:M(t.query),header:K(t,e),timeout:G(t,e)}).then((t=>{const e=at(t);if(e)throw e;return t}))})({resource:ht,client:t})(e);function ft(t,e){return function(){return t.apply(e,arguments)}}const{toString:mt}=Object.prototype,{getPrototypeOf:gt}=Object,yt=(bt=Object.create(null),t=>{const e=mt.call(t);return bt[e]||(bt[e]=e.slice(8,-1).toLowerCase())});var bt;const vt=t=>(t=t.toLowerCase(),e=>yt(e)===t),wt=t=>e=>typeof e===t,{isArray:Et}=Array,St=wt("undefined");const xt=vt("ArrayBuffer");const Ct=wt("string"),Tt=wt("function"),Ot=wt("number"),At=t=>null!==t&&"object"==typeof t,_t=t=>{if("object"!==yt(t))return!1;const e=gt(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},Rt=vt("Date"),Nt=vt("File"),Lt=vt("Blob"),Ut=vt("FileList"),kt=vt("URLSearchParams"),[jt,Pt,Ft,Dt]=["ReadableStream","Request","Response","Headers"].map(vt);function It(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let o,i;if("object"!=typeof t&&(t=[t]),Et(t))for(o=0,i=t.length;o<i;o++)e.call(null,t[o],o,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),r=i.length;let s;for(o=0;o<r;o++)s=i[o],e.call(null,t[s],s,t)}}function Bt(t,e){e=e.toLowerCase();const n=Object.keys(t);let o,i=n.length;for(;i-- >0;)if(o=n[i],e===o.toLowerCase())return o;return null}const qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Mt=t=>!St(t)&&t!==qt;const Ht=($t="undefined"!=typeof Uint8Array&>(Uint8Array),t=>$t&&t instanceof $t);var $t;const zt=vt("HTMLFormElement"),Gt=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Kt=vt("RegExp"),Wt=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),o={};It(n,((n,i)=>{let r;!1!==(r=e(n,i,t))&&(o[i]=r||n)})),Object.defineProperties(t,o)};const Vt=vt("AsyncFunction"),Jt=(Yt="function"==typeof setImmediate,Xt=Tt(qt.postMessage),Yt?setImmediate:Xt?(Qt=`axios@${Math.random()}`,Zt=[],qt.addEventListener("message",(({source:t,data:e})=>{t===qt&&e===Qt&&Zt.length&&Zt.shift()()}),!1),t=>{Zt.push(t),qt.postMessage(Qt,"*")}):t=>setTimeout(t));var Yt,Xt,Qt,Zt;const te="undefined"!=typeof queueMicrotask?queueMicrotask.bind(qt):"undefined"!=typeof process&&process.nextTick||Jt;var ee={isArray:Et,isArrayBuffer:xt,isBuffer:function(t){return null!==t&&!St(t)&&null!==t.constructor&&!St(t.constructor)&&Tt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||Tt(t.append)&&("formdata"===(e=yt(t))||"object"===e&&Tt(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&xt(t.buffer),e},isString:Ct,isNumber:Ot,isBoolean:t=>!0===t||!1===t,isObject:At,isPlainObject:_t,isReadableStream:jt,isRequest:Pt,isResponse:Ft,isHeaders:Dt,isUndefined:St,isDate:Rt,isFile:Nt,isBlob:Lt,isRegExp:Kt,isFunction:Tt,isStream:t=>At(t)&&Tt(t.pipe),isURLSearchParams:kt,isTypedArray:Ht,isFileList:Ut,forEach:It,merge:function t(){const{caseless:e}=Mt(this)&&this||{},n={},o=(o,i)=>{const r=e&&Bt(n,i)||i;_t(n[r])&&_t(o)?n[r]=t(n[r],o):_t(o)?n[r]=t({},o):Et(o)?n[r]=o.slice():n[r]=o};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&It(arguments[t],o);return n},extend:(t,e,n,{allOwnKeys:o}={})=>(It(e,((e,o)=>{n&&Tt(e)?t[o]=ft(e,n):t[o]=e}),{allOwnKeys:o}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,o)=>{t.prototype=Object.create(e.prototype,o),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,o)=>{let i,r,s;const a={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),r=i.length;r-- >0;)s=i[r],o&&!o(s,t,e)||a[s]||(e[s]=t[s],a[s]=!0);t=!1!==n&>(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:yt,kindOfTest:vt,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const o=t.indexOf(e,n);return-1!==o&&o===n},toArray:t=>{if(!t)return null;if(Et(t))return t;let e=t.length;if(!Ot(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=n.next())&&!o.done;){const n=o.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const o=[];for(;null!==(n=t.exec(e));)o.push(n);return o},isHTMLForm:zt,hasOwnProperty:Gt,hasOwnProp:Gt,reduceDescriptors:Wt,freezeMethods:t=>{Wt(t,((e,n)=>{if(Tt(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const o=t[n];Tt(o)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},o=t=>{t.forEach((t=>{n[t]=!0}))};return Et(t)?o(t):o(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:Bt,global:qt,isContextDefined:Mt,isSpecCompliantForm:function(t){return!!(t&&Tt(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,o)=>{if(At(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[o]=t;const i=Et(t)?[]:{};return It(t,((t,e)=>{const r=n(t,o+1);!St(r)&&(i[e]=r)})),e[o]=void 0,i}}return t};return n(t,0)},isAsyncFn:Vt,isThenable:t=>t&&(At(t)||Tt(t))&&Tt(t.then)&&Tt(t.catch),setImmediate:Jt,asap:te};function ne(t,e,n,o,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),o&&(this.request=o),i&&(this.response=i,this.status=i.status?i.status:null)}ee.inherits(ne,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:ee.toJSONObject(this.config),code:this.code,status:this.status}}});const oe=ne.prototype,ie={};["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((t=>{ie[t]={value:t}})),Object.defineProperties(ne,ie),Object.defineProperty(oe,"isAxiosError",{value:!0}),ne.from=(t,e,n,o,i,r)=>{const s=Object.create(oe);return ee.toFlatObject(t,s,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),ne.call(s,t.message,e,n,o,i),s.cause=t,s.name=t.name,r&&Object.assign(s,r),s};function re(t){return ee.isPlainObject(t)||ee.isArray(t)}function se(t){return ee.endsWith(t,"[]")?t.slice(0,-2):t}function ae(t,e,n){return t?t.concat(e).map((function(t,e){return t=se(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const ce=ee.toFlatObject(ee,{},null,(function(t){return/^is[A-Z]/.test(t)}));function ue(t,e,n){if(!ee.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const o=(n=ee.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!ee.isUndefined(e[t])}))).metaTokens,i=n.visitor||u,r=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&ee.isSpecCompliantForm(e);if(!ee.isFunction(i))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(ee.isDate(t))return t.toISOString();if(!a&&ee.isBlob(t))throw new ne("Blob is not supported. Use a Buffer instead.");return ee.isArrayBuffer(t)||ee.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,n,i){let a=t;if(t&&!i&&"object"==typeof t)if(ee.endsWith(n,"{}"))n=o?n:n.slice(0,-2),t=JSON.stringify(t);else if(ee.isArray(t)&&function(t){return ee.isArray(t)&&!t.some(re)}(t)||(ee.isFileList(t)||ee.endsWith(n,"[]"))&&(a=ee.toArray(t)))return n=se(n),a.forEach((function(t,o){!ee.isUndefined(t)&&null!==t&&e.append(!0===s?ae([n],o,r):null===s?n:n+"[]",c(t))})),!1;return!!re(t)||(e.append(ae(i,n,r),c(t)),!1)}const l=[],d=Object.assign(ce,{defaultVisitor:u,convertValue:c,isVisitable:re});if(!ee.isObject(t))throw new TypeError("data must be an object");return function t(n,o){if(!ee.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+o.join("."));l.push(n),ee.forEach(n,(function(n,r){!0===(!(ee.isUndefined(n)||null===n)&&i.call(e,n,ee.isString(r)?r.trim():r,o,d))&&t(n,o?o.concat(r):[r])})),l.pop()}}(t),e}function le(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function de(t,e){this._pairs=[],t&&ue(t,this,e)}const he=de.prototype;function pe(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fe(t,e,n){if(!e)return t;const o=n&&n.encode||pe;ee.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let r;if(r=i?i(e,n):ee.isURLSearchParams(e)?e.toString():new de(e,n).toString(o),r){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t}he.append=function(t,e){this._pairs.push([t,e])},he.toString=function(t){const e=t?function(e){return t.call(this,e,le)}:le;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var me=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ee.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},ge={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ye={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:de,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const be="undefined"!=typeof window&&"undefined"!=typeof document,ve="object"==typeof navigator&&navigator||void 0,we=be&&(!ve||["ReactNative","NativeScript","NS"].indexOf(ve.product)<0),Ee="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Se=be&&window.location.href||"http://localhost";var xe={...Object.freeze({__proto__:null,hasBrowserEnv:be,hasStandardBrowserWebWorkerEnv:Ee,hasStandardBrowserEnv:we,navigator:ve,origin:Se}),...ye};function Ce(t){function e(t,n,o,i){let r=t[i++];if("__proto__"===r)return!0;const s=Number.isFinite(+r),a=i>=t.length;if(r=!r&&ee.isArray(o)?o.length:r,a)return ee.hasOwnProp(o,r)?o[r]=[o[r],n]:o[r]=n,!s;o[r]&&ee.isObject(o[r])||(o[r]=[]);return e(t,n,o[r],i)&&ee.isArray(o[r])&&(o[r]=function(t){const e={},n=Object.keys(t);let o;const i=n.length;let r;for(o=0;o<i;o++)r=n[o],e[r]=t[r];return e}(o[r])),!s}if(ee.isFormData(t)&&ee.isFunction(t.entries)){const n={};return ee.forEachEntry(t,((t,o)=>{e(function(t){return ee.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),o,n,0)})),n}return null}const Te={transitional:ge,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",o=n.indexOf("application/json")>-1,i=ee.isObject(t);i&&ee.isHTMLForm(t)&&(t=new FormData(t));if(ee.isFormData(t))return o?JSON.stringify(Ce(t)):t;if(ee.isArrayBuffer(t)||ee.isBuffer(t)||ee.isStream(t)||ee.isFile(t)||ee.isBlob(t)||ee.isReadableStream(t))return t;if(ee.isArrayBufferView(t))return t.buffer;if(ee.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let r;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return ue(t,new xe.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,o){return xe.isNode&&ee.isBuffer(t)?(this.append(e,t.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((r=ee.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return ue(r?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||o?(e.setContentType("application/json",!1),function(t,e,n){if(ee.isString(t))try{return(e||JSON.parse)(t),ee.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Te.transitional,n=e&&e.forcedJSONParsing,o="json"===this.responseType;if(ee.isResponse(t)||ee.isReadableStream(t))return t;if(t&&ee.isString(t)&&(n&&!this.responseType||o)){const n=!(e&&e.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw ne.from(t,ne.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xe.classes.FormData,Blob:xe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ee.forEach(["delete","get","head","post","put","patch"],(t=>{Te.headers[t]={}}));var Oe=Te;const Ae=ee.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"]);const _e=Symbol("internals");function Re(t){return t&&String(t).trim().toLowerCase()}function Ne(t){return!1===t||null==t?t:ee.isArray(t)?t.map(Ne):String(t)}function Le(t,e,n,o,i){return ee.isFunction(o)?o.call(this,e,n):(i&&(e=n),ee.isString(e)?ee.isString(o)?-1!==e.indexOf(o):ee.isRegExp(o)?o.test(e):void 0:void 0)}class Ue{constructor(t){t&&this.set(t)}set(t,e,n){const o=this;function i(t,e,n){const i=Re(e);if(!i)throw new Error("header name must be a non-empty string");const r=ee.findKey(o,i);(!r||void 0===o[r]||!0===n||void 0===n&&!1!==o[r])&&(o[r||e]=Ne(t))}const r=(t,e)=>ee.forEach(t,((t,n)=>i(t,n,e)));if(ee.isPlainObject(t)||t instanceof this.constructor)r(t,e);else if(ee.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))r((t=>{const e={};let n,o,i;return t&&t.split("\n").forEach((function(t){i=t.indexOf(":"),n=t.substring(0,i).trim().toLowerCase(),o=t.substring(i+1).trim(),!n||e[n]&&Ae[n]||("set-cookie"===n?e[n]?e[n].push(o):e[n]=[o]:e[n]=e[n]?e[n]+", "+o:o)})),e})(t),e);else if(ee.isHeaders(t))for(const[e,o]of t.entries())i(o,e,n);else null!=t&&i(e,t,n);return this}get(t,e){if(t=Re(t)){const n=ee.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(t);)e[o[1]]=o[2];return e}(t);if(ee.isFunction(e))return e.call(this,t,n);if(ee.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Re(t)){const n=ee.findKey(this,t);return!(!n||void 0===this[n]||e&&!Le(0,this[n],n,e))}return!1}delete(t,e){const n=this;let o=!1;function i(t){if(t=Re(t)){const i=ee.findKey(n,t);!i||e&&!Le(0,n[i],i,e)||(delete n[i],o=!0)}}return ee.isArray(t)?t.forEach(i):i(t),o}clear(t){const e=Object.keys(this);let n=e.length,o=!1;for(;n--;){const i=e[n];t&&!Le(0,this[i],i,t,!0)||(delete this[i],o=!0)}return o}normalize(t){const e=this,n={};return ee.forEach(this,((o,i)=>{const r=ee.findKey(n,i);if(r)return e[r]=Ne(o),void delete e[i];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(i):String(i).trim();s!==i&&delete e[i],e[s]=Ne(o),n[s]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return ee.forEach(this,((n,o)=>{null!=n&&!1!==n&&(e[o]=t&&ee.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[_e]=this[_e]={accessors:{}}).accessors,n=this.prototype;function o(t){const o=Re(t);e[o]||(!function(t,e){const n=ee.toCamelCase(" "+e);["get","set","has"].forEach((o=>{Object.defineProperty(t,o+n,{value:function(t,n,i){return this[o].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[o]=!0)}return ee.isArray(t)?t.forEach(o):o(t),this}}Ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ee.reduceDescriptors(Ue.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),ee.freezeMethods(Ue);var ke=Ue;function je(t,e){const n=this||Oe,o=e||n,i=ke.from(o.headers);let r=o.data;return ee.forEach(t,(function(t){r=t.call(n,r,i.normalize(),e?e.status:void 0)})),i.normalize(),r}function Pe(t){return!(!t||!t.__CANCEL__)}function Fe(t,e,n){ne.call(this,null==t?"canceled":t,ne.ERR_CANCELED,e,n),this.name="CanceledError"}function De(t,e,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(new ne("Request failed with status code "+n.status,[ne.ERR_BAD_REQUEST,ne.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}ee.inherits(Fe,ne,{__CANCEL__:!0});const Ie=(t,e,n=3)=>{let o=0;const i=function(t,e){t=t||10;const n=new Array(t),o=new Array(t);let i,r=0,s=0;return e=void 0!==e?e:1e3,function(a){const c=Date.now(),u=o[s];i||(i=c),n[r]=a,o[r]=c;let l=s,d=0;for(;l!==r;)d+=n[l++],l%=t;if(r=(r+1)%t,r===s&&(s=(s+1)%t),c-i<e)return;const h=u&&c-u;return h?Math.round(1e3*d/h):void 0}}(50,250);return function(t,e){let n,o,i=0,r=1e3/e;const s=(e,r=Date.now())=>{i=r,n=null,o&&(clearTimeout(o),o=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),a=e-i;a>=r?s(t,e):(n=t,o||(o=setTimeout((()=>{o=null,s(n)}),r-a)))},()=>n&&s(n)]}((n=>{const r=n.loaded,s=n.lengthComputable?n.total:void 0,a=r-o,c=i(a);o=r;t({loaded:r,total:s,progress:s?r/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&r<=s?(s-r)/c:void 0,event:n,lengthComputable:null!=s,[e?"download":"upload"]:!0})}),n)},Be=(t,e)=>{const n=null!=t;return[o=>e[0]({lengthComputable:n,total:t,loaded:o}),e[1]]},qe=t=>(...e)=>ee.asap((()=>t(...e)));var Me=xe.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,xe.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(xe.origin),xe.navigator&&/(msie|trident)/i.test(xe.navigator.userAgent)):()=>!0,He=xe.hasStandardBrowserEnv?{write(t,e,n,o,i,r){const s=[t+"="+encodeURIComponent(e)];ee.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),ee.isString(o)&&s.push("path="+o),ee.isString(i)&&s.push("domain="+i),!0===r&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function $e(t,e,n){let o=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(o||0==n)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const ze=t=>t instanceof ke?{...t}:t;function Ge(t,e){e=e||{};const n={};function o(t,e,n,o){return ee.isPlainObject(t)&&ee.isPlainObject(e)?ee.merge.call({caseless:o},t,e):ee.isPlainObject(e)?ee.merge({},e):ee.isArray(e)?e.slice():e}function i(t,e,n,i){return ee.isUndefined(e)?ee.isUndefined(t)?void 0:o(void 0,t,0,i):o(t,e,0,i)}function r(t,e){if(!ee.isUndefined(e))return o(void 0,e)}function s(t,e){return ee.isUndefined(e)?ee.isUndefined(t)?void 0:o(void 0,t):o(void 0,e)}function a(n,i,r){return r in e?o(n,i):r in t?o(void 0,n):void 0}const c={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(t,e,n)=>i(ze(t),ze(e),0,!0)};return ee.forEach(Object.keys(Object.assign({},t,e)),(function(o){const r=c[o]||i,s=r(t[o],e[o],o);ee.isUndefined(s)&&r!==a||(n[o]=s)})),n}var Ke=t=>{const e=Ge({},t);let n,{data:o,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:a,auth:c}=e;if(e.headers=a=ke.from(a),e.url=fe($e(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),ee.isFormData(o))if(xe.hasStandardBrowserEnv||xe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[t,...e]=n?n.split(";").map((t=>t.trim())).filter(Boolean):[];a.setContentType([t||"multipart/form-data",...e].join("; "))}if(xe.hasStandardBrowserEnv&&(i&&ee.isFunction(i)&&(i=i(e)),i||!1!==i&&Me(e.url))){const t=r&&s&&He.read(s);t&&a.set(r,t)}return e};var We="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){const o=Ke(t);let i=o.data;const r=ke.from(o.headers).normalize();let s,a,c,u,l,{responseType:d,onUploadProgress:h,onDownloadProgress:p}=o;function f(){u&&u(),l&&l(),o.cancelToken&&o.cancelToken.unsubscribe(s),o.signal&&o.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function g(){if(!m)return;const o=ke.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());De((function(t){e(t),f()}),(function(t){n(t),f()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:o,config:t,request:m}),m=null}m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.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 ne("Request aborted",ne.ECONNABORTED,t,m)),m=null)},m.onerror=function(){n(new ne("Network Error",ne.ERR_NETWORK,t,m)),m=null},m.ontimeout=function(){let e=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const i=o.transitional||ge;o.timeoutErrorMessage&&(e=o.timeoutErrorMessage),n(new ne(e,i.clarifyTimeoutError?ne.ETIMEDOUT:ne.ECONNABORTED,t,m)),m=null},void 0===i&&r.setContentType(null),"setRequestHeader"in m&&ee.forEach(r.toJSON(),(function(t,e){m.setRequestHeader(e,t)})),ee.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),d&&"json"!==d&&(m.responseType=o.responseType),p&&([c,l]=Ie(p,!0),m.addEventListener("progress",c)),h&&m.upload&&([a,u]=Ie(h),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(o.cancelToken||o.signal)&&(s=e=>{m&&(n(!e||e.type?new Fe(null,t,m):e),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(s),o.signal&&(o.signal.aborted?s():o.signal.addEventListener("abort",s)));const y=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(o.url);y&&-1===xe.protocols.indexOf(y)?n(new ne("Unsupported protocol "+y+":",ne.ERR_BAD_REQUEST,t)):m.send(i||null)}))};var Ve=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,o=new AbortController;const i=function(t){if(!n){n=!0,s();const e=t instanceof Error?t:this.reason;o.abort(e instanceof ne?e:new Fe(e instanceof Error?e.message:e))}};let r=e&&setTimeout((()=>{r=null,i(new ne(`timeout ${e} of ms exceeded`,ne.ETIMEDOUT))}),e);const s=()=>{t&&(r&&clearTimeout(r),r=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(i):t.removeEventListener("abort",i)})),t=null)};t.forEach((t=>t.addEventListener("abort",i)));const{signal:a}=o;return a.unsubscribe=()=>ee.asap(s),a}};const Je=function*(t,e){let n=t.byteLength;if(!e||n<e)return void(yield t);let o,i=0;for(;i<n;)o=i+e,yield t.slice(i,o),i=o},Ye=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},Xe=(t,e,n,o)=>{const i=async function*(t,e){for await(const n of Ye(t))yield*Je(n,e)}(t,e);let r,s=0,a=t=>{r||(r=!0,o&&o(t))};return new ReadableStream({async pull(t){try{const{done:e,value:o}=await i.next();if(e)return a(),void t.close();let r=o.byteLength;if(n){let t=s+=r;n(t)}t.enqueue(new Uint8Array(o))}catch(t){throw a(t),t}},cancel:t=>(a(t),i.return())},{highWaterMark:2})},Qe="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Ze=Qe&&"function"==typeof ReadableStream,tn=Qe&&("function"==typeof TextEncoder?(en=new TextEncoder,t=>en.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var en;const nn=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},on=Ze&&nn((()=>{let t=!1;const e=new Request(xe.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),rn=Ze&&nn((()=>ee.isReadableStream(new Response("").body))),sn={stream:rn&&(t=>t.body)};var an;Qe&&(an=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!sn[t]&&(sn[t]=ee.isFunction(an[t])?e=>e[t]():(e,n)=>{throw new ne(`Response type '${t}' is not supported`,ne.ERR_NOT_SUPPORT,n)})})));const cn=async(t,e)=>{const n=ee.toFiniteNumber(t.getContentLength());return null==n?(async t=>{if(null==t)return 0;if(ee.isBlob(t))return t.size;if(ee.isSpecCompliantForm(t)){const e=new Request(xe.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return ee.isArrayBufferView(t)||ee.isArrayBuffer(t)?t.byteLength:(ee.isURLSearchParams(t)&&(t+=""),ee.isString(t)?(await tn(t)).byteLength:void 0)})(e):n};const un={http:null,xhr:We,fetch:Qe&&(async t=>{let{url:e,method:n,data:o,signal:i,cancelToken:r,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:h}=Ke(t);u=u?(u+"").toLowerCase():"text";let p,f=Ve([i,r&&r.toAbortSignal()],s);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(c&&on&&"get"!==n&&"head"!==n&&0!==(g=await cn(l,o))){let t,n=new Request(e,{method:"POST",body:o,duplex:"half"});if(ee.isFormData(o)&&(t=n.headers.get("content-type"))&&l.setContentType(t),n.body){const[t,e]=Be(g,Ie(qe(c)));o=Xe(n.body,65536,t,e)}}ee.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;p=new Request(e,{...h,signal:f,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:o,duplex:"half",credentials:i?d:void 0});let r=await fetch(p);const s=rn&&("stream"===u||"response"===u);if(rn&&(a||s&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=r[e]}));const e=ee.toFiniteNumber(r.headers.get("content-length")),[n,o]=a&&Be(e,Ie(qe(a),!0))||[];r=new Response(Xe(r.body,65536,n,(()=>{o&&o(),m&&m()})),t)}u=u||"text";let y=await sn[ee.findKey(sn,u)||"text"](r,t);return!s&&m&&m(),await new Promise(((e,n)=>{De(e,n,{data:y,headers:ke.from(r.headers),status:r.status,statusText:r.statusText,config:t,request:p})}))}catch(e){if(m&&m(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new ne("Network Error",ne.ERR_NETWORK,t,p),{cause:e.cause||e});throw ne.from(e,e&&e.code,t,p)}})};ee.forEach(un,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ln=t=>`- ${t}`,dn=t=>ee.isFunction(t)||null===t||!1===t;var hn=t=>{t=ee.isArray(t)?t:[t];const{length:e}=t;let n,o;const i={};for(let r=0;r<e;r++){let e;if(n=t[r],o=n,!dn(n)&&(o=un[(e=String(n)).toLowerCase()],void 0===o))throw new ne(`Unknown adapter '${e}'`);if(o)break;i[e||"#"+r]=o}if(!o){const t=Object.entries(i).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));throw new ne("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(ln).join("\n"):" "+ln(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function pn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Fe(null,t)}function fn(t){pn(t),t.headers=ke.from(t.headers),t.data=je.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return hn(t.adapter||Oe.adapter)(t).then((function(e){return pn(t),e.data=je.call(t,t.transformResponse,e),e.headers=ke.from(e.headers),e}),(function(e){return Pe(e)||(pn(t),e&&e.response&&(e.response.data=je.call(t,t.transformResponse,e.response),e.response.headers=ke.from(e.response.headers))),Promise.reject(e)}))}const mn="1.8.4",gn={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{gn[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const yn={};gn.transitional=function(t,e,n){function o(t,e){return"[Axios v1.8.4] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,i,r)=>{if(!1===t)throw new ne(o(i," has been removed"+(e?" in "+e:"")),ne.ERR_DEPRECATED);return e&&!yn[i]&&(yn[i]=!0,console.warn(o(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,r)}},gn.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};var bn={assertOptions:function(t,e,n){if("object"!=typeof t)throw new ne("options must be an object",ne.ERR_BAD_OPTION_VALUE);const o=Object.keys(t);let i=o.length;for(;i-- >0;){const r=o[i],s=e[r];if(s){const e=t[r],n=void 0===e||s(e,r,t);if(!0!==n)throw new ne("option "+r+" must be "+n,ne.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ne("Unknown option "+r,ne.ERR_BAD_OPTION)}},validators:gn};const vn=bn.validators;class wn{constructor(t){this.defaults=t,this.interceptors={request:new me,response:new me}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Ge(this.defaults,e);const{transitional:n,paramsSerializer:o,headers:i}=e;void 0!==n&&bn.assertOptions(n,{silentJSONParsing:vn.transitional(vn.boolean),forcedJSONParsing:vn.transitional(vn.boolean),clarifyTimeoutError:vn.transitional(vn.boolean)},!1),null!=o&&(ee.isFunction(o)?e.paramsSerializer={serialize:o}:bn.assertOptions(o,{encode:vn.function,serialize:vn.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),bn.assertOptions(e,{baseUrl:vn.spelling("baseURL"),withXsrfToken:vn.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let r=i&&ee.merge(i.common,i[e.method]);i&&ee.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete i[t]})),e.headers=ke.concat(r,i);const s=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,d=0;if(!a){const t=[fn.bind(this),void 0];for(t.unshift.apply(t,s),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);d<l;)u=u.then(t[d++],t[d++]);return u}l=s.length;let h=e;for(d=0;d<l;){const t=s[d++],e=s[d++];try{h=t(h)}catch(t){e.call(this,t);break}}try{u=fn.call(this,h)}catch(t){return Promise.reject(t)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(t){return fe($e((t=Ge(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}ee.forEach(["delete","get","head","options"],(function(t){wn.prototype[t]=function(e,n){return this.request(Ge(n||{},{method:t,url:e,data:(n||{}).data}))}})),ee.forEach(["post","put","patch"],(function(t){function e(e){return function(n,o,i){return this.request(Ge(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}wn.prototype[t]=e(),wn.prototype[t+"Form"]=e(!0)}));var En=wn;class Sn{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const o=new Promise((t=>{n.subscribe(t),e=t})).then(t);return o.cancel=function(){n.unsubscribe(e)},o},t((function(t,o,i){n.reason||(n.reason=new Fe(t,o,i),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;const e=new Sn((function(e){t=e}));return{token:e,cancel:t}}}var xn=Sn;const Cn={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(Cn).forEach((([t,e])=>{Cn[e]=t}));var Tn=Cn;const On=function t(e){const n=new En(e),o=ft(En.prototype.request,n);return ee.extend(o,En.prototype,n,{allOwnKeys:!0}),ee.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return t(Ge(e,n))},o}(Oe);On.Axios=En,On.CanceledError=Fe,On.CancelToken=xn,On.isCancel=Pe,On.VERSION=mn,On.toFormData=ue,On.AxiosError=ne,On.Cancel=On.CanceledError,On.all=function(t){return Promise.all(t)},On.spread=function(t){return function(e){return t.apply(null,e)}},On.isAxiosError=function(t){return ee.isObject(t)&&!0===t.isAxiosError},On.mergeConfig=Ge,On.AxiosHeaders=ke,On.formToJSON=t=>Ce(ee.isHTMLForm(t)?new FormData(t):t),On.getAdapter=hn,On.HttpStatusCode=Tn,On.default=On;var An=On;const{IdealPostcodesError:_n}=ct,Rn=(t,e)=>{return{httpRequest:t,body:e.data,httpStatus:e.status||0,header:(n=e.headers,Object.keys(n).reduce(((t,e)=>{const o=n[e];return"string"==typeof o?t[e]=o:Array.isArray(o)&&(t[e]=o.join(",")),t}),{})),metadata:{response:e}};var n},Nn=t=>{const e=new _n({message:`[${t.name}] ${t.message}`,httpStatus:0,metadata:{axios:t}});return Promise.reject(e)},Ln=()=>!0;class Un{constructor(){this.Axios=An.create({validateStatus:Ln})}requestWithBody(t){const{body:e,method:n,timeout:o,url:i,header:r,query:s}=t;return this.Axios.request({url:i,method:n,headers:r,params:s,data:e,timeout:o}).then((e=>Rn(t,e))).catch(Nn)}request(t){const{method:e,timeout:n,url:o,header:i,query:r}=t;return this.Axios.request({url:o,method:e,headers:i,params:r,timeout:n}).then((e=>Rn(t,e))).catch(Nn)}http(t){return void 0!==t.body?this.requestWithBody(t):this.request(t)}}class kn extends q{constructor(t){super({agent:new Un,...t})}}class jn{constructor(t){this.prefix="!",this.client=t,this.cache={}}key(t){return`${this.prefix}${t.toLowerCase()}`}retrieve(t){return this.cache[this.key(t)]}store(t,e){return this.cache[this.key(t)]=e,e}clear(){this.cache={}}query(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.retrieve(t);if(n)return Promise.resolve(n);const o=pt(this.client,{query:{query:t,api_key:this.client.config.api_key,...e}}).then((e=>{const n=e.body.result.hits;return this.store(t,n),n}));return this.store(t,o),o}resolve(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"usa"===e?this.usaResolve(t,n):this.gbrResolve(t,n)}usaResolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n=this.client,o=t.id,i={query:{api_key:this.client.config.api_key,...e}},lt({resource:ht,client:n,action:"usa"})(o,i)).then((t=>t.body.result));var n,o,i}gbrResolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n=this.client,o=t.id,i={query:{api_key:this.client.config.api_key,...e}},lt({resource:ht,client:n,action:"gbr"})(o,i)).then((t=>t.body.result));var n,o,i}}const Pn=t=>"string"==typeof t,Fn=()=>!0,Dn=(t,e)=>Pn(t)?e.querySelector(t):t,In=()=>window.document,Bn=t=>Pn(t)?In().querySelector(t):null===t?In():t,qn=(t,e)=>{const n=t.getAttribute("style");return Object.keys(e).forEach((n=>t.style[n]=e[n])),n},Mn=t=>(t.style.display="none",t),Hn=t=>(t.style.display="",t),$n=(t,e,n)=>{const o=t.querySelectorAll(e);for(let t=0;t<o.length;t++){const e=o[t],i=e.innerText;if(i&&i.trim()===n)return e}return null},zn=t=>{const e=(t=String(t)).length;let n,o=-1,i="";const r=t.charCodeAt(0);for(;++o<e;)n=t.charCodeAt(o),i+=0!=n?n>=1&&n<=31||127==n||0==o&&n>=48&&n<=57||1==o&&n>=48&&n<=57&&45==r?"\\"+n.toString(16)+" ":(0!=o||1!=e||45!=n)&&(n>=128||45==n||95==n||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122)?t.charAt(o):"\\"+t.charAt(o):"�";return i},Gn=t=>void 0!==t.post_town,Kn=(t,e)=>t.dispatchEvent((t=>{let{event:e,bubbles:n=!0,cancelable:o=!0}=t;if("function"==typeof window.Event)return new window.Event(e,{bubbles:n,cancelable:o});const i=document.createEvent("Event");return i.initEvent(e,n,o),i})({event:e})),Wn=t=>null!==t&&(t instanceof HTMLSelectElement||"HTMLSelectElement"===t.constructor.name),Vn=t=>null!==t&&(t instanceof HTMLInputElement||"HTMLInputElement"===t.constructor.name),Jn=t=>null!==t&&(t instanceof HTMLTextAreaElement||"HTMLTextAreaElement"===t.constructor.name),Yn=t=>Vn(t)||Jn(t)||Wn(t),Xn=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t&&(Vn(t)||Jn(t))&&eo({e:t,value:e,skipTrigger:n})},Qn=(t,e)=>null!==e&&null!==t.querySelector(`[value="${e}"]`),Zn=(t,e)=>{if(null===e)return[];const n=t.querySelectorAll("option");return Array.from(n).filter((t=>(t.textContent?t.textContent.replace(/[\n\r]/g,"").replace(/\s+/g," ").trim():"")===e))},to=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t.constructor.prototype,"value");if(void 0===n)return;if(void 0===n.set)return;n.set.call(t,e)},eo=t=>{null!==t.value&&((t=>{let{e:e,value:n,skipTrigger:o}=t;null!==n&&Wn(e)&&(to(e,n),o||Kn(e,"select"),Kn(e,"change"))})(t),(t=>{let{e:e,value:n,skipTrigger:o}=t;null!==n&&(Vn(e)||Jn(e))&&(to(e,n),o||Kn(e,"input"),Kn(e,"change"))})(t))},no="United Kingdom",oo="Isle of Man",io=t=>{const e=t.country;if("England"===e)return no;if("Scotland"===e)return no;if("Wales"===e)return no;if("Northern Ireland"===e)return no;if(e===oo)return oo;if(Gn(t)&&"Channel Islands"===e){if(/^GY/.test(t.postcode))return"Guernsey";if(/^JE/.test(t.postcode))return"Jersey"}return e};let ro={};"undefined"!=typeof window&&(window.idpcGlobal?ro=window.idpcGlobal:window.idpcGlobal=ro);const so=()=>ro,ao=t=>t.filter((t=>Pn(t)?!!t.trim():!!t)).join(", "),co=(t,e)=>{if(t.length<=e)return[t,""];const n=t.split(" ");let o="",i="";for(let t=0;t<n.length;t++){const r=n[t];if(o.length+r.length>e){i=n.slice(t).join(" ");break}o+=`${r} `}return[o.trim(),i.trim()]},uo=(t,e)=>0===e.length?t:`${t}, ${e}`,lo=(t,e,n)=>{const{line_1:o,line_2:i}=e,r="line_3"in e?e.line_3:"";return n.maxLineOne||n.maxLineTwo||n.maxLineThree?((t,e)=>{const{lineCount:n,maxLineOne:o,maxLineTwo:i,maxLineThree:r}=e,s=["","",""],a=[...t];if(o){const[t,e]=co(a[0],o);if(s[0]=t,e&&(a[1]=uo(e,a[1])),1===n)return s}else if(s[0]=a[0],1===n)return[ao(a),"",""];if(i){const[t,e]=co(a[1],i);if(s[1]=t,e&&(a[2]=uo(e,a[2])),2===n)return s}else if(s[1]=a[1],2===n)return[s[0],ao(a.slice(1)),""];if(r){const[t,e]=co(a[2],r);s[2]=t,e&&(a[3]=uo(e,a[3]))}else s[2]=a[2];return s})([o,i,r],{lineCount:t,...n}):3===t?[o,i,r]:2===t?[o,ao([i,r]),""]:[ao([o,i,r]),"",""]},ho=(t,e)=>{const n=t[e];return"number"==typeof n?n.toString():void 0===n?"":n},po=(t,e)=>{const n={};let o;for(o in t){const i=t[o];if(void 0===i)continue;const r=Dn(i,e);Yn(r)&&(n[o]=r)}return n},fo=(t,e)=>{const n={};let o;for(o in t){if(!t.hasOwnProperty(o))continue;const i=t[o],r=Dn(`[name="${i}"]`,e);if(r){n[o]=r;continue}const s=Dn(`[aria-name="${i}"]`,e);s&&(n[o]=s)}return n},mo=(t,e)=>{const n={};if(void 0===t)return t;let o;for(o in t){if(!t.hasOwnProperty(o))continue;const i=t[o];if(!i)continue;const r=$n(e,"label",i),s=Dn(r,e);if(!s)continue;const a=s.getAttribute("for");if(a){const t=e.querySelector(`#${zn(a)}`);if(t){n[o]=t;continue}}const c=s.querySelector("input");c&&(n[o]=c)}return n},go=["country","country_iso_2","country_iso"],yo=t=>{const{config:e}=t,n={...po((o=t).outputFields||{},o.config.scope),...fo(o.names||{},o.config.scope),...mo(o.labels||{},o.config.scope)};var o;void 0===e.lines&&(e.lines=(t=>{const{line_2:e,line_3:n}=t;return e?n?3:2:1})(n));const i=((t,e)=>{Gn(t)&&e.removeOrganisation&&vo(t);const[n,o,i]=lo(e.lines||3,t,e);return t.line_1=n,t.line_2=o,Gn(t)&&(t.line_3=i),t})({...t.address},e),{scope:r,populateCounty:s}=e,a=[...go];Gn(i)&&(e.removeOrganisation&&vo(i),!1===s&&a.push("county")),((t,e)=>{if(t){if(Wn(t)){const n=io(e);if(Qn(t,n))return void eo({e:t,value:n});if(Qn(t,e.country_iso_2))return void eo({e:t,value:e.country_iso_2});if(Qn(t,e.country_iso))return void eo({e:t,value:e.country_iso});let o=Zn(t,n);if(o.length>0)return void eo({e:t,value:o[0].value||""});if(o=Zn(t,e.country_iso_2),o.length>0)return void eo({e:t,value:o[0].value||""});if(o=Zn(t,e.country_iso),o.length>0)return void eo({e:t,value:o[0].value||""})}if(Vn(t)){const n=io(e);eo({e:t,value:n})}}})(Dn(n.country||null,r),i);const c=Dn(n.country_iso_2||null,r);if(Wn(c))if(Qn(c,i.country_iso_2))eo({e:c,value:i.country_iso_2});else{let t=Zn(c,i.country_iso_2);t.length>0?eo({e:c,value:t[0].value||""}):(t=Zn(c,io(i)),t.length>0&&eo({e:c,value:t[0].value||""}))}Vn(c)&&Xn(c,i.country_iso_2||"");const u=Dn(n.country_iso||null,r);if(Wn(u))if(Qn(u,i.country_iso))eo({e:u,value:i.country_iso});else{let t=Zn(u,i.country_iso);t.length>0?eo({e:u,value:t[0].value||""}):(t=Zn(u,io(i)),t.length>0&&eo({e:u,value:t[0].value||""}))}Vn(u)&&Xn(u,i.country_iso||"");const l=Dn(wo(n),r),d=Eo(i),h=So(i);if(Wn(l))if(Qn(l,d))eo({e:l,value:d});else if(Qn(l,h||""))eo({e:l,value:h||""});else{let t=Zn(l,h);t.length>0?eo({e:l,value:t[0].value||""}):(t=Zn(l,d),t&&eo({e:l,value:t[0].value||""}))}let p;for(p in Vn(l)&&Xn(l,d),n)if(!a.includes(p))if(p.startsWith("native."))bo(p,n,i,r);else if(void 0!==i[p]&&n.hasOwnProperty(p)){const t=n[p];if(!t)continue;Xn(Dn(t,r),ho(i,p))}},bo=(t,e,n,o)=>{const i=t.replace("native.",""),r=n.native;if(void 0===r)return;if(void 0!==r[i]&&e.hasOwnProperty(t)){const n=e[t];if(!n)return;Xn(Dn(n,o),ho(r,i))}},vo=t=>(0===t.organisation_name.length||0===t.line_2.length&&0===t.line_3.length||t.line_1===t.organisation_name&&(t.line_1=t.line_2,t.line_2=t.line_3,t.line_3=""),t),wo=t=>(t=>t.hasOwnProperty("state_abbreviation"))(t)?t.state_abbreviation||null:t.county_code||null,Eo=t=>Gn(t)?t.county_code:t.state_abbreviation,So=t=>Gn(t)?t.county:t.state,xo={13:"Enter",38:"ArrowUp",40:"ArrowDown",36:"Home",35:"End",27:"Escape",8:"Backspace"},Co=["Enter","ArrowUp","ArrowDown","Home","End","Escape","Backspace"],To=t=>{return t.keyCode?xo[t.keyCode]||null: