woocommerce/packages/woocommerce-admin/dist/navigation/index.js
2021-12-10 12:03:04 +00:00

1 line
24 KiB
JavaScript

this.wc=this.wc||{},this.wc.navigation=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=467)}({0:function(e,t){e.exports=window.wp.element},15:function(e,t){e.exports=window.wp.url},23:function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},3:function(e,t){e.exports=window.wp.components},30:function(e,t){e.exports=window.wp.hooks},32:function(e,t,n){"use strict";var r=n(67),o=n(68),i=n(39);e.exports={formats:i,parse:o,stringify:r}},39:function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g,i="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return String(e)}},RFC1738:i,RFC3986:a}},4:function(e,t){e.exports=window.lodash},41:function(e,t,n){"use strict";t.a=function(e,t){if(!e)throw new Error("Invariant failed")}},467:function(e,t,n){"use strict";n.r(t),n.d(t,"getHistory",(function(){return f})),n.d(t,"flattenFilters",(function(){return p})),n.d(t,"getActiveFiltersFromQuery",(function(){return d})),n.d(t,"getDefaultOptionValue",(function(){return h})),n.d(t,"getQueryFromActiveFilters",(function(){return y})),n.d(t,"getUrlKey",(function(){return v})),n.d(t,"getPath",(function(){return m})),n.d(t,"getPersistedQuery",(function(){return g})),n.d(t,"getQueryExcludedScreens",(function(){return w})),n.d(t,"pathIsExcluded",(function(){return b})),n.d(t,"getScreenFromPath",(function(){return O})),n.d(t,"getIdsFromQuery",(function(){return j})),n.d(t,"getSetOfIdsFromQuery",(function(){return x})),n.d(t,"getSearchWords",(function(){return P})),n.d(t,"getNewPath",(function(){return k})),n.d(t,"getQuery",(function(){return E})),n.d(t,"onQueryChange",(function(){return S})),n.d(t,"updateQueryString",(function(){return A})),n.d(t,"addHistoryListener",(function(){return L})),n.d(t,"WooNavigationItem",(function(){return N}));var r=n(0),o=n(15),i=n(32),a=n(4),c=n(30),u=n(3),s=n(52);let l;function f(){if(!l){const e=document.location.pathname,t=Object(s.a)({basename:e.substring(0,e.lastIndexOf("/"))});l={get length(){return t.length},get action(){return t.action},get location(){const{location:e}=t,n=Object(i.parse)(e.search.substring(1)).path||"/";return{...e,pathname:n}},createHref:(...e)=>t.createHref.apply(t,e),push:(...e)=>t.push.apply(t,e),replace:(...e)=>t.replace.apply(t,e),go:(...e)=>t.go.apply(t,e),goBack:(...e)=>t.goBack.apply(t,e),goForward:(...e)=>t.goForward.apply(t,e),block:(...e)=>t.block.apply(t,e),listen(e){return t.listen(()=>{e(this.location,this.action)})}}}return l}function p(e){const t=[];return e.forEach(e=>{if(e.subFilters){t.push(Object(a.omit)(e,"subFilters"));const n=p(e.subFilters);t.push(...n)}else t.push(e)}),t}function d(e,t){return Object.keys(t).reduce((n,r)=>{const o=t[r];if(o.rules){const t=o.rules.filter(t=>e.hasOwnProperty(v(r,t.value)));if(t.length)if(o.allowMultiple)t.forEach(t=>{e[v(r,t.value)].forEach(e=>{n.push({key:r,rule:t.value,value:e})})});else{const o=e[v(r,t[0].value)];n.push({key:r,rule:t[0].value,value:o})}}else if(e[r])if(o.allowMultiple){e[r].forEach(e=>{n.push({key:r,value:e})})}else n.push({key:r,value:e[r]});return n},[])}function h(e,t){const{defaultOption:n}=e.input;if(e.input.defaultOption){const r=Object(a.find)(t,{value:n});return r?r.value:void console.warn(`invalid defaultOption ${n} supplied to ${e.labels.add}`)}return Object(a.get)(t,[0,"value"])}function y(e,t,n){return{...d(t,n).reduce((e,t)=>(e[v(t.key,t.rule)]=void 0,e),{}),...e.reduce((e,t)=>{if("between"===t.rule&&(!Array.isArray(t.value)||t.value.some(e=>!e)))return e;if(t.value){const r=v(t.key,t.rule);n[t.key]&&n[t.key].allowMultiple?(e.hasOwnProperty(r)||(e[r]=[]),e[r].push(t.value)):e[r]=t.value}return e},{})}}function v(e,t){return t&&t.length?`${e}_${t}`:e}const m=()=>f().location.pathname,g=(e=E())=>{const t=Object(c.applyFilters)("woocommerce_admin_persisted_queries",["period","compare","before","after","interval","type"]);return Object(a.pick)(e,t)},w=()=>Object(c.applyFilters)("woocommerce_admin_time_excluded_screens",["stock","settings","customers","homescreen"]),b=e=>w().includes(O(e)),O=(e=m())=>"/"===e?"homescreen":e.replace("/analytics","").replace("/","");function j(e=""){return[...x(e)]}function x(e=""){return new Set(e.split(",").map(e=>parseInt(e,10)).filter(e=>!isNaN(e)))}function P(e=E()){if("object"!=typeof e)throw new Error("Invalid parameter passed to getSearchWords, it expects an object or no parameters.");const{search:t}=e;if(!t)return[];if("string"!=typeof t)throw new Error("Invalid 'search' type. getSearchWords expects query's 'search' property to be a string.");return t.split(",").map(e=>e.replace("%2C",","))}function k(e,t=m(),n=E(),r="wc-admin"){const i={page:r,...n,...e};return"/"!==t&&(i.path=t),Object(o.addQueryArgs)("admin.php",i)}function E(){const e=f().location.search;return e.length&&Object(i.parse)(e.substring(1))||{}}function S(e,t=m(),n=E()){switch(e){case"sort":return(e,r)=>A({orderby:e,order:r},t,n);case"compare":return(e,r,o)=>A({[r]:"compare-"+e,[e]:o,search:void 0},t,n);default:return r=>A({[e]:r},t,n)}}function A(e,t=m(),n=E(),r="wc-admin"){const o=k(e,t,n,r);f().push(o)}const L=e=>(window.wcNavigation&&!window.wcNavigation.historyPatched&&(e=>{const t=e.pushState,n=e.replaceState;e.pushState=function(n){const r=new CustomEvent("pushstate",{state:n});return window.dispatchEvent(r),t.apply(e,arguments)},e.replaceState=function(t){const r=new CustomEvent("replacestate",{state:t});return window.dispatchEvent(r),n.apply(e,arguments)},window.wcNavigation.historyPatched=!0})(window.history),window.addEventListener("popstate",e),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}),N=({children:e,item:t})=>Object(r.createElement)(u.Fill,{name:"woocommerce_navigation_"+t},e);N.Slot=({name:e})=>Object(r.createElement)(u.Slot,{name:"woocommerce_navigation_"+e})},49:function(e,t,n){"use strict";var r=n(39),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),c=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:c,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],c=Object.keys(a),u=0;u<c.length;++u){var s=c[u],l=a[s];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(t.push({obj:a,prop:s}),n.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var c=e;if("symbol"==typeof e?c=Symbol.prototype.toString.call(e):"string"!=typeof e&&(c=String(e)),"iso-8859-1"===n)return escape(c).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var u="",s=0;s<c.length;++s){var l=c.charCodeAt(s);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===r.RFC1738&&(40===l||41===l)?u+=c.charAt(s):l<128?u+=a[l]:l<2048?u+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?u+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(s+=1,l=65536+((1023&l)<<10|1023&c.charCodeAt(s)),u+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return u},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return i(t)&&!i(n)&&(a=c(t,r)),i(t)&&i(n)?(n.forEach((function(n,i){if(o.call(t,i)){var a=t[i];a&&"object"==typeof a&&n&&"object"==typeof n?t[i]=e(a,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var a=n[i];return o.call(t,i)?t[i]=e(t[i],a,r):t[i]=a,t}),a)}}},52:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return j})),n.d(t,"b",(function(){return h})),n.d(t,"e",(function(){return y})),n.d(t,"d",(function(){return d}));var r=n(23);function o(e){return"/"===e.charAt(0)}function i(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}var a=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],c=e&&o(e),u=t&&o(t),s=c||u;if(e&&o(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var l=a[a.length-1];n="."===l||".."===l||""===l}else n=!1;for(var f=0,p=a.length;p>=0;p--){var d=a[p];"."===d?i(a,p):".."===d?(i(a,p),f++):f&&(i(a,p),f--)}if(!s)for(;f--;f)a.unshift("..");!s||""===a[0]||a[0]&&o(a[0])||a.unshift("");var h=a.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function c(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var u=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=c(t),o=c(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},s=n(41);function l(e){return"/"===e.charAt(0)?e:"/"+e}function f(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function d(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function h(e,t,n,o){var i;"string"==typeof e?(i=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(i=Object(r.a)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(i.key=n),o?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=a(i.pathname,o.pathname)):i.pathname=o.pathname:i.pathname||(i.pathname="/"),i}function y(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&u(e.state,t.state)}function v(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var m=!("undefined"==typeof window||!window.document||!window.document.createElement);function g(e,t){t(window.confirm(e))}function w(){try{return window.history.state||{}}catch(e){return{}}}function b(e){void 0===e&&(e={}),m||Object(s.a)(!1);var t,n=window.history,o=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,i=!(-1===window.navigator.userAgent.indexOf("Trident")),a=e,c=a.forceRefresh,u=void 0!==c&&c,y=a.getUserConfirmation,b=void 0===y?g:y,O=a.keyLength,j=void 0===O?6:O,x=e.basename?p(l(e.basename)):"";function P(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return x&&(i=f(i,x)),h(i,r,n)}function k(){return Math.random().toString(36).substr(2,j)}var E=v();function S(e){Object(r.a)(_,e),_.length=n.length,E.notifyListeners(_.location,_.action)}function A(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||C(P(e.state))}function L(){C(P(w()))}var N=!1;function C(e){if(N)N=!1,S();else{E.confirmTransitionTo(e,"POP",b,(function(t){t?S({action:"POP",location:e}):function(e){var t=_.location,n=T.indexOf(t.key);-1===n&&(n=0);var r=T.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(N=!0,H(o))}(e)}))}}var F=P(w()),T=[F.key];function D(e){return x+d(e)}function H(e){n.go(e)}var Q=0;function R(e){1===(Q+=e)&&1===e?(window.addEventListener("popstate",A),i&&window.addEventListener("hashchange",L)):0===Q&&(window.removeEventListener("popstate",A),i&&window.removeEventListener("hashchange",L))}var I=!1;var _={length:n.length,action:"POP",location:F,createHref:D,push:function(e,t){var r=h(e,t,k(),_.location);E.confirmTransitionTo(r,"PUSH",b,(function(e){if(e){var t=D(r),i=r.key,a=r.state;if(o)if(n.pushState({key:i,state:a},null,t),u)window.location.href=t;else{var c=T.indexOf(_.location.key),s=T.slice(0,c+1);s.push(r.key),T=s,S({action:"PUSH",location:r})}else window.location.href=t}}))},replace:function(e,t){var r=h(e,t,k(),_.location);E.confirmTransitionTo(r,"REPLACE",b,(function(e){if(e){var t=D(r),i=r.key,a=r.state;if(o)if(n.replaceState({key:i,state:a},null,t),u)window.location.replace(t);else{var c=T.indexOf(_.location.key);-1!==c&&(T[c]=r.key),S({action:"REPLACE",location:r})}else window.location.replace(t)}}))},go:H,goBack:function(){H(-1)},goForward:function(){H(1)},block:function(e){void 0===e&&(e=!1);var t=E.setPrompt(e);return I||(R(1),I=!0),function(){return I&&(I=!1,R(-1)),t()}},listen:function(e){var t=E.appendListener(e);return R(1),function(){R(-1),t()}}};return _}function O(e,t,n){return Math.min(Math.max(e,t),n)}function j(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,o=t.initialEntries,i=void 0===o?["/"]:o,a=t.initialIndex,c=void 0===a?0:a,u=t.keyLength,s=void 0===u?6:u,l=v();function f(e){Object(r.a)(b,e),b.length=b.entries.length,l.notifyListeners(b.location,b.action)}function p(){return Math.random().toString(36).substr(2,s)}var y=O(c,0,i.length-1),m=i.map((function(e){return h(e,void 0,"string"==typeof e?p():e.key||p())})),g=d;function w(e){var t=O(b.index+e,0,b.entries.length-1),r=b.entries[t];l.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var b={length:m.length,action:"POP",location:m[y],index:y,entries:m,createHref:g,push:function(e,t){var r=h(e,t,p(),b.location);l.confirmTransitionTo(r,"PUSH",n,(function(e){if(e){var t=b.index+1,n=b.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=h(e,t,p(),b.location);l.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(b.entries[b.index]=r,f({action:"REPLACE",location:r}))}))},go:w,goBack:function(){w(-1)},goForward:function(){w(1)},canGo:function(e){var t=b.index+e;return t>=0&&t<b.entries.length},block:function(e){return void 0===e&&(e=!1),l.setPrompt(e)},listen:function(e){return l.appendListener(e)}};return b}},67:function(e,t,n){"use strict";var r=n(49),o=n(39),i=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,u=Array.prototype.push,s=function(e,t){u.apply(e,c(t)?t:[t])},l=Date.prototype.toISOString,f=o.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:f,formatter:o.formatters[f],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},d=function e(t,n,o,i,a,u,l,f,d,h,y,v,m,g){var w,b=t;if("function"==typeof l?b=l(n,b):b instanceof Date?b=h(b):"comma"===o&&c(b)&&(b=r.maybeMap(b,(function(e){return e instanceof Date?h(e):e}))),null===b){if(i)return u&&!m?u(n,p.encoder,g,"key",y):n;b=""}if("string"==typeof(w=b)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||r.isBuffer(b))return u?[v(m?n:u(n,p.encoder,g,"key",y))+"="+v(u(b,p.encoder,g,"value",y))]:[v(n)+"="+v(String(b))];var O,j=[];if(void 0===b)return j;if("comma"===o&&c(b))O=[{value:b.length>0?b.join(",")||null:void 0}];else if(c(l))O=l;else{var x=Object.keys(b);O=f?x.sort(f):x}for(var P=0;P<O.length;++P){var k=O[P],E="object"==typeof k&&void 0!==k.value?k.value:b[k];if(!a||null!==E){var S=c(b)?"function"==typeof o?o(n,k):n:n+(d?"."+k:"["+k+"]");s(j,e(E,S,o,i,a,u,l,f,d,h,y,v,m,g))}}return j};e.exports=function(e,t){var n,r=e,u=function(e){if(!e)return p;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||p.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!i.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],a=p.filter;return("function"==typeof e.filter||c(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:p.addQueryPrefix,allowDots:void 0===e.allowDots?p.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,delimiter:void 0===e.delimiter?p.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:p.encode,encoder:"function"==typeof e.encoder?e.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:p.encodeValuesOnly,filter:a,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:p.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling}}(t);"function"==typeof u.filter?r=(0,u.filter)("",r):c(u.filter)&&(n=u.filter);var l,f=[];if("object"!=typeof r||null===r)return"";l=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=a[l];n||(n=Object.keys(r)),u.sort&&n.sort(u.sort);for(var y=0;y<n.length;++y){var v=n[y];u.skipNulls&&null===r[v]||s(f,d(r[v],v,h,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.format,u.formatter,u.encodeValuesOnly,u.charset))}var m=f.join(u.delimiter),g=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),m.length>0?g+m:""}},68:function(e,t,n){"use strict";var r=n(49),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},c=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},s=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,c=n.depth>0&&/(\[[^[\]]*])/.exec(i),s=c?i.slice(0,c.index):i,l=[];if(s){if(!n.plainObjects&&o.call(Object.prototype,s)&&!n.allowPrototypes)return;l.push(s)}for(var f=0;n.depth>0&&null!==(c=a.exec(i))&&f<n.depth;){if(f+=1,!n.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+i.slice(c.index)+"]"),function(e,t,n,r){for(var o=r?t:u(t,n),i=e.length-1;i>=0;--i){var a,c=e[i];if("[]"===c&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var s="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,l=parseInt(s,10);n.parseArrays||""!==s?!isNaN(l)&&c!==s&&String(l)===s&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(a=[])[l]=o:a[s]=o:a={0:o}}o=a}return o}(l,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var n,s={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=l.split(t.delimiter,f),d=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<p.length;++n)0===p[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[n]?h="utf-8":"utf8=%26%2310003%3B"===p[n]&&(h="iso-8859-1"),d=n,n=p.length);for(n=0;n<p.length;++n)if(n!==d){var y,v,m=p[n],g=m.indexOf("]="),w=-1===g?m.indexOf("="):g+1;-1===w?(y=t.decoder(m,a.decoder,h,"key"),v=t.strictNullHandling?null:""):(y=t.decoder(m.slice(0,w),a.decoder,h,"key"),v=r.maybeMap(u(m.slice(w+1),t),(function(e){return t.decoder(e,a.decoder,h,"value")}))),v&&t.interpretNumericEntities&&"iso-8859-1"===h&&(v=c(v)),m.indexOf("[]=")>-1&&(v=i(v)?[v]:v),o.call(s,y)?s[y]=r.combine(s[y],v):s[y]=v}return s}(e,n):e,f=n.plainObjects?Object.create(null):{},p=Object.keys(l),d=0;d<p.length;++d){var h=p[d],y=s(h,l[h],n,"string"==typeof e);f=r.merge(f,y,n)}return r.compact(f)}}});