diff --git a/dist/index.es.js b/dist/index.es.js index 085f5b35..a9eab2a7 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -1 +1 @@ -function t(){return(t=Object.assign||function(t){for(var r=1;r1&&"boolean"!=typeof r)throw new y('"allowMissing" argument must be a boolean');var e=R(t),n=e.length>0?e[0]:"",o=I("%"+n+"%",r),i=o.name,u=o.value,c=!1,s=o.alias;s&&(n=s[0],O(e,A([0,1],s)));for(var l=1,d=!0;l=e.length){var m=p(u,b);u=(d=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[b]}else d=a(u,b),u=u[b];d&&!c&&(g[i]=u)}}return u},M=(function(t){var r=k("%Function.prototype.apply%"),e=k("%Function.prototype.call%"),n=k("%Reflect.apply%",!0)||i.call(e,r),o=k("%Object.getOwnPropertyDescriptor%",!0),a=k("%Object.defineProperty%",!0),f=k("%Math.max%");if(a)try{a({},"a",{value:1})}catch(t){a=null}t.exports=function(t){var r=n(i,e,arguments);if(o&&a){var u=o(r,"length");u.configurable&&a(r,"length",{value:1+f(0,t.length-(arguments.length-1))})}return r};var u=function(){return n(i,r,arguments)};a?a(t.exports,"apply",{value:u}):t.exports.apply=u}(s={exports:{}}),s.exports),x=M(k("String.prototype.indexOf")),U=function(t,r){var e=k(t,!!r);return"function"==typeof e&&x(t,".prototype.")>-1?M(e):e},W="function"==typeof Map&&Map.prototype,$=Object.getOwnPropertyDescriptor&&W?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,N=W&&$&&"function"==typeof $.get?$.get:null,B=W&&Map.prototype.forEach,T="function"==typeof Set&&Set.prototype,C=Object.getOwnPropertyDescriptor&&T?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,_=T&&C&&"function"==typeof C.get?C.get:null,D=T&&Set.prototype.forEach,G="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,q="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,V="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,z=Boolean.prototype.valueOf,J=Object.prototype.toString,L=Function.prototype.toString,H=String.prototype.match,Z="function"==typeof BigInt?BigInt.prototype.valueOf:null,Q=Object.getOwnPropertySymbols,K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,X="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Y=Object.prototype.propertyIsEnumerable,tt=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),rt={__proto__:null,default:{}}.custom,et=rt&&ut(rt)?rt:null,nt="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null,ot=function t(r,e,n,o){var i=e||{};if(ct(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ct(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&Infinity!==i.maxStringLength:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!ct(i,"customInspect")||i.customInspect;if("boolean"!=typeof a&&"symbol"!==a)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ct(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return lt(r,i);if("number"==typeof r)return 0===r?Infinity/r>0?"0":"-0":String(r);if("bigint"==typeof r)return String(r)+"n";var f=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=f&&f>0&&"object"==typeof r)return ft(r)?"[Array]":"[Object]";var u,y=function(t,r){var e;if("\t"===t.indent)e="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;e=Array(t.indent+1).join(" ")}return{base:e,prev:Array(r+1).join(e)}}(i,n);if(void 0===o)o=[];else if(st(o,r)>=0)return"[Circular]";function c(r,e,a){if(e&&(o=o.slice()).push(e),a){var f={depth:i.depth};return ct(i,"quoteStyle")&&(f.quoteStyle=i.quoteStyle),t(r,f,n+1,o)}return t(r,i,n+1,o)}if("function"==typeof r){var p=function(t){if(t.name)return t.name;var r=H.call(L.call(t),/^function\s*([\w$]+)/);return r?r[1]:null}(r),s=gt(r,c);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(s.length>0?" { "+s.join(", ")+" }":"")}if(ut(r)){var l=X?String(r).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):K.call(r);return"object"!=typeof r||X?l:bt(l)}if((u=r)&&"object"==typeof u&&("undefined"!=typeof HTMLElement&&u instanceof HTMLElement||"string"==typeof u.nodeName&&"function"==typeof u.getAttribute)){for(var d="<"+String(r.nodeName).toLowerCase(),b=r.attributes||[],v=0;v"}if(ft(r)){if(0===r.length)return"[]";var h=gt(r,c);return y&&!function(t){for(var r=0;r=0)return!1;return!0}(h)?"["+mt(h,y)+"]":"[ "+h.join(", ")+" ]"}if(function(t){return!("[object Error]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r)){var m=gt(r,c);return 0===m.length?"["+String(r)+"]":"{ ["+String(r)+"] "+m.join(", ")+" }"}if("object"==typeof r&&a){if(et&&"function"==typeof r[et])return r[et]();if("symbol"!==a&&"function"==typeof r.inspect)return r.inspect()}if(function(t){if(!N||!t||"object"!=typeof t)return!1;try{N.call(t);try{_.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(r)){var g=[];return B.call(r,function(t,e){g.push(c(e,r,!0)+" => "+c(t,r))}),ht("Map",N.call(r),g,y)}if(function(t){if(!_||!t||"object"!=typeof t)return!1;try{_.call(t);try{N.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(r)){var j=[];return D.call(r,function(t){j.push(c(t,r))}),ht("Set",_.call(r),j,y)}if(function(t){if(!G||!t||"object"!=typeof t)return!1;try{G.call(t,G);try{q.call(t,q)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(r))return vt("WeakMap");if(function(t){if(!q||!t||"object"!=typeof t)return!1;try{q.call(t,q);try{G.call(t,G)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(r))return vt("WeakSet");if(function(t){if(!V||!t||"object"!=typeof t)return!1;try{return V.call(t),!0}catch(t){}return!1}(r))return vt("WeakRef");if(function(t){return!("[object Number]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r))return bt(c(Number(r)));if(function(t){if(!t||"object"!=typeof t||!Z)return!1;try{return Z.call(t),!0}catch(t){}return!1}(r))return bt(c(Z.call(r)));if(function(t){return!("[object Boolean]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r))return bt(z.call(r));if(function(t){return!("[object String]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r))return bt(c(String(r)));if(!function(t){return!("[object Date]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r)&&!function(t){return!("[object RegExp]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r)){var S=gt(r,c),A=tt?tt(r)===Object.prototype:r instanceof Object||r.constructor===Object,O=r instanceof Object?"":"null prototype",w=!A&&nt&&Object(r)===r&&nt in r?pt(r).slice(8,-1):O?"Object":"",P=(A||"function"!=typeof r.constructor?"":r.constructor.name?r.constructor.name+" ":"")+(w||O?"["+[].concat(w||[],O||[]).join(": ")+"] ":"");return 0===S.length?P+"{}":y?P+"{"+mt(S,y)+"}":P+"{ "+S.join(", ")+" }"}return String(r)};function it(t,r,e){var n="double"===(e.quoteStyle||r)?'"':"'";return n+t+n}function at(t){return String(t).replace(/"/g,""")}function ft(t){return!("[object Array]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}function ut(t){if(X)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!K)return!1;try{return K.call(t),!0}catch(t){}return!1}var yt=Object.prototype.hasOwnProperty||function(t){return t in this};function ct(t,r){return yt.call(t,r)}function pt(t){return J.call(t)}function st(t,r){if(t.indexOf)return t.indexOf(r);for(var e=0,n=t.length;er.maxStringLength){var e=t.length-r.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return lt(t.slice(0,r.maxStringLength),r)+n}return it(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,dt),"single",r)}function dt(t){var r=t.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return e?"\\"+e:"\\x"+(r<16?"0":"")+r.toString(16).toUpperCase()}function bt(t){return"Object("+t+")"}function vt(t){return t+" { ? }"}function ht(t,r,e,n){return t+" ("+r+") {"+(n?mt(e,n):e.join(", "))+"}"}function mt(t,r){if(0===t.length)return"";var e="\n"+r.prev+r.base;return e+t.join(","+e)+"\n"+r.prev}function gt(t,r){var e=ft(t),n=[];if(e){n.length=t.length;for(var o=0;o1;){var r=t.pop(),e=r.obj[r.prop];if($t(e)){for(var n=[],o=0;o=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===Ut.RFC1738&&(40===u||41===u)?a+=i.charAt(f):u<128?a+=Nt[u]:u<2048?a+=Nt[192|u>>6]+Nt[128|63&u]:u<55296||u>=57344?a+=Nt[224|u>>12]+Nt[128|u>>6&63]+Nt[128|63&u]:(u=65536+((1023&u)<<10|1023&i.charCodeAt(f+=1)),a+=Nt[240|u>>18]+Nt[128|u>>12&63]+Nt[128|u>>6&63]+Nt[128|63&u])}return a},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if($t(t)){for(var e=[],n=0;n0?h.join(",")||null:void 0}];else if(Dt(f))m=f;else{var j=Object.keys(h);m=u?j.sort(u):j}for(var S=0;S-1?t.split(","):t},Yt=function(t,r,e,n){if(t){var o=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,a=e.depth>0&&/(\[[^[\]]*])/.exec(o),f=a?o.slice(0,a.index):o,u=[];if(f){if(!e.plainObjects&&Ht.call(Object.prototype,f)&&!e.allowPrototypes)return;u.push(f)}for(var y=0;e.depth>0&&null!==(a=i.exec(o))&&y=0;--i){var a,f=t[i];if("[]"===f&&e.parseArrays)a=[].concat(o);else{a=e.plainObjects?Object.create(null):{};var u="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,y=parseInt(u,10);e.parseArrays||""!==u?!isNaN(y)&&f!==u&&String(y)===u&&y>=0&&e.parseArrays&&y<=e.arrayLimit?(a=[])[y]=o:a[u]=o:a={0:o}}o=a}return o}(u,r,e,n)}};class tr{constructor(t,r,e){var n;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.config=e}get template(){return`${this.config.absolute?this.definition.domain?`${this.config.url.match(/^\w+:\/\//)[0]}${this.definition.domain}${this.config.port?`:${this.config.port}`:""}`:this.config.url:""}/${this.definition.uri}`.replace(/\/+$/,"")}get parameterSegments(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(t=>({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(t){if(!this.definition.methods.includes("GET"))return!1;const r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp(`^${r}$`).test(t.replace(/\/+$/,"").split("?").shift())}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,(r,e)=>{var n;if([null,void 0].includes(t[e])&&this.parameterSegments.find(({name:t})=>t===e).required)throw new Error(`Ziggy error: '${e}' parameter is required for route '${this.name}'.`);return encodeURIComponent(null!=(n=t[e])?n:"")}).replace(/\/+$/,""):this.template}}class rr extends String{constructor(r,e,n=!0,o){if(super(),this.t=null!=o?o:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,this.t=t({},this.t,{absolute:n}),r){if(!this.t.routes[r])throw new Error(`Ziggy error: route '${r}' is not in the route list.`);this.i=new tr(r,this.t.routes[r],this.t),this.u=this.p(e)}}toString(){const r=Object.keys(this.u).filter(t=>!this.i.parameterSegments.some(({name:r})=>r===t)).filter(t=>"_query"!==t).reduce((r,e)=>t({},r,{[e]:this.u[e]}),{});return this.i.compile(this.u)+function(t,r){var e,n=t,o=function(t){if(!t)return Jt;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||Jt.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=Ut.default;if(void 0!==t.format){if(!Ct.call(Ut.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var n=Ut.formatters[e],o=Jt.filter;return("function"==typeof t.filter||Dt(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:Jt.addQueryPrefix,allowDots:void 0===t.allowDots?Jt.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Jt.charsetSentinel,delimiter:void 0===t.delimiter?Jt.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:Jt.encode,encoder:"function"==typeof t.encoder?t.encoder:Jt.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:Jt.encodeValuesOnly,filter:o,format:e,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:Jt.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:Jt.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Jt.strictNullHandling}}(r);"function"==typeof o.filter?n=(0,o.filter)("",n):Dt(o.filter)&&(e=o.filter);var i=[];if("object"!=typeof n||null===n)return"";var a=_t[r&&r.arrayFormat in _t?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(n)),o.sort&&e.sort(o.sort);for(var f=kt(),u=0;u0?p+c:""}(t({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,r)=>"boolean"==typeof t?Number(t):r(t)})}current(t,r){const e=this.t.absolute?this.l().host+this.l().pathname:this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),[n,o]=Object.entries(this.t.routes).find(([r,n])=>new tr(t,n,this.t).matchesUrl(e))||[void 0,void 0];if(!t)return n;const i=new RegExp(`^${t.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(n);if([null,void 0].includes(r)||!i)return i;const a=new tr(n,o,this.t);r=this.p(r,a);const f=this.v(o);return!(!Object.values(r).every(t=>!t)||Object.values(f).length)||Object.entries(r).every(([t,r])=>f[t]==r)}l(){var t,r,e,n,o,i;const{host:a="",pathname:f="",search:u=""}="undefined"!=typeof window?window.location:{};return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:a,pathname:null!=(e=null==(n=this.t.location)?void 0:n.pathname)?e:f,search:null!=(o=null==(i=this.t.location)?void 0:i.search)?o:u}}get params(){return this.v(this.t.routes[this.current()])}has(t){return Object.keys(this.t.routes).includes(t)}p(r={},e=this.i){r=["string","number"].includes(typeof r)?[r]:r;const n=e.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(r)?r=r.reduce((r,e,o)=>t({},r,n[o]?{[n[o].name]:e}:{[e]:""}),{}):1!==n.length||r[n[0].name]||!r.hasOwnProperty(Object.values(e.bindings)[0])&&!r.hasOwnProperty("id")||(r={[n[0].name]:r}),t({},this.h(e),this.m(r,e))}h(r){return r.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((r,{name:e},n)=>t({},r,{[e]:this.t.defaults[e]}),{})}m(r,{bindings:e,parameterSegments:n}){return Object.entries(r).reduce((r,[o,i])=>{if(!i||"object"!=typeof i||Array.isArray(i)||!n.some(({name:t})=>t===o))return t({},r,{[o]:i});if(!i.hasOwnProperty(e[o])){if(!i.hasOwnProperty("id"))throw new Error(`Ziggy error: object passed as '${o}' parameter is missing route model binding key '${e[o]}'.`);e[o]="id"}return t({},r,{[o]:i[e[o]]})},{})}v(r){var e;let n=this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"");const o=(r,e="",n)=>{const[o,i]=[r,e].map(t=>t.split(n));return i.reduce((r,e,n)=>/{[^}?]+\??}/.test(e)&&o[n]?t({},r,{[e.replace(/.*{|\??}.*/g,"")]:o[n].replace(e.match(/^[^{]*/g),"").replace(e.match(/[^}]*$/g),"")}):r,{})};return t({},o(this.l().host,r.domain,"."),o(n,r.uri,"/"),function(t,r){var e=Qt;if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},o=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),i=-1,a=r.charset;if(r.charsetSentinel)for(e=0;e-1&&(u=Zt(u)?[u]:u),n[f]=Ht.call(n,f)?Tt.combine(n[f],u):u}return n}(t,e):t,o=e.plainObjects?Object.create(null):{},i=Object.keys(n),a=0;a1;){var r=t.pop(),e=r.obj[r.prop];if(o(e)){for(var n=[],i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===n.RFC1738&&(40===c||41===c)?f+=s.charAt(a):c<128?f+=u[c]:c<2048?f+=u[192|c>>6]+u[128|63&c]:c<55296||c>=57344?f+=u[224|c>>12]+u[128|c>>6&63]+u[128|63&c]:(c=65536+((1023&c)<<10|1023&s.charCodeAt(a+=1)),f+=u[240|c>>18]+u[128|c>>12&63]+u[128|c>>6&63]+u[128|63&c])}return f},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if(o(t)){for(var e=[],n=0;n0?O.join(",")||null:void 0}];else if(l(s))R=s;else{var C=Object.keys(O);R=a?C.sort(a):C}for(var x=0;x-1?t.split(","):t},S=function(t,r,e,n){if(t){var i=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,u=e.depth>0&&/(\[[^[\]]*])/.exec(i),s=u?i.slice(0,u.index):i,f=[];if(s){if(!e.plainObjects&&m.call(Object.prototype,s)&&!e.allowPrototypes)return;f.push(s)}for(var a=0;e.depth>0&&null!==(u=o.exec(i))&&a=0;--o){var u,s=t[o];if("[]"===s&&e.parseArrays)u=[].concat(i);else{u=e.plainObjects?Object.create(null):{};var f="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,a=parseInt(f,10);e.parseArrays||""!==f?!isNaN(a)&&s!==f&&String(a)===f&&a>=0&&e.parseArrays&&a<=e.arrayLimit?(u=[])[a]=i:"__proto__"!==f&&(u[f]=i):u={0:i}}i=u}return i}(f,r,e,n)}};class E{constructor(t,r,e){var n,i;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.wheres=null!=(i=r.wheres)?i:{},this.config=e}get template(){return`${this.config.absolute?this.definition.domain?`${this.config.url.match(/^\w+:\/\//)[0]}${this.definition.domain}${this.config.port?`:${this.config.port}`:""}`:this.config.url:""}/${this.definition.uri}`.replace(/\/+$/,"")}get parameterSegments(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(t=>({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(t){if(!this.definition.methods.includes("GET"))return!1;const r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp(`^${r}$`).test(t.replace(/\/+$/,"").split("?").shift())}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,(r,e)=>{var n,i;if([null,void 0].includes(t[e])&&this.parameterSegments.find(({name:t})=>t===e).required)throw new Error(`Ziggy error: '${e}' parameter is required for route '${this.name}'.`);return this.parameterSegments[this.parameterSegments.length-1].name===e&&".*"===this.wheres[e]?null!=(i=t[e])?i:"":encodeURIComponent(null!=(n=t[e])?n:"")}).replace(/\/+$/,""):this.template}}class R extends String{constructor(r,e,n=!0,i){if(super(),this.t=null!=i?i:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,this.t=t({},this.t,{absolute:n}),r){if(!this.t.routes[r])throw new Error(`Ziggy error: route '${r}' is not in the route list.`);this.i=new E(r,this.t.routes[r],this.t),this.u=this.l(e)}}toString(){const r=Object.keys(this.u).filter(t=>!this.i.parameterSegments.some(({name:r})=>r===t)).filter(t=>"_query"!==t).reduce((r,e)=>t({},r,{[e]:this.u[e]}),{});return this.i.compile(this.u)+function(t,r){var e,i=t,o=function(t){if(!t)return b;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||b.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=n.default;if(void 0!==t.format){if(!a.call(n.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var i=n.formatters[e],o=b.filter;return("function"==typeof t.filter||l(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:b.addQueryPrefix,allowDots:void 0===t.allowDots?b.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:b.charsetSentinel,delimiter:void 0===t.delimiter?b.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:b.encode,encoder:"function"==typeof t.encoder?t.encoder:b.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:b.encodeValuesOnly,filter:o,format:e,formatter:i,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:b.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:b.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:b.strictNullHandling}}(r);"function"==typeof o.filter?i=(0,o.filter)("",i):l(o.filter)&&(e=o.filter);var u=[];if("object"!=typeof i||null===i)return"";var s=c[r&&r.arrayFormat in c?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(i)),o.sort&&e.sort(o.sort);for(var f=0;f0?v+p:""}(t({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,r)=>"boolean"==typeof t?Number(t):r(t)})}current(t,r){const e=this.t.absolute?this.h().host+this.h().pathname:this.h().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),[n,i]=Object.entries(this.t.routes).find(([r,n])=>new E(t,n,this.t).matchesUrl(e))||[void 0,void 0];if(!t)return n;const o=new RegExp(`^${t.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(n);if([null,void 0].includes(r)||!o)return o;const u=new E(n,i,this.t);r=this.l(r,u);const s=this.p(i);return!(!Object.values(r).every(t=>!t)||Object.values(s).length)||Object.entries(r).every(([t,r])=>s[t]==r)}h(){var t,r,e,n,i,o;const{host:u="",pathname:s="",search:f=""}="undefined"!=typeof window?window.location:{};return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:u,pathname:null!=(e=null==(n=this.t.location)?void 0:n.pathname)?e:s,search:null!=(i=null==(o=this.t.location)?void 0:o.search)?i:f}}get params(){return this.p(this.t.routes[this.current()])}has(t){return Object.keys(this.t.routes).includes(t)}l(r={},e=this.i){r=["string","number"].includes(typeof r)?[r]:r;const n=e.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(r)?r=r.reduce((r,e,i)=>t({},r,n[i]?{[n[i].name]:e}:{[e]:""}),{}):1!==n.length||r[n[0].name]||!r.hasOwnProperty(Object.values(e.bindings)[0])&&!r.hasOwnProperty("id")||(r={[n[0].name]:r}),t({},this.v(e),this.g(r,e))}v(r){return r.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((r,{name:e},n)=>t({},r,{[e]:this.t.defaults[e]}),{})}g(r,{bindings:e,parameterSegments:n}){return Object.entries(r).reduce((r,[i,o])=>{if(!o||"object"!=typeof o||Array.isArray(o)||!n.some(({name:t})=>t===i))return t({},r,{[i]:o});if(!o.hasOwnProperty(e[i])){if(!o.hasOwnProperty("id"))throw new Error(`Ziggy error: object passed as '${i}' parameter is missing route model binding key '${e[i]}'.`);e[i]="id"}return t({},r,{[i]:o[e[i]]})},{})}p(r){var e;let n=this.h().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"");const i=(r,e="",n)=>{const[i,o]=[r,e].map(t=>t.split(n));return o.reduce((r,e,n)=>/{[^}?]+\??}/.test(e)&&i[n]?t({},r,{[e.replace(/.*{|\??}.*/g,"")]:i[n].replace(e.match(/^[^{]*/g),"").replace(e.match(/[^}]*$/g),"")}):r,{})};return t({},i(this.h().host,r.domain,"."),i(n,r.uri,"/"),function(t,r){var e=O;if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},i=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),o=-1,u=r.charset;if(r.charsetSentinel)for(e=0;e-1&&(a=j(a)?[a]:a),n[s]=m.call(n,s)?f.combine(n[s],a):a}return n}(t,e):t,i=e.plainObjects?Object.create(null):{},o=Object.keys(n),u=0;u1&&"boolean"!=typeof r)throw new g('"allowMissing" argument must be a boolean');var e=T(t),n=e.length>0?e[0]:"",o=B("%"+n+"%",r),i=o.name,u=o.value,f=!1,a=o.alias;a&&(n=a[0],M(e,k([0,1],a)));for(var c=1,y=!0;c=e.length){var b=j(u,p);u=(y=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[p]}else y=d(u,p),u=u[p];y&&!f&&(R[i]=u)}}return u},D=function(t){var r={exports:{}};return function(t){var r=C("%Function.prototype.apply%"),e=C("%Function.prototype.call%"),n=C("%Reflect.apply%",!0)||b.call(e,r),o=C("%Object.getOwnPropertyDescriptor%",!0),i=C("%Object.defineProperty%",!0),u=C("%Math.max%");if(i)try{i({},"a",{value:1})}catch(t){i=null}t.exports=function(t){var r=n(b,e,arguments);return o&&i&&o(r,"length").configurable&&i(r,"length",{value:1+u(0,t.length-(arguments.length-1))}),r};var f=function(){return n(b,r,arguments)};i?i(t.exports,"apply",{value:f}):t.exports.apply=f}(r),r.exports}(),$=D(C("String.prototype.indexOf")),G=function(t,r){var e=C(t,!!r);return"function"==typeof e&&$(t,".prototype.")>-1?D(e):e},_="function"==typeof Map&&Map.prototype,q=Object.getOwnPropertyDescriptor&&_?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,V=_&&q&&"function"==typeof q.get?q.get:null,z=_&&Map.prototype.forEach,J="function"==typeof Set&&Set.prototype,L=Object.getOwnPropertyDescriptor&&J?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,H=J&&L&&"function"==typeof L.get?L.get:null,Z=J&&Set.prototype.forEach,Q="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,K="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,X="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,Y=Boolean.prototype.valueOf,tt=Object.prototype.toString,rt=Function.prototype.toString,et=String.prototype.match,nt="function"==typeof BigInt?BigInt.prototype.valueOf:null,ot=Object.getOwnPropertySymbols,it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,ut="function"==typeof Symbol&&"object"==typeof Symbol.iterator,ft=Object.prototype.propertyIsEnumerable,at=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),ct={__proto__:null,default:{}}.custom,yt=ct&&vt(ct)?ct:null,pt="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null,lt=function t(r,e,n,o){var i=e||{};if(gt(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(gt(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&Infinity!==i.maxStringLength:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!gt(i,"customInspect")||i.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(gt(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return St(r,i);if("number"==typeof r)return 0===r?Infinity/r>0?"0":"-0":String(r);if("bigint"==typeof r)return String(r)+"n";var f=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=f&&f>0&&"object"==typeof r)return dt(r)?"[Array]":"[Object]";var a,c=function(t,r){var e;if("\t"===t.indent)e="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;e=Array(t.indent+1).join(" ")}return{base:e,prev:Array(r+1).join(e)}}(i,n);if(void 0===o)o=[];else if(jt(o,r)>=0)return"[Circular]";function y(r,e,u){if(e&&(o=o.slice()).push(e),u){var f={depth:i.depth};return gt(i,"quoteStyle")&&(f.quoteStyle=i.quoteStyle),t(r,f,n+1,o)}return t(r,i,n+1,o)}if("function"==typeof r){var p=function(t){if(t.name)return t.name;var r=et.call(rt.call(t),/^function\s*([\w$]+)/);return r?r[1]:null}(r),l=Rt(r,y);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(l.length>0?" { "+l.join(", ")+" }":"")}if(vt(r)){var s=ut?String(r).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):it.call(r);return"object"!=typeof r||ut?s:Ot(s)}if((a=r)&&"object"==typeof a&&("undefined"!=typeof HTMLElement&&a instanceof HTMLElement||"string"==typeof a.nodeName&&"function"==typeof a.getAttribute)){for(var b="<"+String(r.nodeName).toLowerCase(),d=r.attributes||[],v=0;v"}if(dt(r)){if(0===r.length)return"[]";var h=Rt(r,y);return c&&!function(t){for(var r=0;r=0)return!1;return!0}(h)?"["+Et(h,c)+"]":"[ "+h.join(", ")+" ]"}if(function(t){return!("[object Error]"!==mt(t)||pt&&"object"==typeof t&&pt in t)}(r)){var g=Rt(r,y);return 0===g.length?"["+String(r)+"]":"{ ["+String(r)+"] "+g.join(", ")+" }"}if("object"==typeof r&&u){if(yt&&"function"==typeof r[yt])return r[yt]();if("symbol"!==u&&"function"==typeof r.inspect)return r.inspect()}if(function(t){if(!V||!t||"object"!=typeof t)return!1;try{V.call(t);try{H.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(r)){var m=[];return z.call(r,function(t,e){m.push(y(e,r,!0)+" => "+y(t,r))}),Pt("Map",V.call(r),m,c)}if(function(t){if(!H||!t||"object"!=typeof t)return!1;try{H.call(t);try{V.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(r)){var j=[];return Z.call(r,function(t){j.push(y(t,r))}),Pt("Set",H.call(r),j,c)}if(function(t){if(!Q||!t||"object"!=typeof t)return!1;try{Q.call(t,Q);try{K.call(t,K)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(r))return wt("WeakMap");if(function(t){if(!K||!t||"object"!=typeof t)return!1;try{K.call(t,K);try{Q.call(t,Q)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(r))return wt("WeakSet");if(function(t){if(!X||!t||"object"!=typeof t)return!1;try{return X.call(t),!0}catch(t){}return!1}(r))return wt("WeakRef");if(function(t){return!("[object Number]"!==mt(t)||pt&&"object"==typeof t&&pt in t)}(r))return Ot(y(Number(r)));if(function(t){if(!t||"object"!=typeof t||!nt)return!1;try{return nt.call(t),!0}catch(t){}return!1}(r))return Ot(y(nt.call(r)));if(function(t){return!("[object Boolean]"!==mt(t)||pt&&"object"==typeof t&&pt in t)}(r))return Ot(Y.call(r));if(function(t){return!("[object String]"!==mt(t)||pt&&"object"==typeof t&&pt in t)}(r))return Ot(y(String(r)));if(!function(t){return!("[object Date]"!==mt(t)||pt&&"object"==typeof t&&pt in t)}(r)&&!function(t){return!("[object RegExp]"!==mt(t)||pt&&"object"==typeof t&&pt in t)}(r)){var S=Rt(r,y),A=at?at(r)===Object.prototype:r instanceof Object||r.constructor===Object,O=r instanceof Object?"":"null prototype",w=!A&&pt&&Object(r)===r&&pt in r?mt(r).slice(8,-1):O?"Object":"",P=(A||"function"!=typeof r.constructor?"":r.constructor.name?r.constructor.name+" ":"")+(w||O?"["+[].concat(w||[],O||[]).join(": ")+"] ":"");return 0===S.length?P+"{}":c?P+"{"+Et(S,c)+"}":P+"{ "+S.join(", ")+" }"}return String(r)};function st(t,r,e){var n="double"===(e.quoteStyle||r)?'"':"'";return n+t+n}function bt(t){return String(t).replace(/"/g,""")}function dt(t){return!("[object Array]"!==mt(t)||pt&&"object"==typeof t&&pt in t)}function vt(t){if(ut)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!it)return!1;try{return it.call(t),!0}catch(t){}return!1}var ht=Object.prototype.hasOwnProperty||function(t){return t in this};function gt(t,r){return ht.call(t,r)}function mt(t){return tt.call(t)}function jt(t,r){if(t.indexOf)return t.indexOf(r);for(var e=0,n=t.length;er.maxStringLength){var e=t.length-r.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return St(t.slice(0,r.maxStringLength),r)+n}return st(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,At),"single",r)}function At(t){var r=t.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return e?"\\"+e:"\\x"+(r<16?"0":"")+r.toString(16).toUpperCase()}function Ot(t){return"Object("+t+")"}function wt(t){return t+" { ? }"}function Pt(t,r,e,n){return t+" ("+r+") {"+(n?Et(e,n):e.join(", "))+"}"}function Et(t,r){if(0===t.length)return"";var e="\n"+r.prev+r.base;return e+t.join(","+e)+"\n"+r.prev}function Rt(t,r){var e=dt(t),n=[];if(e){n.length=t.length;for(var o=0;o1;){var r=t.pop(),e=r.obj[r.prop];if(Vt(e)){for(var n=[],o=0;o=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||o===_t.RFC1738&&(40===a||41===a)?u+=i.charAt(f):a<128?u+=zt[a]:a<2048?u+=zt[192|a>>6]+zt[128|63&a]:a<55296||a>=57344?u+=zt[224|a>>12]+zt[128|a>>6&63]+zt[128|63&a]:(a=65536+((1023&a)<<10|1023&i.charCodeAt(f+=1)),u+=zt[240|a>>18]+zt[128|a>>12&63]+zt[128|a>>6&63]+zt[128|63&a])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if(Vt(t)){for(var e=[],n=0;n0?h.join(",")||null:void 0}];else if(Qt(f))g=f;else{var j=Object.keys(h);g=a?j.sort(a):j}for(var S=0;S-1?t.split(","):t},ar=function(t,r,e,n){if(t){var o=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,u=e.depth>0&&/(\[[^[\]]*])/.exec(o),f=u?o.slice(0,u.index):o,a=[];if(f){if(!e.plainObjects&&nr.call(Object.prototype,f)&&!e.allowPrototypes)return;a.push(f)}for(var c=0;e.depth>0&&null!==(u=i.exec(o))&&c=0;--i){var u,f=t[i];if("[]"===f&&e.parseArrays)u=[].concat(o);else{u=e.plainObjects?Object.create(null):{};var a="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,c=parseInt(a,10);e.parseArrays||""!==a?!isNaN(c)&&f!==a&&String(c)===a&&c>=0&&e.parseArrays&&c<=e.arrayLimit?(u=[])[c]=o:u[a]=o:u={0:o}}o=u}return o}(a,r,e,n)}},cr=function(){function t(t,r,e){var n;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.config=e}var e=t.prototype;return e.matchesUrl=function(t){if(!this.definition.methods.includes("GET"))return!1;var r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+r+"$").test(t.replace(/\/+$/,"").split("?").shift())},e.compile=function(t){var r=this;return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,function(e,n){var o;if([null,void 0].includes(t[n])&&r.parameterSegments.find(function(t){return t.name===n}).required)throw new Error("Ziggy error: '"+n+"' parameter is required for route '"+r.name+"'.");return encodeURIComponent(null!=(o=t[n])?o:"")}).replace(/\/+$/,""):this.template},r(t,[{key:"template",get:function(){return((this.config.absolute?this.definition.domain?""+this.config.url.match(/^\w+:\/\//)[0]+this.definition.domain+(this.config.port?":"+this.config.port:""):this.config.url:"")+"/"+this.definition.uri).replace(/\/+$/,"")}},{key:"parameterSegments",get:function(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(function(t){return{name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)}}))?t:[]}}]),t}(),yr=function(t){var n,i;function u(r,n,o,i){var u;if(void 0===o&&(o=!0),(u=t.call(this)||this).t=null!=i?i:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,u.t=e({},u.t,{absolute:o}),r){if(!u.t.routes[r])throw new Error("Ziggy error: route '"+r+"' is not in the route list.");u.i=new cr(r,u.t.routes[r],u.t),u.u=u.p(n)}return u}i=t,(n=u).prototype=Object.create(i.prototype),n.prototype.constructor=n,o(n,i);var f=u.prototype;return f.toString=function(){var t=this,r=Object.keys(this.u).filter(function(r){return!t.i.parameterSegments.some(function(t){return t.name===r})}).filter(function(t){return"_query"!==t}).reduce(function(r,n){var o;return e({},r,((o={})[n]=t.u[n],o))},{});return this.i.compile(this.u)+function(t,r){var e,n=t,o=function(t){if(!t)return rr;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||rr.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=_t.default;if(void 0!==t.format){if(!Ht.call(_t.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var n=_t.formatters[e],o=rr.filter;return("function"==typeof t.filter||Qt(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:rr.addQueryPrefix,allowDots:void 0===t.allowDots?rr.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:rr.charsetSentinel,delimiter:void 0===t.delimiter?rr.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:rr.encode,encoder:"function"==typeof t.encoder?t.encoder:rr.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:rr.encodeValuesOnly,filter:o,format:e,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:rr.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:rr.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:rr.strictNullHandling}}(r);"function"==typeof o.filter?n=(0,o.filter)("",n):Qt(o.filter)&&(e=o.filter);var i=[];if("object"!=typeof n||null===n)return"";var u=Zt[r&&r.arrayFormat in Zt?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(n)),o.sort&&e.sort(o.sort);for(var f=Ct(),a=0;a0?p+y:""}(e({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:function(t,r){return"boolean"==typeof t?Number(t):r(t)}})},f.current=function(t,r){var e=this,n=this.t.absolute?this.l().host+this.l().pathname:this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),o=Object.entries(this.t.routes).find(function(r){return new cr(t,r[1],e.t).matchesUrl(n)})||[void 0,void 0],i=o[0],u=o[1];if(!t)return i;var f=new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(i);if([null,void 0].includes(r)||!f)return f;var a=new cr(i,u,this.t);r=this.p(r,a);var c=this.v(u);return!(!Object.values(r).every(function(t){return!t})||Object.values(c).length)||Object.entries(r).every(function(t){return c[t[0]]==t[1]})},f.l=function(){var t,r,e,n,o,i,u="undefined"!=typeof window?window.location:{},f=u.host,a=u.pathname,c=u.search;return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:void 0===f?"":f,pathname:null!=(e=null==(n=this.t.location)?void 0:n.pathname)?e:void 0===a?"":a,search:null!=(o=null==(i=this.t.location)?void 0:i.search)?o:void 0===c?"":c}},f.has=function(t){return Object.keys(this.t.routes).includes(t)},f.p=function(t,r){var n=this;void 0===t&&(t={}),void 0===r&&(r=this.i),t=["string","number"].includes(typeof t)?[t]:t;var o=r.parameterSegments.filter(function(t){return!n.t.defaults[t.name]});if(Array.isArray(t))t=t.reduce(function(t,r,n){var i,u;return e({},t,o[n]?((i={})[o[n].name]=r,i):((u={})[r]="",u))},{});else if(1===o.length&&!t[o[0].name]&&(t.hasOwnProperty(Object.values(r.bindings)[0])||t.hasOwnProperty("id"))){var i;(i={})[o[0].name]=t,t=i}return e({},this.h(r),this.g(t,r))},f.h=function(t){var r=this;return t.parameterSegments.filter(function(t){return r.t.defaults[t.name]}).reduce(function(t,n,o){var i,u=n.name;return e({},t,((i={})[u]=r.t.defaults[u],i))},{})},f.g=function(t,r){var n=r.bindings,o=r.parameterSegments;return Object.entries(t).reduce(function(t,r){var i,u,f=r[0],a=r[1];if(!a||"object"!=typeof a||Array.isArray(a)||!o.some(function(t){return t.name===f}))return e({},t,((u={})[f]=a,u));if(!a.hasOwnProperty(n[f])){if(!a.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+f+"' parameter is missing route model binding key '"+n[f]+"'.");n[f]="id"}return e({},t,((i={})[f]=a[n[f]],i))},{})},f.v=function(t){var r,n=this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,""),o=function(t,r,n){void 0===r&&(r="");var o=[t,r].map(function(t){return t.split(n)}),i=o[0];return o[1].reduce(function(t,r,n){var o;return/{[^}?]+\??}/.test(r)&&i[n]?e({},t,((o={})[r.replace(/.*{|\??}.*/g,"")]=i[n].replace(r.match(/^[^{]*/g),"").replace(r.match(/[^}]*$/g),""),o)):t},{})};return e({},o(this.l().host,t.domain,"."),o(n,t.uri,"/"),function(t,r){var e=ir;if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},o=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),i=-1,u=r.charset;if(r.charsetSentinel)for(e=0;e-1&&(a=or(a)?[a]:a),n[f]=nr.call(n,f)?Lt.combine(n[f],a):a}return n}(t,e):t,o=e.plainObjects?Object.create(null):{},i=Object.keys(n),u=0;u1;){var n=t.pop(),r=n.obj[n.prop];if(d(r)){for(var e=[],i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===s.RFC1738&&(40===c||41===c)?u+=o.charAt(f):c<128?u+=p[c]:c<2048?u+=p[192|c>>6]+p[128|63&c]:c<55296||c>=57344?u+=p[224|c>>12]+p[128|c>>6&63]+p[128|63&c]:(c=65536+((1023&c)<<10|1023&o.charCodeAt(f+=1)),u+=p[240|c>>18]+p[128|c>>12&63]+p[128|c>>6&63]+p[128|63&c])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,n){if(d(t)){for(var r=[],e=0;e0?b.join(",")||null:void 0}];else if(m(f))k=f;else{var T=Object.keys(b);k=c?T.sort(c):T}for(var C=0;C-1?t.split(","):t},D=function(t,n,r,e){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,u=r.depth>0&&/(\[[^[\]]*])/.exec(i),f=u?i.slice(0,u.index):i,c=[];if(f){if(!r.plainObjects&&x.call(Object.prototype,f)&&!r.allowPrototypes)return;c.push(f)}for(var a=0;r.depth>0&&null!==(u=o.exec(i))&&a=0;--o){var u,f=t[o];if("[]"===f&&r.parseArrays)u=[].concat(i);else{u=r.plainObjects?Object.create(null):{};var c="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,a=parseInt(c,10);r.parseArrays||""!==c?!isNaN(a)&&f!==c&&String(a)===c&&a>=0&&r.parseArrays&&a<=r.arrayLimit?(u=[])[a]=i:"__proto__"!==c&&(u[c]=i):u={0:i}}i=u}return i}(c,n,r,e)}},$=/*#__PURE__*/function(){function t(t,n,r){var e,i;this.name=t,this.definition=n,this.bindings=null!=(e=n.bindings)?e:{},this.wheres=null!=(i=n.wheres)?i:{},this.config=r}var r=t.prototype;return r.matchesUrl=function(t){if(!this.definition.methods.includes("GET"))return!1;var n=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+n+"$").test(t.replace(/\/+$/,"").split("?").shift())},r.compile=function(t){var n=this;return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,function(r,e){var i,o;if([null,void 0].includes(t[e])&&n.parameterSegments.find(function(t){return t.name===e}).required)throw new Error("Ziggy error: '"+e+"' parameter is required for route '"+n.name+"'.");return n.parameterSegments[n.parameterSegments.length-1].name===e&&".*"===n.wheres[e]?null!=(o=t[e])?o:"":encodeURIComponent(null!=(i=t[e])?i:"")}).replace(/\/+$/,""):this.template},n(t,[{key:"template",get:function(){return((this.config.absolute?this.definition.domain?""+this.config.url.match(/^\w+:\/\//)[0]+this.definition.domain+(this.config.port?":"+this.config.port:""):this.config.url:"")+"/"+this.definition.uri).replace(/\/+$/,"")}},{key:"parameterSegments",get:function(){var t,n;return null!=(t=null==(n=this.template.match(/{[^}?]+\??}/g))?void 0:n.map(function(t){return{name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)}}))?t:[]}}]),t}(),A=/*#__PURE__*/function(t){var e,o;function u(n,e,i,o){var u;if(void 0===i&&(i=!0),(u=t.call(this)||this).t=null!=o?o:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,u.t=r({},u.t,{absolute:i}),n){if(!u.t.routes[n])throw new Error("Ziggy error: route '"+n+"' is not in the route list.");u.i=new $(n,u.t.routes[n],u.t),u.u=u.l(e)}return u}o=t,(e=u).prototype=Object.create(o.prototype),e.prototype.constructor=e,i(e,o);var f=u.prototype;return f.toString=function(){var t=this,n=Object.keys(this.u).filter(function(n){return!t.i.parameterSegments.some(function(t){return t.name===n})}).filter(function(t){return"_query"!==t}).reduce(function(n,e){var i;return r({},n,((i={})[e]=t.u[e],i))},{});return this.i.compile(this.u)+function(t,n){var r,e=t,i=function(t){if(!t)return S;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var n=t.charset||S.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=s.default;if(void 0!==t.format){if(!b.call(s.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var e=s.formatters[r],i=S.filter;return("function"==typeof t.filter||m(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:S.addQueryPrefix,allowDots:void 0===t.allowDots?S.allowDots:!!t.allowDots,charset:n,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:S.charsetSentinel,delimiter:void 0===t.delimiter?S.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:S.encode,encoder:"function"==typeof t.encoder?t.encoder:S.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:S.encodeValuesOnly,filter:i,format:r,formatter:e,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:S.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:S.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:S.strictNullHandling}}(n);"function"==typeof i.filter?e=(0,i.filter)("",e):m(i.filter)&&(r=i.filter);var o=[];if("object"!=typeof e||null===e)return"";var u=g[n&&n.arrayFormat in g?n.arrayFormat:n&&"indices"in n?n.indices?"indices":"repeat":"indices"];r||(r=Object.keys(e)),i.sort&&r.sort(i.sort);for(var f=0;f0?l+a:""}(r({},n,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:function(t,n){return"boolean"==typeof t?Number(t):n(t)}})},f.current=function(t,n){var r=this,e=this.t.absolute?this.v().host+this.v().pathname:this.v().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),i=Object.entries(this.t.routes).find(function(n){return new $(t,n[1],r.t).matchesUrl(e)})||[void 0,void 0],o=i[0],u=i[1];if(!t)return o;var f=new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(o);if([null,void 0].includes(n)||!f)return f;var c=new $(o,u,this.t);n=this.l(n,c);var a=this.p(u);return!(!Object.values(n).every(function(t){return!t})||Object.values(a).length)||Object.entries(n).every(function(t){return a[t[0]]==t[1]})},f.v=function(){var t,n,r,e,i,o,u="undefined"!=typeof window?window.location:{},f=u.host,c=u.pathname,a=u.search;return{host:null!=(t=null==(n=this.t.location)?void 0:n.host)?t:void 0===f?"":f,pathname:null!=(r=null==(e=this.t.location)?void 0:e.pathname)?r:void 0===c?"":c,search:null!=(i=null==(o=this.t.location)?void 0:o.search)?i:void 0===a?"":a}},f.has=function(t){return Object.keys(this.t.routes).includes(t)},f.l=function(t,n){var e=this;void 0===t&&(t={}),void 0===n&&(n=this.i),t=["string","number"].includes(typeof t)?[t]:t;var i=n.parameterSegments.filter(function(t){return!e.t.defaults[t.name]});if(Array.isArray(t))t=t.reduce(function(t,n,e){var o,u;return r({},t,i[e]?((o={})[i[e].name]=n,o):((u={})[n]="",u))},{});else if(1===i.length&&!t[i[0].name]&&(t.hasOwnProperty(Object.values(n.bindings)[0])||t.hasOwnProperty("id"))){var o;(o={})[i[0].name]=t,t=o}return r({},this.h(n),this.g(t,n))},f.h=function(t){var n=this;return t.parameterSegments.filter(function(t){return n.t.defaults[t.name]}).reduce(function(t,e,i){var o,u=e.name;return r({},t,((o={})[u]=n.t.defaults[u],o))},{})},f.g=function(t,n){var e=n.bindings,i=n.parameterSegments;return Object.entries(t).reduce(function(t,n){var o,u,f=n[0],c=n[1];if(!c||"object"!=typeof c||Array.isArray(c)||!i.some(function(t){return t.name===f}))return r({},t,((u={})[f]=c,u));if(!c.hasOwnProperty(e[f])){if(!c.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+f+"' parameter is missing route model binding key '"+e[f]+"'.");e[f]="id"}return r({},t,((o={})[f]=c[e[f]],o))},{})},f.p=function(t){var n,e=this.v().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,""),i=function(t,n,e){void 0===n&&(n="");var i=[t,n].map(function(t){return t.split(e)}),o=i[0];return i[1].reduce(function(t,n,e){var i;return/{[^}?]+\??}/.test(n)&&o[e]?r({},t,((i={})[n.replace(/.*{|\??}.*/g,"")]=o[e].replace(n.match(/^[^{]*/g),"").replace(n.match(/[^}]*$/g),""),i)):t},{})};return r({},i(this.v().host,t.domain,"."),i(e,t.uri,"/"),function(t,n){var r=C;if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var e="string"==typeof t?function(t,n){var r,e={},i=(n.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(n.delimiter,Infinity===n.parameterLimit?void 0:n.parameterLimit),o=-1,u=n.charset;if(n.charsetSentinel)for(r=0;r-1&&(c=T(c)?[c]:c),e[f]=x.call(e,f)?h.combine(e[f],c):c}return e}(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(e),u=0;u1&&"boolean"!=typeof r)throw new b('"allowMissing" argument must be a boolean');var e=N(t),n=e.length>0?e[0]:"",o=B("%"+n+"%",r),i=o.name,u=o.value,f=!1,a=o.alias;a&&(n=a[0],k(e,I([0,1],a)));for(var c=1,y=!0;c=e.length){var h=g(u,p);u=(y=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:u[p]}else y=s(u,p),u=u[p];y&&!f&&(E[i]=u)}}return u},C=(function(t){var r=T("%Function.prototype.apply%"),e=T("%Function.prototype.call%"),n=T("%Reflect.apply%",!0)||l.call(e,r),o=T("%Object.getOwnPropertyDescriptor%",!0),i=T("%Object.defineProperty%",!0),u=T("%Math.max%");if(i)try{i({},"a",{value:1})}catch(t){i=null}t.exports=function(t){var r=n(l,e,arguments);if(o&&i){var f=o(r,"length");f.configurable&&i(r,"length",{value:1+u(0,t.length-(arguments.length-1))})}return r};var f=function(){return n(l,r,arguments)};i?i(t.exports,"apply",{value:f}):t.exports.apply=f}(m={exports:{}}),m.exports),D=C(T("String.prototype.indexOf")),$=function(t,r){var e=T(t,!!r);return"function"==typeof e&&D(t,".prototype.")>-1?C(e):e},G="function"==typeof Map&&Map.prototype,_=Object.getOwnPropertyDescriptor&&G?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,q=G&&_&&"function"==typeof _.get?_.get:null,V=G&&Map.prototype.forEach,z="function"==typeof Set&&Set.prototype,J=Object.getOwnPropertyDescriptor&&z?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,L=z&&J&&"function"==typeof J.get?J.get:null,H=z&&Set.prototype.forEach,Z="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,Q="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,K="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,X=Boolean.prototype.valueOf,Y=Object.prototype.toString,tt=Function.prototype.toString,rt=String.prototype.match,et="function"==typeof BigInt?BigInt.prototype.valueOf:null,nt=Object.getOwnPropertySymbols,ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,it="function"==typeof Symbol&&"object"==typeof Symbol.iterator,ut=Object.prototype.propertyIsEnumerable,ft=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),at={__proto__:null,default:{}}.custom,ct=at&&vt(at)?at:null,yt="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null,pt=function t(r,e,n,o){var i=e||{};if(ht(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ht(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&Infinity!==i.maxStringLength:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!ht(i,"customInspect")||i.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ht(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return jt(r,i);if("number"==typeof r)return 0===r?Infinity/r>0?"0":"-0":String(r);if("bigint"==typeof r)return String(r)+"n";var f=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=f&&f>0&&"object"==typeof r)return dt(r)?"[Array]":"[Object]";var a,c=function(t,r){var e;if("\t"===t.indent)e="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;e=Array(t.indent+1).join(" ")}return{base:e,prev:Array(r+1).join(e)}}(i,n);if(void 0===o)o=[];else if(mt(o,r)>=0)return"[Circular]";function y(r,e,u){if(e&&(o=o.slice()).push(e),u){var f={depth:i.depth};return ht(i,"quoteStyle")&&(f.quoteStyle=i.quoteStyle),t(r,f,n+1,o)}return t(r,i,n+1,o)}if("function"==typeof r){var p=function(t){if(t.name)return t.name;var r=rt.call(tt.call(t),/^function\s*([\w$]+)/);return r?r[1]:null}(r),l=Et(r,y);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(l.length>0?" { "+l.join(", ")+" }":"")}if(vt(r)){var s=it?String(r).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):ot.call(r);return"object"!=typeof r||it?s:At(s)}if((a=r)&&"object"==typeof a&&("undefined"!=typeof HTMLElement&&a instanceof HTMLElement||"string"==typeof a.nodeName&&"function"==typeof a.getAttribute)){for(var d="<"+String(r.nodeName).toLowerCase(),v=r.attributes||[],b=0;b"}if(dt(r)){if(0===r.length)return"[]";var h=Et(r,y);return c&&!function(t){for(var r=0;r=0)return!1;return!0}(h)?"["+Pt(h,c)+"]":"[ "+h.join(", ")+" ]"}if(function(t){return!("[object Error]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r)){var g=Et(r,y);return 0===g.length?"["+String(r)+"]":"{ ["+String(r)+"] "+g.join(", ")+" }"}if("object"==typeof r&&u){if(ct&&"function"==typeof r[ct])return r[ct]();if("symbol"!==u&&"function"==typeof r.inspect)return r.inspect()}if(function(t){if(!q||!t||"object"!=typeof t)return!1;try{q.call(t);try{L.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(r)){var m=[];return V.call(r,function(t,e){m.push(y(e,r,!0)+" => "+y(t,r))}),wt("Map",q.call(r),m,c)}if(function(t){if(!L||!t||"object"!=typeof t)return!1;try{L.call(t);try{q.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(r)){var j=[];return H.call(r,function(t){j.push(y(t,r))}),wt("Set",L.call(r),j,c)}if(function(t){if(!Z||!t||"object"!=typeof t)return!1;try{Z.call(t,Z);try{Q.call(t,Q)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(r))return Ot("WeakMap");if(function(t){if(!Q||!t||"object"!=typeof t)return!1;try{Q.call(t,Q);try{Z.call(t,Z)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(r))return Ot("WeakSet");if(function(t){if(!K||!t||"object"!=typeof t)return!1;try{return K.call(t),!0}catch(t){}return!1}(r))return Ot("WeakRef");if(function(t){return!("[object Number]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r))return At(y(Number(r)));if(function(t){if(!t||"object"!=typeof t||!et)return!1;try{return et.call(t),!0}catch(t){}return!1}(r))return At(y(et.call(r)));if(function(t){return!("[object Boolean]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r))return At(X.call(r));if(function(t){return!("[object String]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r))return At(y(String(r)));if(!function(t){return!("[object Date]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r)&&!function(t){return!("[object RegExp]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r)){var S=Et(r,y),A=ft?ft(r)===Object.prototype:r instanceof Object||r.constructor===Object,O=r instanceof Object?"":"null prototype",w=!A&&yt&&Object(r)===r&&yt in r?gt(r).slice(8,-1):O?"Object":"",P=(A||"function"!=typeof r.constructor?"":r.constructor.name?r.constructor.name+" ":"")+(w||O?"["+[].concat(w||[],O||[]).join(": ")+"] ":"");return 0===S.length?P+"{}":c?P+"{"+Pt(S,c)+"}":P+"{ "+S.join(", ")+" }"}return String(r)};function lt(t,r,e){var n="double"===(e.quoteStyle||r)?'"':"'";return n+t+n}function st(t){return String(t).replace(/"/g,""")}function dt(t){return!("[object Array]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}function vt(t){if(it)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!ot)return!1;try{return ot.call(t),!0}catch(t){}return!1}var bt=Object.prototype.hasOwnProperty||function(t){return t in this};function ht(t,r){return bt.call(t,r)}function gt(t){return Y.call(t)}function mt(t,r){if(t.indexOf)return t.indexOf(r);for(var e=0,n=t.length;er.maxStringLength){var e=t.length-r.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return jt(t.slice(0,r.maxStringLength),r)+n}return lt(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,St),"single",r)}function St(t){var r=t.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return e?"\\"+e:"\\x"+(r<16?"0":"")+r.toString(16).toUpperCase()}function At(t){return"Object("+t+")"}function Ot(t){return t+" { ? }"}function wt(t,r,e,n){return t+" ("+r+") {"+(n?Pt(e,n):e.join(", "))+"}"}function Pt(t,r){if(0===t.length)return"";var e="\n"+r.prev+r.base;return e+t.join(","+e)+"\n"+r.prev}function Et(t,r){var e=dt(t),n=[];if(e){n.length=t.length;for(var o=0;o1;){var r=t.pop(),e=r.obj[r.prop];if(_t(e)){for(var n=[],o=0;o=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||o===$t.RFC1738&&(40===a||41===a)?u+=i.charAt(f):a<128?u+=qt[a]:a<2048?u+=qt[192|a>>6]+qt[128|63&a]:a<55296||a>=57344?u+=qt[224|a>>12]+qt[128|a>>6&63]+qt[128|63&a]:(a=65536+((1023&a)<<10|1023&i.charCodeAt(f+=1)),u+=qt[240|a>>18]+qt[128|a>>12&63]+qt[128|a>>6&63]+qt[128|63&a])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if(_t(t)){for(var e=[],n=0;n0?h.join(",")||null:void 0}];else if(Ht(f))g=f;else{var j=Object.keys(h);g=a?j.sort(a):j}for(var S=0;S-1?t.split(","):t},ur=function(t,r,e,n){if(t){var o=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,u=e.depth>0&&/(\[[^[\]]*])/.exec(o),f=u?o.slice(0,u.index):o,a=[];if(f){if(!e.plainObjects&&rr.call(Object.prototype,f)&&!e.allowPrototypes)return;a.push(f)}for(var c=0;e.depth>0&&null!==(u=i.exec(o))&&c=0;--i){var u,f=t[i];if("[]"===f&&e.parseArrays)u=[].concat(o);else{u=e.plainObjects?Object.create(null):{};var a="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,c=parseInt(a,10);e.parseArrays||""!==a?!isNaN(c)&&f!==a&&String(c)===a&&c>=0&&e.parseArrays&&c<=e.arrayLimit?(u=[])[c]=o:u[a]=o:u={0:o}}o=u}return o}(a,r,e,n)}},fr=function(){function t(t,r,e){var n;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.config=e}var e=t.prototype;return e.matchesUrl=function(t){if(!this.definition.methods.includes("GET"))return!1;var r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+r+"$").test(t.replace(/\/+$/,"").split("?").shift())},e.compile=function(t){var r=this;return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,function(e,n){var o;if([null,void 0].includes(t[n])&&r.parameterSegments.find(function(t){return t.name===n}).required)throw new Error("Ziggy error: '"+n+"' parameter is required for route '"+r.name+"'.");return encodeURIComponent(null!=(o=t[n])?o:"")}).replace(/\/+$/,""):this.template},r(t,[{key:"template",get:function(){return((this.config.absolute?this.definition.domain?""+this.config.url.match(/^\w+:\/\//)[0]+this.definition.domain+(this.config.port?":"+this.config.port:""):this.config.url:"")+"/"+this.definition.uri).replace(/\/+$/,"")}},{key:"parameterSegments",get:function(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(function(t){return{name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)}}))?t:[]}}]),t}(),ar=function(t){var n,i;function u(r,n,o,i){var u;if(void 0===o&&(o=!0),(u=t.call(this)||this).t=null!=i?i:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,u.t=e({},u.t,{absolute:o}),r){if(!u.t.routes[r])throw new Error("Ziggy error: route '"+r+"' is not in the route list.");u.i=new fr(r,u.t.routes[r],u.t),u.u=u.p(n)}return u}i=t,(n=u).prototype=Object.create(i.prototype),n.prototype.constructor=n,o(n,i);var f=u.prototype;return f.toString=function(){var t=this,r=Object.keys(this.u).filter(function(r){return!t.i.parameterSegments.some(function(t){return t.name===r})}).filter(function(t){return"_query"!==t}).reduce(function(r,n){var o;return e({},r,((o={})[n]=t.u[n],o))},{});return this.i.compile(this.u)+function(t,r){var e,n=t,o=function(t){if(!t)return Yt;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||Yt.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=$t.default;if(void 0!==t.format){if(!Jt.call($t.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var n=$t.formatters[e],o=Yt.filter;return("function"==typeof t.filter||Ht(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:Yt.addQueryPrefix,allowDots:void 0===t.allowDots?Yt.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Yt.charsetSentinel,delimiter:void 0===t.delimiter?Yt.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:Yt.encode,encoder:"function"==typeof t.encoder?t.encoder:Yt.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:Yt.encodeValuesOnly,filter:o,format:e,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:Yt.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:Yt.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Yt.strictNullHandling}}(r);"function"==typeof o.filter?n=(0,o.filter)("",n):Ht(o.filter)&&(e=o.filter);var i=[];if("object"!=typeof n||null===n)return"";var u=Lt[r&&r.arrayFormat in Lt?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(n)),o.sort&&e.sort(o.sort);for(var f=Tt(),a=0;a0?p+y:""}(e({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:function(t,r){return"boolean"==typeof t?Number(t):r(t)}})},f.current=function(t,r){var e=this,n=this.t.absolute?this.l().host+this.l().pathname:this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),o=Object.entries(this.t.routes).find(function(r){return new fr(t,r[1],e.t).matchesUrl(n)})||[void 0,void 0],i=o[0],u=o[1];if(!t)return i;var f=new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(i);if([null,void 0].includes(r)||!f)return f;var a=new fr(i,u,this.t);r=this.p(r,a);var c=this.v(u);return!(!Object.values(r).every(function(t){return!t})||Object.values(c).length)||Object.entries(r).every(function(t){return c[t[0]]==t[1]})},f.l=function(){var t,r,e,n,o,i,u="undefined"!=typeof window?window.location:{},f=u.host,a=u.pathname,c=u.search;return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:void 0===f?"":f,pathname:null!=(e=null==(n=this.t.location)?void 0:n.pathname)?e:void 0===a?"":a,search:null!=(o=null==(i=this.t.location)?void 0:i.search)?o:void 0===c?"":c}},f.has=function(t){return Object.keys(this.t.routes).includes(t)},f.p=function(t,r){var n=this;void 0===t&&(t={}),void 0===r&&(r=this.i),t=["string","number"].includes(typeof t)?[t]:t;var o=r.parameterSegments.filter(function(t){return!n.t.defaults[t.name]});if(Array.isArray(t))t=t.reduce(function(t,r,n){var i,u;return e({},t,o[n]?((i={})[o[n].name]=r,i):((u={})[r]="",u))},{});else if(1===o.length&&!t[o[0].name]&&(t.hasOwnProperty(Object.values(r.bindings)[0])||t.hasOwnProperty("id"))){var i;(i={})[o[0].name]=t,t=i}return e({},this.h(r),this.g(t,r))},f.h=function(t){var r=this;return t.parameterSegments.filter(function(t){return r.t.defaults[t.name]}).reduce(function(t,n,o){var i,u=n.name;return e({},t,((i={})[u]=r.t.defaults[u],i))},{})},f.g=function(t,r){var n=r.bindings,o=r.parameterSegments;return Object.entries(t).reduce(function(t,r){var i,u,f=r[0],a=r[1];if(!a||"object"!=typeof a||Array.isArray(a)||!o.some(function(t){return t.name===f}))return e({},t,((u={})[f]=a,u));if(!a.hasOwnProperty(n[f])){if(!a.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+f+"' parameter is missing route model binding key '"+n[f]+"'.");n[f]="id"}return e({},t,((i={})[f]=a[n[f]],i))},{})},f.v=function(t){var r,n=this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,""),o=function(t,r,n){void 0===r&&(r="");var o=[t,r].map(function(t){return t.split(n)}),i=o[0];return o[1].reduce(function(t,r,n){var o;return/{[^}?]+\??}/.test(r)&&i[n]?e({},t,((o={})[r.replace(/.*{|\??}.*/g,"")]=i[n].replace(r.match(/^[^{]*/g),"").replace(r.match(/[^}]*$/g),""),o)):t},{})};return e({},o(this.l().host,t.domain,"."),o(n,t.uri,"/"),function(t,r){var e=nr;if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},o=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),i=-1,u=r.charset;if(r.charsetSentinel)for(e=0;e-1&&(a=er(a)?[a]:a),n[f]=rr.call(n,f)?zt.combine(n[f],a):a}return n}(t,e):t,o=e.plainObjects?Object.create(null):{},i=Object.keys(n),u=0;u1;){var r=t.pop(),n=r.obj[r.prop];if(v(n)){for(var e=[],i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===l.RFC1738&&(40===c||41===c)?u+=o.charAt(f):c<128?u+=p[c]:c<2048?u+=p[192|c>>6]+p[128|63&c]:c<55296||c>=57344?u+=p[224|c>>12]+p[128|c>>6&63]+p[128|63&c]:(c=65536+((1023&c)<<10|1023&o.charCodeAt(f+=1)),u+=p[240|c>>18]+p[128|c>>12&63]+p[128|c>>6&63]+p[128|63&c])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if(v(t)){for(var n=[],e=0;e0?b.join(",")||null:void 0}];else if(g(f))k=f;else{var C=Object.keys(b);k=c?C.sort(c):C}for(var F=0;F-1?t.split(","):t},T=function(t,r,n,e){if(t){var i=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,u=n.depth>0&&/(\[[^[\]]*])/.exec(i),f=u?i.slice(0,u.index):i,c=[];if(f){if(!n.plainObjects&&k.call(Object.prototype,f)&&!n.allowPrototypes)return;c.push(f)}for(var a=0;n.depth>0&&null!==(u=o.exec(i))&&a=0;--o){var u,f=t[o];if("[]"===f&&n.parseArrays)u=[].concat(i);else{u=n.plainObjects?Object.create(null):{};var c="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,a=parseInt(c,10);n.parseArrays||""!==c?!isNaN(a)&&f!==c&&String(a)===c&&a>=0&&n.parseArrays&&a<=n.arrayLimit?(u=[])[a]=i:"__proto__"!==c&&(u[c]=i):u={0:i}}i=u}return i}(c,r,n,e)}},D=/*#__PURE__*/function(){function t(t,r,n){var e,i;this.name=t,this.definition=r,this.bindings=null!=(e=r.bindings)?e:{},this.wheres=null!=(i=r.wheres)?i:{},this.config=n}var n=t.prototype;return n.matchesUrl=function(t){if(!this.definition.methods.includes("GET"))return!1;var r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+r+"$").test(t.replace(/\/+$/,"").split("?").shift())},n.compile=function(t){var r=this;return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,function(n,e){var i,o;if([null,void 0].includes(t[e])&&r.parameterSegments.find(function(t){return t.name===e}).required)throw new Error("Ziggy error: '"+e+"' parameter is required for route '"+r.name+"'.");return r.parameterSegments[r.parameterSegments.length-1].name===e&&".*"===r.wheres[e]?null!=(o=t[e])?o:"":encodeURIComponent(null!=(i=t[e])?i:"")}).replace(/\/+$/,""):this.template},r(t,[{key:"template",get:function(){return((this.config.absolute?this.definition.domain?""+this.config.url.match(/^\w+:\/\//)[0]+this.definition.domain+(this.config.port?":"+this.config.port:""):this.config.url:"")+"/"+this.definition.uri).replace(/\/+$/,"")}},{key:"parameterSegments",get:function(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(function(t){return{name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)}}))?t:[]}}]),t}(),$=/*#__PURE__*/function(t){var e,o;function u(r,e,i,o){var u;if(void 0===i&&(i=!0),(u=t.call(this)||this).t=null!=o?o:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,u.t=n({},u.t,{absolute:i}),r){if(!u.t.routes[r])throw new Error("Ziggy error: route '"+r+"' is not in the route list.");u.i=new D(r,u.t.routes[r],u.t),u.u=u.l(e)}return u}o=t,(e=u).prototype=Object.create(o.prototype),e.prototype.constructor=e,i(e,o);var f=u.prototype;return f.toString=function(){var t=this,r=Object.keys(this.u).filter(function(r){return!t.i.parameterSegments.some(function(t){return t.name===r})}).filter(function(t){return"_query"!==t}).reduce(function(r,e){var i;return n({},r,((i={})[e]=t.u[e],i))},{});return this.i.compile(this.u)+function(t,r){var n,e=t,i=function(t){if(!t)return E;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||E.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=l.default;if(void 0!==t.format){if(!h.call(l.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var e=l.formatters[n],i=E.filter;return("function"==typeof t.filter||g(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:E.addQueryPrefix,allowDots:void 0===t.allowDots?E.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:E.charsetSentinel,delimiter:void 0===t.delimiter?E.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:E.encode,encoder:"function"==typeof t.encoder?t.encoder:E.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:E.encodeValuesOnly,filter:i,format:n,formatter:e,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:E.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:E.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:E.strictNullHandling}}(r);"function"==typeof i.filter?e=(0,i.filter)("",e):g(i.filter)&&(n=i.filter);var o=[];if("object"!=typeof e||null===e)return"";var u=b[r&&r.arrayFormat in b?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];n||(n=Object.keys(e)),i.sort&&n.sort(i.sort);for(var f=0;f0?s+a:""}(n({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:function(t,r){return"boolean"==typeof t?Number(t):r(t)}})},f.current=function(t,r){var n=this,e=this.t.absolute?this.v().host+this.v().pathname:this.v().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),i=Object.entries(this.t.routes).find(function(r){return new D(t,r[1],n.t).matchesUrl(e)})||[void 0,void 0],o=i[0],u=i[1];if(!t)return o;var f=new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(o);if([null,void 0].includes(r)||!f)return f;var c=new D(o,u,this.t);r=this.l(r,c);var a=this.p(u);return!(!Object.values(r).every(function(t){return!t})||Object.values(a).length)||Object.entries(r).every(function(t){return a[t[0]]==t[1]})},f.v=function(){var t,r,n,e,i,o,u="undefined"!=typeof window?window.location:{},f=u.host,c=u.pathname,a=u.search;return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:void 0===f?"":f,pathname:null!=(n=null==(e=this.t.location)?void 0:e.pathname)?n:void 0===c?"":c,search:null!=(i=null==(o=this.t.location)?void 0:o.search)?i:void 0===a?"":a}},f.has=function(t){return Object.keys(this.t.routes).includes(t)},f.l=function(t,r){var e=this;void 0===t&&(t={}),void 0===r&&(r=this.i),t=["string","number"].includes(typeof t)?[t]:t;var i=r.parameterSegments.filter(function(t){return!e.t.defaults[t.name]});if(Array.isArray(t))t=t.reduce(function(t,r,e){var o,u;return n({},t,i[e]?((o={})[i[e].name]=r,o):((u={})[r]="",u))},{});else if(1===i.length&&!t[i[0].name]&&(t.hasOwnProperty(Object.values(r.bindings)[0])||t.hasOwnProperty("id"))){var o;(o={})[i[0].name]=t,t=o}return n({},this.h(r),this.g(t,r))},f.h=function(t){var r=this;return t.parameterSegments.filter(function(t){return r.t.defaults[t.name]}).reduce(function(t,e,i){var o,u=e.name;return n({},t,((o={})[u]=r.t.defaults[u],o))},{})},f.g=function(t,r){var e=r.bindings,i=r.parameterSegments;return Object.entries(t).reduce(function(t,r){var o,u,f=r[0],c=r[1];if(!c||"object"!=typeof c||Array.isArray(c)||!i.some(function(t){return t.name===f}))return n({},t,((u={})[f]=c,u));if(!c.hasOwnProperty(e[f])){if(!c.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+f+"' parameter is missing route model binding key '"+e[f]+"'.");e[f]="id"}return n({},t,((o={})[f]=c[e[f]],o))},{})},f.p=function(t){var r,e=this.v().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,""),i=function(t,r,e){void 0===r&&(r="");var i=[t,r].map(function(t){return t.split(e)}),o=i[0];return i[1].reduce(function(t,r,e){var i;return/{[^}?]+\??}/.test(r)&&o[e]?n({},t,((i={})[r.replace(/.*{|\??}.*/g,"")]=o[e].replace(r.match(/^[^{]*/g),"").replace(r.match(/[^}]*$/g),""),i)):t},{})};return n({},i(this.v().host,t.domain,"."),i(e,t.uri,"/"),function(t,r){var n=C;if(""===t||null==t)return n.plainObjects?Object.create(null):{};for(var e="string"==typeof t?function(t,r){var n,e={},i=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),o=-1,u=r.charset;if(r.charsetSentinel)for(n=0;n-1&&(c=x(c)?[c]:c),e[f]=k.call(e,f)?y.combine(e[f],c):c}return e}(t,n):t,i=n.plainObjects?Object.create(null):{},o=Object.keys(e),u=0;u1&&"boolean"!=typeof r)throw new y('"allowMissing" argument must be a boolean');var e=R(t),n=e.length>0?e[0]:"",o=I("%"+n+"%",r),i=o.name,u=o.value,c=!1,s=o.alias;s&&(n=s[0],O(e,A([0,1],s)));for(var l=1,d=!0;l=e.length){var m=p(u,b);u=(d=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[b]}else d=a(u,b),u=u[b];d&&!c&&(g[i]=u)}}return u},M=(function(t){var r=k("%Function.prototype.apply%"),e=k("%Function.prototype.call%"),n=k("%Reflect.apply%",!0)||i.call(e,r),o=k("%Object.getOwnPropertyDescriptor%",!0),a=k("%Object.defineProperty%",!0),f=k("%Math.max%");if(a)try{a({},"a",{value:1})}catch(t){a=null}t.exports=function(t){var r=n(i,e,arguments);if(o&&a){var u=o(r,"length");u.configurable&&a(r,"length",{value:1+f(0,t.length-(arguments.length-1))})}return r};var u=function(){return n(i,r,arguments)};a?a(t.exports,"apply",{value:u}):t.exports.apply=u}(s={exports:{}}),s.exports),x=M(k("String.prototype.indexOf")),U=function(t,r){var e=k(t,!!r);return"function"==typeof e&&x(t,".prototype.")>-1?M(e):e},W="function"==typeof Map&&Map.prototype,$=Object.getOwnPropertyDescriptor&&W?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,N=W&&$&&"function"==typeof $.get?$.get:null,B=W&&Map.prototype.forEach,T="function"==typeof Set&&Set.prototype,C=Object.getOwnPropertyDescriptor&&T?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,_=T&&C&&"function"==typeof C.get?C.get:null,D=T&&Set.prototype.forEach,G="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,q="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,V="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,z=Boolean.prototype.valueOf,J=Object.prototype.toString,L=Function.prototype.toString,H=String.prototype.match,Z="function"==typeof BigInt?BigInt.prototype.valueOf:null,Q=Object.getOwnPropertySymbols,K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,X="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Y=Object.prototype.propertyIsEnumerable,tt=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),rt={__proto__:null,default:{}}.custom,et=rt&&ut(rt)?rt:null,nt="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null,ot=function t(r,e,n,o){var i=e||{};if(ct(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ct(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&Infinity!==i.maxStringLength:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!ct(i,"customInspect")||i.customInspect;if("boolean"!=typeof a&&"symbol"!==a)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ct(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return lt(r,i);if("number"==typeof r)return 0===r?Infinity/r>0?"0":"-0":String(r);if("bigint"==typeof r)return String(r)+"n";var f=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=f&&f>0&&"object"==typeof r)return ft(r)?"[Array]":"[Object]";var u,y=function(t,r){var e;if("\t"===t.indent)e="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;e=Array(t.indent+1).join(" ")}return{base:e,prev:Array(r+1).join(e)}}(i,n);if(void 0===o)o=[];else if(st(o,r)>=0)return"[Circular]";function c(r,e,a){if(e&&(o=o.slice()).push(e),a){var f={depth:i.depth};return ct(i,"quoteStyle")&&(f.quoteStyle=i.quoteStyle),t(r,f,n+1,o)}return t(r,i,n+1,o)}if("function"==typeof r){var p=function(t){if(t.name)return t.name;var r=H.call(L.call(t),/^function\s*([\w$]+)/);return r?r[1]:null}(r),s=gt(r,c);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(s.length>0?" { "+s.join(", ")+" }":"")}if(ut(r)){var l=X?String(r).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):K.call(r);return"object"!=typeof r||X?l:bt(l)}if((u=r)&&"object"==typeof u&&("undefined"!=typeof HTMLElement&&u instanceof HTMLElement||"string"==typeof u.nodeName&&"function"==typeof u.getAttribute)){for(var d="<"+String(r.nodeName).toLowerCase(),b=r.attributes||[],v=0;v"}if(ft(r)){if(0===r.length)return"[]";var h=gt(r,c);return y&&!function(t){for(var r=0;r=0)return!1;return!0}(h)?"["+mt(h,y)+"]":"[ "+h.join(", ")+" ]"}if(function(t){return!("[object Error]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r)){var m=gt(r,c);return 0===m.length?"["+String(r)+"]":"{ ["+String(r)+"] "+m.join(", ")+" }"}if("object"==typeof r&&a){if(et&&"function"==typeof r[et])return r[et]();if("symbol"!==a&&"function"==typeof r.inspect)return r.inspect()}if(function(t){if(!N||!t||"object"!=typeof t)return!1;try{N.call(t);try{_.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(r)){var g=[];return B.call(r,function(t,e){g.push(c(e,r,!0)+" => "+c(t,r))}),ht("Map",N.call(r),g,y)}if(function(t){if(!_||!t||"object"!=typeof t)return!1;try{_.call(t);try{N.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(r)){var j=[];return D.call(r,function(t){j.push(c(t,r))}),ht("Set",_.call(r),j,y)}if(function(t){if(!G||!t||"object"!=typeof t)return!1;try{G.call(t,G);try{q.call(t,q)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(r))return vt("WeakMap");if(function(t){if(!q||!t||"object"!=typeof t)return!1;try{q.call(t,q);try{G.call(t,G)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(r))return vt("WeakSet");if(function(t){if(!V||!t||"object"!=typeof t)return!1;try{return V.call(t),!0}catch(t){}return!1}(r))return vt("WeakRef");if(function(t){return!("[object Number]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r))return bt(c(Number(r)));if(function(t){if(!t||"object"!=typeof t||!Z)return!1;try{return Z.call(t),!0}catch(t){}return!1}(r))return bt(c(Z.call(r)));if(function(t){return!("[object Boolean]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r))return bt(z.call(r));if(function(t){return!("[object String]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r))return bt(c(String(r)));if(!function(t){return!("[object Date]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r)&&!function(t){return!("[object RegExp]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}(r)){var S=gt(r,c),A=tt?tt(r)===Object.prototype:r instanceof Object||r.constructor===Object,O=r instanceof Object?"":"null prototype",w=!A&&nt&&Object(r)===r&&nt in r?pt(r).slice(8,-1):O?"Object":"",P=(A||"function"!=typeof r.constructor?"":r.constructor.name?r.constructor.name+" ":"")+(w||O?"["+[].concat(w||[],O||[]).join(": ")+"] ":"");return 0===S.length?P+"{}":y?P+"{"+mt(S,y)+"}":P+"{ "+S.join(", ")+" }"}return String(r)};function it(t,r,e){var n="double"===(e.quoteStyle||r)?'"':"'";return n+t+n}function at(t){return String(t).replace(/"/g,""")}function ft(t){return!("[object Array]"!==pt(t)||nt&&"object"==typeof t&&nt in t)}function ut(t){if(X)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!K)return!1;try{return K.call(t),!0}catch(t){}return!1}var yt=Object.prototype.hasOwnProperty||function(t){return t in this};function ct(t,r){return yt.call(t,r)}function pt(t){return J.call(t)}function st(t,r){if(t.indexOf)return t.indexOf(r);for(var e=0,n=t.length;er.maxStringLength){var e=t.length-r.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return lt(t.slice(0,r.maxStringLength),r)+n}return it(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,dt),"single",r)}function dt(t){var r=t.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return e?"\\"+e:"\\x"+(r<16?"0":"")+r.toString(16).toUpperCase()}function bt(t){return"Object("+t+")"}function vt(t){return t+" { ? }"}function ht(t,r,e,n){return t+" ("+r+") {"+(n?mt(e,n):e.join(", "))+"}"}function mt(t,r){if(0===t.length)return"";var e="\n"+r.prev+r.base;return e+t.join(","+e)+"\n"+r.prev}function gt(t,r){var e=ft(t),n=[];if(e){n.length=t.length;for(var o=0;o1;){var r=t.pop(),e=r.obj[r.prop];if($t(e)){for(var n=[],o=0;o=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===Ut.RFC1738&&(40===u||41===u)?a+=i.charAt(f):u<128?a+=Nt[u]:u<2048?a+=Nt[192|u>>6]+Nt[128|63&u]:u<55296||u>=57344?a+=Nt[224|u>>12]+Nt[128|u>>6&63]+Nt[128|63&u]:(u=65536+((1023&u)<<10|1023&i.charCodeAt(f+=1)),a+=Nt[240|u>>18]+Nt[128|u>>12&63]+Nt[128|u>>6&63]+Nt[128|63&u])}return a},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if($t(t)){for(var e=[],n=0;n0?h.join(",")||null:void 0}];else if(Dt(f))m=f;else{var j=Object.keys(h);m=u?j.sort(u):j}for(var S=0;S-1?t.split(","):t},Yt=function(t,r,e,n){if(t){var o=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,a=e.depth>0&&/(\[[^[\]]*])/.exec(o),f=a?o.slice(0,a.index):o,u=[];if(f){if(!e.plainObjects&&Ht.call(Object.prototype,f)&&!e.allowPrototypes)return;u.push(f)}for(var y=0;e.depth>0&&null!==(a=i.exec(o))&&y=0;--i){var a,f=t[i];if("[]"===f&&e.parseArrays)a=[].concat(o);else{a=e.plainObjects?Object.create(null):{};var u="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,y=parseInt(u,10);e.parseArrays||""!==u?!isNaN(y)&&f!==u&&String(y)===u&&y>=0&&e.parseArrays&&y<=e.arrayLimit?(a=[])[y]=o:a[u]=o:a={0:o}}o=a}return o}(u,r,e,n)}};class tr{constructor(t,r,e){var n;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.config=e}get template(){return`${this.config.absolute?this.definition.domain?`${this.config.url.match(/^\w+:\/\//)[0]}${this.definition.domain}${this.config.port?`:${this.config.port}`:""}`:this.config.url:""}/${this.definition.uri}`.replace(/\/+$/,"")}get parameterSegments(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(t=>({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(t){if(!this.definition.methods.includes("GET"))return!1;const r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp(`^${r}$`).test(t.replace(/\/+$/,"").split("?").shift())}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,(r,e)=>{var n;if([null,void 0].includes(t[e])&&this.parameterSegments.find(({name:t})=>t===e).required)throw new Error(`Ziggy error: '${e}' parameter is required for route '${this.name}'.`);return encodeURIComponent(null!=(n=t[e])?n:"")}).replace(/\/+$/,""):this.template}}class rr extends String{constructor(r,e,n=!0,o){if(super(),this.t=null!=o?o:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,this.t=t({},this.t,{absolute:n}),r){if(!this.t.routes[r])throw new Error(`Ziggy error: route '${r}' is not in the route list.`);this.i=new tr(r,this.t.routes[r],this.t),this.u=this.p(e)}}toString(){const r=Object.keys(this.u).filter(t=>!this.i.parameterSegments.some(({name:r})=>r===t)).filter(t=>"_query"!==t).reduce((r,e)=>t({},r,{[e]:this.u[e]}),{});return this.i.compile(this.u)+function(t,r){var e,n=t,o=function(t){if(!t)return Jt;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||Jt.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=Ut.default;if(void 0!==t.format){if(!Ct.call(Ut.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var n=Ut.formatters[e],o=Jt.filter;return("function"==typeof t.filter||Dt(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:Jt.addQueryPrefix,allowDots:void 0===t.allowDots?Jt.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Jt.charsetSentinel,delimiter:void 0===t.delimiter?Jt.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:Jt.encode,encoder:"function"==typeof t.encoder?t.encoder:Jt.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:Jt.encodeValuesOnly,filter:o,format:e,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:Jt.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:Jt.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Jt.strictNullHandling}}(r);"function"==typeof o.filter?n=(0,o.filter)("",n):Dt(o.filter)&&(e=o.filter);var i=[];if("object"!=typeof n||null===n)return"";var a=_t[r&&r.arrayFormat in _t?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(n)),o.sort&&e.sort(o.sort);for(var f=kt(),u=0;u0?p+c:""}(t({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,r)=>"boolean"==typeof t?Number(t):r(t)})}current(t,r){const e=this.t.absolute?this.l().host+this.l().pathname:this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),[n,o]=Object.entries(this.t.routes).find(([r,n])=>new tr(t,n,this.t).matchesUrl(e))||[void 0,void 0];if(!t)return n;const i=new RegExp(`^${t.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(n);if([null,void 0].includes(r)||!i)return i;const a=new tr(n,o,this.t);r=this.p(r,a);const f=this.v(o);return!(!Object.values(r).every(t=>!t)||Object.values(f).length)||Object.entries(r).every(([t,r])=>f[t]==r)}l(){var t,r,e,n,o,i;const{host:a="",pathname:f="",search:u=""}="undefined"!=typeof window?window.location:{};return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:a,pathname:null!=(e=null==(n=this.t.location)?void 0:n.pathname)?e:f,search:null!=(o=null==(i=this.t.location)?void 0:i.search)?o:u}}get params(){return this.v(this.t.routes[this.current()])}has(t){return Object.keys(this.t.routes).includes(t)}p(r={},e=this.i){r=["string","number"].includes(typeof r)?[r]:r;const n=e.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(r)?r=r.reduce((r,e,o)=>t({},r,n[o]?{[n[o].name]:e}:{[e]:""}),{}):1!==n.length||r[n[0].name]||!r.hasOwnProperty(Object.values(e.bindings)[0])&&!r.hasOwnProperty("id")||(r={[n[0].name]:r}),t({},this.h(e),this.m(r,e))}h(r){return r.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((r,{name:e},n)=>t({},r,{[e]:this.t.defaults[e]}),{})}m(r,{bindings:e,parameterSegments:n}){return Object.entries(r).reduce((r,[o,i])=>{if(!i||"object"!=typeof i||Array.isArray(i)||!n.some(({name:t})=>t===o))return t({},r,{[o]:i});if(!i.hasOwnProperty(e[o])){if(!i.hasOwnProperty("id"))throw new Error(`Ziggy error: object passed as '${o}' parameter is missing route model binding key '${e[o]}'.`);e[o]="id"}return t({},r,{[o]:i[e[o]]})},{})}v(r){var e;let n=this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"");const o=(r,e="",n)=>{const[o,i]=[r,e].map(t=>t.split(n));return i.reduce((r,e,n)=>/{[^}?]+\??}/.test(e)&&o[n]?t({},r,{[e.replace(/.*{|\??}.*/g,"")]:o[n].replace(e.match(/^[^{]*/g),"").replace(e.match(/[^}]*$/g),"")}):r,{})};return t({},o(this.l().host,r.domain,"."),o(n,r.uri,"/"),function(t,r){var e=Qt;if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},o=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),i=-1,a=r.charset;if(r.charsetSentinel)for(e=0;e-1&&(u=Zt(u)?[u]:u),n[f]=Ht.call(n,f)?Tt.combine(n[f],u):u}return n}(t,e):t,o=e.plainObjects?Object.create(null):{},i=Object.keys(n),a=0;at.mixin({methods:{route:(t,e,n,o=r)=>function(t,r,e,n){const o=new rr(t,r,e,n);return t?o.toString():o}(t,e,n,o)}})};export{er as ZiggyVue}; +function t(){return t=Object.assign||function(t){for(var r=1;r1;){var r=t.pop(),e=r.obj[r.prop];if(o(e)){for(var n=[],i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===n.RFC1738&&(40===c||41===c)?f+=s.charAt(a):c<128?f+=u[c]:c<2048?f+=u[192|c>>6]+u[128|63&c]:c<55296||c>=57344?f+=u[224|c>>12]+u[128|c>>6&63]+u[128|63&c]:(c=65536+((1023&c)<<10|1023&s.charCodeAt(a+=1)),f+=u[240|c>>18]+u[128|c>>12&63]+u[128|c>>6&63]+u[128|63&c])}return f},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if(o(t)){for(var e=[],n=0;n0?O.join(",")||null:void 0}];else if(l(s))R=s;else{var C=Object.keys(O);R=a?C.sort(a):C}for(var x=0;x-1?t.split(","):t},S=function(t,r,e,n){if(t){var i=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,u=e.depth>0&&/(\[[^[\]]*])/.exec(i),s=u?i.slice(0,u.index):i,f=[];if(s){if(!e.plainObjects&&m.call(Object.prototype,s)&&!e.allowPrototypes)return;f.push(s)}for(var a=0;e.depth>0&&null!==(u=o.exec(i))&&a=0;--o){var u,s=t[o];if("[]"===s&&e.parseArrays)u=[].concat(i);else{u=e.plainObjects?Object.create(null):{};var f="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,a=parseInt(f,10);e.parseArrays||""!==f?!isNaN(a)&&s!==f&&String(a)===f&&a>=0&&e.parseArrays&&a<=e.arrayLimit?(u=[])[a]=i:"__proto__"!==f&&(u[f]=i):u={0:i}}i=u}return i}(f,r,e,n)}};class E{constructor(t,r,e){var n,i;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.wheres=null!=(i=r.wheres)?i:{},this.config=e}get template(){return`${this.config.absolute?this.definition.domain?`${this.config.url.match(/^\w+:\/\//)[0]}${this.definition.domain}${this.config.port?`:${this.config.port}`:""}`:this.config.url:""}/${this.definition.uri}`.replace(/\/+$/,"")}get parameterSegments(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(t=>({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(t){if(!this.definition.methods.includes("GET"))return!1;const r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp(`^${r}$`).test(t.replace(/\/+$/,"").split("?").shift())}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,(r,e)=>{var n,i;if([null,void 0].includes(t[e])&&this.parameterSegments.find(({name:t})=>t===e).required)throw new Error(`Ziggy error: '${e}' parameter is required for route '${this.name}'.`);return this.parameterSegments[this.parameterSegments.length-1].name===e&&".*"===this.wheres[e]?null!=(i=t[e])?i:"":encodeURIComponent(null!=(n=t[e])?n:"")}).replace(/\/+$/,""):this.template}}class R extends String{constructor(r,e,n=!0,i){if(super(),this.t=null!=i?i:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,this.t=t({},this.t,{absolute:n}),r){if(!this.t.routes[r])throw new Error(`Ziggy error: route '${r}' is not in the route list.`);this.i=new E(r,this.t.routes[r],this.t),this.u=this.l(e)}}toString(){const r=Object.keys(this.u).filter(t=>!this.i.parameterSegments.some(({name:r})=>r===t)).filter(t=>"_query"!==t).reduce((r,e)=>t({},r,{[e]:this.u[e]}),{});return this.i.compile(this.u)+function(t,r){var e,i=t,o=function(t){if(!t)return b;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||b.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=n.default;if(void 0!==t.format){if(!a.call(n.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var i=n.formatters[e],o=b.filter;return("function"==typeof t.filter||l(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:b.addQueryPrefix,allowDots:void 0===t.allowDots?b.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:b.charsetSentinel,delimiter:void 0===t.delimiter?b.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:b.encode,encoder:"function"==typeof t.encoder?t.encoder:b.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:b.encodeValuesOnly,filter:o,format:e,formatter:i,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:b.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:b.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:b.strictNullHandling}}(r);"function"==typeof o.filter?i=(0,o.filter)("",i):l(o.filter)&&(e=o.filter);var u=[];if("object"!=typeof i||null===i)return"";var s=c[r&&r.arrayFormat in c?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(i)),o.sort&&e.sort(o.sort);for(var f=0;f0?v+p:""}(t({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,r)=>"boolean"==typeof t?Number(t):r(t)})}current(t,r){const e=this.t.absolute?this.h().host+this.h().pathname:this.h().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),[n,i]=Object.entries(this.t.routes).find(([r,n])=>new E(t,n,this.t).matchesUrl(e))||[void 0,void 0];if(!t)return n;const o=new RegExp(`^${t.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(n);if([null,void 0].includes(r)||!o)return o;const u=new E(n,i,this.t);r=this.l(r,u);const s=this.p(i);return!(!Object.values(r).every(t=>!t)||Object.values(s).length)||Object.entries(r).every(([t,r])=>s[t]==r)}h(){var t,r,e,n,i,o;const{host:u="",pathname:s="",search:f=""}="undefined"!=typeof window?window.location:{};return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:u,pathname:null!=(e=null==(n=this.t.location)?void 0:n.pathname)?e:s,search:null!=(i=null==(o=this.t.location)?void 0:o.search)?i:f}}get params(){return this.p(this.t.routes[this.current()])}has(t){return Object.keys(this.t.routes).includes(t)}l(r={},e=this.i){r=["string","number"].includes(typeof r)?[r]:r;const n=e.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(r)?r=r.reduce((r,e,i)=>t({},r,n[i]?{[n[i].name]:e}:{[e]:""}),{}):1!==n.length||r[n[0].name]||!r.hasOwnProperty(Object.values(e.bindings)[0])&&!r.hasOwnProperty("id")||(r={[n[0].name]:r}),t({},this.v(e),this.g(r,e))}v(r){return r.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((r,{name:e},n)=>t({},r,{[e]:this.t.defaults[e]}),{})}g(r,{bindings:e,parameterSegments:n}){return Object.entries(r).reduce((r,[i,o])=>{if(!o||"object"!=typeof o||Array.isArray(o)||!n.some(({name:t})=>t===i))return t({},r,{[i]:o});if(!o.hasOwnProperty(e[i])){if(!o.hasOwnProperty("id"))throw new Error(`Ziggy error: object passed as '${i}' parameter is missing route model binding key '${e[i]}'.`);e[i]="id"}return t({},r,{[i]:o[e[i]]})},{})}p(r){var e;let n=this.h().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"");const i=(r,e="",n)=>{const[i,o]=[r,e].map(t=>t.split(n));return o.reduce((r,e,n)=>/{[^}?]+\??}/.test(e)&&i[n]?t({},r,{[e.replace(/.*{|\??}.*/g,"")]:i[n].replace(e.match(/^[^{]*/g),"").replace(e.match(/[^}]*$/g),"")}):r,{})};return t({},i(this.h().host,r.domain,"."),i(n,r.uri,"/"),function(t,r){var e=O;if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},i=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),o=-1,u=r.charset;if(r.charsetSentinel)for(e=0;e-1&&(a=j(a)?[a]:a),n[s]=m.call(n,s)?f.combine(n[s],a):a}return n}(t,e):t,i=e.plainObjects?Object.create(null):{},o=Object.keys(n),u=0;ut.mixin({methods:{route:(t,e,n,i=r)=>function(t,r,e,n){const i=new R(t,r,e,n);return t?i.toString():i}(t,e,n,i)}})};export{k as ZiggyVue}; diff --git a/dist/vue.js b/dist/vue.js index 30472012..0d4d3ba2 100644 --- a/dist/vue.js +++ b/dist/vue.js @@ -1 +1 @@ -!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t||self).ZiggyVue={})}(this,function(t){function r(t,r){for(var e=0;e1&&"boolean"!=typeof r)throw new m('"allowMissing" argument must be a boolean');var e=B(t),n=e.length>0?e[0]:"",o=C("%"+n+"%",r),i=o.name,u=o.value,f=!1,a=o.alias;a&&(n=a[0],M(e,x([0,1],a)));for(var c=1,y=!0;c=e.length){var b=S(u,p);u=(y=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[p]}else y=v(u,p),u=u[p];y&&!f&&(F[i]=u)}}return u},$=function(t){var r={exports:{}};return function(t){var r=D("%Function.prototype.apply%"),e=D("%Function.prototype.call%"),n=D("%Reflect.apply%",!0)||d.call(e,r),o=D("%Object.getOwnPropertyDescriptor%",!0),i=D("%Object.defineProperty%",!0),u=D("%Math.max%");if(i)try{i({},"a",{value:1})}catch(t){i=null}t.exports=function(t){var r=n(d,e,arguments);return o&&i&&o(r,"length").configurable&&i(r,"length",{value:1+u(0,t.length-(arguments.length-1))}),r};var f=function(){return n(d,r,arguments)};i?i(t.exports,"apply",{value:f}):t.exports.apply=f}(r),r.exports}(),G=$(D("String.prototype.indexOf")),_=function(t,r){var e=D(t,!!r);return"function"==typeof e&&G(t,".prototype.")>-1?$(e):e},q="function"==typeof Map&&Map.prototype,V=Object.getOwnPropertyDescriptor&&q?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,z=q&&V&&"function"==typeof V.get?V.get:null,J=q&&Map.prototype.forEach,L="function"==typeof Set&&Set.prototype,H=Object.getOwnPropertyDescriptor&&L?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Z=L&&H&&"function"==typeof H.get?H.get:null,Q=L&&Set.prototype.forEach,K="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,X="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,Y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,tt=Boolean.prototype.valueOf,rt=Object.prototype.toString,et=Function.prototype.toString,nt=String.prototype.match,ot="function"==typeof BigInt?BigInt.prototype.valueOf:null,it=Object.getOwnPropertySymbols,ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,ft="function"==typeof Symbol&&"object"==typeof Symbol.iterator,at=Object.prototype.propertyIsEnumerable,ct=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),yt={__proto__:null,default:{}}.custom,pt=yt&&ht(yt)?yt:null,lt="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null,st=function t(r,e,n,o){var i=e||{};if(mt(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(mt(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&Infinity!==i.maxStringLength:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!mt(i,"customInspect")||i.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(mt(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return At(r,i);if("number"==typeof r)return 0===r?Infinity/r>0?"0":"-0":String(r);if("bigint"==typeof r)return String(r)+"n";var f=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=f&&f>0&&"object"==typeof r)return vt(r)?"[Array]":"[Object]";var a,c=function(t,r){var e;if("\t"===t.indent)e="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;e=Array(t.indent+1).join(" ")}return{base:e,prev:Array(r+1).join(e)}}(i,n);if(void 0===o)o=[];else if(St(o,r)>=0)return"[Circular]";function y(r,e,u){if(e&&(o=o.slice()).push(e),u){var f={depth:i.depth};return mt(i,"quoteStyle")&&(f.quoteStyle=i.quoteStyle),t(r,f,n+1,o)}return t(r,i,n+1,o)}if("function"==typeof r){var p=function(t){if(t.name)return t.name;var r=nt.call(et.call(t),/^function\s*([\w$]+)/);return r?r[1]:null}(r),l=Ft(r,y);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(l.length>0?" { "+l.join(", ")+" }":"")}if(ht(r)){var s=ft?String(r).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):ut.call(r);return"object"!=typeof r||ft?s:wt(s)}if((a=r)&&"object"==typeof a&&("undefined"!=typeof HTMLElement&&a instanceof HTMLElement||"string"==typeof a.nodeName&&"function"==typeof a.getAttribute)){for(var b="<"+String(r.nodeName).toLowerCase(),d=r.attributes||[],v=0;v"}if(vt(r)){if(0===r.length)return"[]";var h=Ft(r,y);return c&&!function(t){for(var r=0;r=0)return!1;return!0}(h)?"["+Rt(h,c)+"]":"[ "+h.join(", ")+" ]"}if(function(t){return!("[object Error]"!==jt(t)||lt&&"object"==typeof t&< in t)}(r)){var g=Ft(r,y);return 0===g.length?"["+String(r)+"]":"{ ["+String(r)+"] "+g.join(", ")+" }"}if("object"==typeof r&&u){if(pt&&"function"==typeof r[pt])return r[pt]();if("symbol"!==u&&"function"==typeof r.inspect)return r.inspect()}if(function(t){if(!z||!t||"object"!=typeof t)return!1;try{z.call(t);try{Z.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(r)){var m=[];return J.call(r,function(t,e){m.push(y(e,r,!0)+" => "+y(t,r))}),Et("Map",z.call(r),m,c)}if(function(t){if(!Z||!t||"object"!=typeof t)return!1;try{Z.call(t);try{z.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(r)){var j=[];return Q.call(r,function(t){j.push(y(t,r))}),Et("Set",Z.call(r),j,c)}if(function(t){if(!K||!t||"object"!=typeof t)return!1;try{K.call(t,K);try{X.call(t,X)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(r))return Pt("WeakMap");if(function(t){if(!X||!t||"object"!=typeof t)return!1;try{X.call(t,X);try{K.call(t,K)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(r))return Pt("WeakSet");if(function(t){if(!Y||!t||"object"!=typeof t)return!1;try{return Y.call(t),!0}catch(t){}return!1}(r))return Pt("WeakRef");if(function(t){return!("[object Number]"!==jt(t)||lt&&"object"==typeof t&< in t)}(r))return wt(y(Number(r)));if(function(t){if(!t||"object"!=typeof t||!ot)return!1;try{return ot.call(t),!0}catch(t){}return!1}(r))return wt(y(ot.call(r)));if(function(t){return!("[object Boolean]"!==jt(t)||lt&&"object"==typeof t&< in t)}(r))return wt(tt.call(r));if(function(t){return!("[object String]"!==jt(t)||lt&&"object"==typeof t&< in t)}(r))return wt(y(String(r)));if(!function(t){return!("[object Date]"!==jt(t)||lt&&"object"==typeof t&< in t)}(r)&&!function(t){return!("[object RegExp]"!==jt(t)||lt&&"object"==typeof t&< in t)}(r)){var S=Ft(r,y),A=ct?ct(r)===Object.prototype:r instanceof Object||r.constructor===Object,O=r instanceof Object?"":"null prototype",w=!A&<&&Object(r)===r&< in r?jt(r).slice(8,-1):O?"Object":"",P=(A||"function"!=typeof r.constructor?"":r.constructor.name?r.constructor.name+" ":"")+(w||O?"["+[].concat(w||[],O||[]).join(": ")+"] ":"");return 0===S.length?P+"{}":c?P+"{"+Rt(S,c)+"}":P+"{ "+S.join(", ")+" }"}return String(r)};function bt(t,r,e){var n="double"===(e.quoteStyle||r)?'"':"'";return n+t+n}function dt(t){return String(t).replace(/"/g,""")}function vt(t){return!("[object Array]"!==jt(t)||lt&&"object"==typeof t&< in t)}function ht(t){if(ft)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!ut)return!1;try{return ut.call(t),!0}catch(t){}return!1}var gt=Object.prototype.hasOwnProperty||function(t){return t in this};function mt(t,r){return gt.call(t,r)}function jt(t){return rt.call(t)}function St(t,r){if(t.indexOf)return t.indexOf(r);for(var e=0,n=t.length;er.maxStringLength){var e=t.length-r.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return At(t.slice(0,r.maxStringLength),r)+n}return bt(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,Ot),"single",r)}function Ot(t){var r=t.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return e?"\\"+e:"\\x"+(r<16?"0":"")+r.toString(16).toUpperCase()}function wt(t){return"Object("+t+")"}function Pt(t){return t+" { ? }"}function Et(t,r,e,n){return t+" ("+r+") {"+(n?Rt(e,n):e.join(", "))+"}"}function Rt(t,r){if(0===t.length)return"";var e="\n"+r.prev+r.base;return e+t.join(","+e)+"\n"+r.prev}function Ft(t,r){var e=vt(t),n=[];if(e){n.length=t.length;for(var o=0;o1;){var r=t.pop(),e=r.obj[r.prop];if(zt(e)){for(var n=[],o=0;o=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||o===qt.RFC1738&&(40===a||41===a)?u+=i.charAt(f):a<128?u+=Jt[a]:a<2048?u+=Jt[192|a>>6]+Jt[128|63&a]:a<55296||a>=57344?u+=Jt[224|a>>12]+Jt[128|a>>6&63]+Jt[128|63&a]:(a=65536+((1023&a)<<10|1023&i.charCodeAt(f+=1)),u+=Jt[240|a>>18]+Jt[128|a>>12&63]+Jt[128|a>>6&63]+Jt[128|63&a])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if(zt(t)){for(var e=[],n=0;n0?h.join(",")||null:void 0}];else if(Kt(f))g=f;else{var j=Object.keys(h);g=a?j.sort(a):j}for(var S=0;S-1?t.split(","):t},cr=function(t,r,e,n){if(t){var o=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,u=e.depth>0&&/(\[[^[\]]*])/.exec(o),f=u?o.slice(0,u.index):o,a=[];if(f){if(!e.plainObjects&&or.call(Object.prototype,f)&&!e.allowPrototypes)return;a.push(f)}for(var c=0;e.depth>0&&null!==(u=i.exec(o))&&c=0;--i){var u,f=t[i];if("[]"===f&&e.parseArrays)u=[].concat(o);else{u=e.plainObjects?Object.create(null):{};var a="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,c=parseInt(a,10);e.parseArrays||""!==a?!isNaN(c)&&f!==a&&String(c)===a&&c>=0&&e.parseArrays&&c<=e.arrayLimit?(u=[])[c]=o:u[a]=o:u={0:o}}o=u}return o}(a,r,e,n)}},yr=function(){function t(t,r,e){var n;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.config=e}var r=t.prototype;return r.matchesUrl=function(t){if(!this.definition.methods.includes("GET"))return!1;var r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+r+"$").test(t.replace(/\/+$/,"").split("?").shift())},r.compile=function(t){var r=this;return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,function(e,n){var o;if([null,void 0].includes(t[n])&&r.parameterSegments.find(function(t){return t.name===n}).required)throw new Error("Ziggy error: '"+n+"' parameter is required for route '"+r.name+"'.");return encodeURIComponent(null!=(o=t[n])?o:"")}).replace(/\/+$/,""):this.template},e(t,[{key:"template",get:function(){return((this.config.absolute?this.definition.domain?""+this.config.url.match(/^\w+:\/\//)[0]+this.definition.domain+(this.config.port?":"+this.config.port:""):this.config.url:"")+"/"+this.definition.uri).replace(/\/+$/,"")}},{key:"parameterSegments",get:function(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(function(t){return{name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)}}))?t:[]}}]),t}(),pr=function(t){var r,o;function u(r,e,o,i){var u;if(void 0===o&&(o=!0),(u=t.call(this)||this).t=null!=i?i:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,u.t=n({},u.t,{absolute:o}),r){if(!u.t.routes[r])throw new Error("Ziggy error: route '"+r+"' is not in the route list.");u.i=new yr(r,u.t.routes[r],u.t),u.u=u.p(e)}return u}o=t,(r=u).prototype=Object.create(o.prototype),r.prototype.constructor=r,i(r,o);var f=u.prototype;return f.toString=function(){var t=this,r=Object.keys(this.u).filter(function(r){return!t.i.parameterSegments.some(function(t){return t.name===r})}).filter(function(t){return"_query"!==t}).reduce(function(r,e){var o;return n({},r,((o={})[e]=t.u[e],o))},{});return this.i.compile(this.u)+function(t,r){var e,n=t,o=function(t){if(!t)return er;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||er.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=qt.default;if(void 0!==t.format){if(!Zt.call(qt.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var n=qt.formatters[e],o=er.filter;return("function"==typeof t.filter||Kt(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:er.addQueryPrefix,allowDots:void 0===t.allowDots?er.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:er.charsetSentinel,delimiter:void 0===t.delimiter?er.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:er.encode,encoder:"function"==typeof t.encoder?t.encoder:er.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:er.encodeValuesOnly,filter:o,format:e,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:er.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:er.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:er.strictNullHandling}}(r);"function"==typeof o.filter?n=(0,o.filter)("",n):Kt(o.filter)&&(e=o.filter);var i=[];if("object"!=typeof n||null===n)return"";var u=Qt[r&&r.arrayFormat in Qt?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(n)),o.sort&&e.sort(o.sort);for(var f=Dt(),a=0;a0?p+y:""}(n({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:function(t,r){return"boolean"==typeof t?Number(t):r(t)}})},f.current=function(t,r){var e=this,n=this.t.absolute?this.l().host+this.l().pathname:this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),o=Object.entries(this.t.routes).find(function(r){return new yr(t,r[1],e.t).matchesUrl(n)})||[void 0,void 0],i=o[0],u=o[1];if(!t)return i;var f=new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(i);if([null,void 0].includes(r)||!f)return f;var a=new yr(i,u,this.t);r=this.p(r,a);var c=this.v(u);return!(!Object.values(r).every(function(t){return!t})||Object.values(c).length)||Object.entries(r).every(function(t){return c[t[0]]==t[1]})},f.l=function(){var t,r,e,n,o,i,u="undefined"!=typeof window?window.location:{},f=u.host,a=u.pathname,c=u.search;return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:void 0===f?"":f,pathname:null!=(e=null==(n=this.t.location)?void 0:n.pathname)?e:void 0===a?"":a,search:null!=(o=null==(i=this.t.location)?void 0:i.search)?o:void 0===c?"":c}},f.has=function(t){return Object.keys(this.t.routes).includes(t)},f.p=function(t,r){var e=this;void 0===t&&(t={}),void 0===r&&(r=this.i),t=["string","number"].includes(typeof t)?[t]:t;var o=r.parameterSegments.filter(function(t){return!e.t.defaults[t.name]});if(Array.isArray(t))t=t.reduce(function(t,r,e){var i,u;return n({},t,o[e]?((i={})[o[e].name]=r,i):((u={})[r]="",u))},{});else if(1===o.length&&!t[o[0].name]&&(t.hasOwnProperty(Object.values(r.bindings)[0])||t.hasOwnProperty("id"))){var i;(i={})[o[0].name]=t,t=i}return n({},this.h(r),this.g(t,r))},f.h=function(t){var r=this;return t.parameterSegments.filter(function(t){return r.t.defaults[t.name]}).reduce(function(t,e,o){var i,u=e.name;return n({},t,((i={})[u]=r.t.defaults[u],i))},{})},f.g=function(t,r){var e=r.bindings,o=r.parameterSegments;return Object.entries(t).reduce(function(t,r){var i,u,f=r[0],a=r[1];if(!a||"object"!=typeof a||Array.isArray(a)||!o.some(function(t){return t.name===f}))return n({},t,((u={})[f]=a,u));if(!a.hasOwnProperty(e[f])){if(!a.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+f+"' parameter is missing route model binding key '"+e[f]+"'.");e[f]="id"}return n({},t,((i={})[f]=a[e[f]],i))},{})},f.v=function(t){var r,e=this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,""),o=function(t,r,e){void 0===r&&(r="");var o=[t,r].map(function(t){return t.split(e)}),i=o[0];return o[1].reduce(function(t,r,e){var o;return/{[^}?]+\??}/.test(r)&&i[e]?n({},t,((o={})[r.replace(/.*{|\??}.*/g,"")]=i[e].replace(r.match(/^[^{]*/g),"").replace(r.match(/[^}]*$/g),""),o)):t},{})};return n({},o(this.l().host,t.domain,"."),o(e,t.uri,"/"),function(t,r){var e=ur;if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},o=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),i=-1,u=r.charset;if(r.charsetSentinel)for(e=0;e-1&&(a=ir(a)?[a]:a),n[f]=or.call(n,f)?Ht.combine(n[f],a):a}return n}(t,e):t,o=e.plainObjects?Object.create(null):{},i=Object.keys(n),u=0;u1;){var n=t.pop(),r=n.obj[n.prop];if(d(r)){for(var e=[],i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===v.RFC1738&&(40===c||41===c)?u+=o.charAt(f):c<128?u+=y[c]:c<2048?u+=y[192|c>>6]+y[128|63&c]:c<55296||c>=57344?u+=y[224|c>>12]+y[128|c>>6&63]+y[128|63&c]:(c=65536+((1023&c)<<10|1023&o.charCodeAt(f+=1)),u+=y[240|c>>18]+y[128|c>>12&63]+y[128|c>>6&63]+y[128|63&c])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,n){if(d(t)){for(var r=[],e=0;e0?h.join(",")||null:void 0}];else if(j(f))S=f;else{var T=Object.keys(h);S=c?T.sort(c):T}for(var C=0;C-1?t.split(","):t},$=function(t,n,r,e){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,u=r.depth>0&&/(\[[^[\]]*])/.exec(i),f=u?i.slice(0,u.index):i,c=[];if(f){if(!r.plainObjects&&T.call(Object.prototype,f)&&!r.allowPrototypes)return;c.push(f)}for(var a=0;r.depth>0&&null!==(u=o.exec(i))&&a=0;--o){var u,f=t[o];if("[]"===f&&r.parseArrays)u=[].concat(i);else{u=r.plainObjects?Object.create(null):{};var c="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,a=parseInt(c,10);r.parseArrays||""!==c?!isNaN(a)&&f!==c&&String(a)===c&&a>=0&&r.parseArrays&&a<=r.arrayLimit?(u=[])[a]=i:"__proto__"!==c&&(u[c]=i):u={0:i}}i=u}return i}(c,n,r,e)}},A=/*#__PURE__*/function(){function t(t,n,r){var e,i;this.name=t,this.definition=n,this.bindings=null!=(e=n.bindings)?e:{},this.wheres=null!=(i=n.wheres)?i:{},this.config=r}var n=t.prototype;return n.matchesUrl=function(t){if(!this.definition.methods.includes("GET"))return!1;var n=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+n+"$").test(t.replace(/\/+$/,"").split("?").shift())},n.compile=function(t){var n=this;return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,function(r,e){var i,o;if([null,void 0].includes(t[e])&&n.parameterSegments.find(function(t){return t.name===e}).required)throw new Error("Ziggy error: '"+e+"' parameter is required for route '"+n.name+"'.");return n.parameterSegments[n.parameterSegments.length-1].name===e&&".*"===n.wheres[e]?null!=(o=t[e])?o:"":encodeURIComponent(null!=(i=t[e])?i:"")}).replace(/\/+$/,""):this.template},r(t,[{key:"template",get:function(){return((this.config.absolute?this.definition.domain?""+this.config.url.match(/^\w+:\/\//)[0]+this.definition.domain+(this.config.port?":"+this.config.port:""):this.config.url:"")+"/"+this.definition.uri).replace(/\/+$/,"")}},{key:"parameterSegments",get:function(){var t,n;return null!=(t=null==(n=this.template.match(/{[^}?]+\??}/g))?void 0:n.map(function(t){return{name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)}}))?t:[]}}]),t}(),B=/*#__PURE__*/function(t){var n,i;function u(n,r,i,o){var u;if(void 0===i&&(i=!0),(u=t.call(this)||this).t=null!=o?o:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,u.t=e({},u.t,{absolute:i}),n){if(!u.t.routes[n])throw new Error("Ziggy error: route '"+n+"' is not in the route list.");u.i=new A(n,u.t.routes[n],u.t),u.u=u.l(r)}return u}i=t,(n=u).prototype=Object.create(i.prototype),n.prototype.constructor=n,o(n,i);var f=u.prototype;return f.toString=function(){var t=this,n=Object.keys(this.u).filter(function(n){return!t.i.parameterSegments.some(function(t){return t.name===n})}).filter(function(t){return"_query"!==t}).reduce(function(n,r){var i;return e({},n,((i={})[r]=t.u[r],i))},{});return this.i.compile(this.u)+function(t,n){var r,e=t,i=function(t){if(!t)return k;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var n=t.charset||k.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=v.default;if(void 0!==t.format){if(!g.call(v.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var e=v.formatters[r],i=k.filter;return("function"==typeof t.filter||j(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:k.addQueryPrefix,allowDots:void 0===t.allowDots?k.allowDots:!!t.allowDots,charset:n,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:k.charsetSentinel,delimiter:void 0===t.delimiter?k.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:k.encode,encoder:"function"==typeof t.encoder?t.encoder:k.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:k.encodeValuesOnly,filter:i,format:r,formatter:e,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:k.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:k.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:k.strictNullHandling}}(n);"function"==typeof i.filter?e=(0,i.filter)("",e):j(i.filter)&&(r=i.filter);var o=[];if("object"!=typeof e||null===e)return"";var u=m[n&&n.arrayFormat in m?n.arrayFormat:n&&"indices"in n?n.indices?"indices":"repeat":"indices"];r||(r=Object.keys(e)),i.sort&&r.sort(i.sort);for(var f=0;f0?l+a:""}(e({},n,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:function(t,n){return"boolean"==typeof t?Number(t):n(t)}})},f.current=function(t,n){var r=this,e=this.t.absolute?this.v().host+this.v().pathname:this.v().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),i=Object.entries(this.t.routes).find(function(n){return new A(t,n[1],r.t).matchesUrl(e)})||[void 0,void 0],o=i[0],u=i[1];if(!t)return o;var f=new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(o);if([null,void 0].includes(n)||!f)return f;var c=new A(o,u,this.t);n=this.l(n,c);var a=this.p(u);return!(!Object.values(n).every(function(t){return!t})||Object.values(a).length)||Object.entries(n).every(function(t){return a[t[0]]==t[1]})},f.v=function(){var t,n,r,e,i,o,u="undefined"!=typeof window?window.location:{},f=u.host,c=u.pathname,a=u.search;return{host:null!=(t=null==(n=this.t.location)?void 0:n.host)?t:void 0===f?"":f,pathname:null!=(r=null==(e=this.t.location)?void 0:e.pathname)?r:void 0===c?"":c,search:null!=(i=null==(o=this.t.location)?void 0:o.search)?i:void 0===a?"":a}},f.has=function(t){return Object.keys(this.t.routes).includes(t)},f.l=function(t,n){var r=this;void 0===t&&(t={}),void 0===n&&(n=this.i),t=["string","number"].includes(typeof t)?[t]:t;var i=n.parameterSegments.filter(function(t){return!r.t.defaults[t.name]});if(Array.isArray(t))t=t.reduce(function(t,n,r){var o,u;return e({},t,i[r]?((o={})[i[r].name]=n,o):((u={})[n]="",u))},{});else if(1===i.length&&!t[i[0].name]&&(t.hasOwnProperty(Object.values(n.bindings)[0])||t.hasOwnProperty("id"))){var o;(o={})[i[0].name]=t,t=o}return e({},this.h(n),this.g(t,n))},f.h=function(t){var n=this;return t.parameterSegments.filter(function(t){return n.t.defaults[t.name]}).reduce(function(t,r,i){var o,u=r.name;return e({},t,((o={})[u]=n.t.defaults[u],o))},{})},f.g=function(t,n){var r=n.bindings,i=n.parameterSegments;return Object.entries(t).reduce(function(t,n){var o,u,f=n[0],c=n[1];if(!c||"object"!=typeof c||Array.isArray(c)||!i.some(function(t){return t.name===f}))return e({},t,((u={})[f]=c,u));if(!c.hasOwnProperty(r[f])){if(!c.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+f+"' parameter is missing route model binding key '"+r[f]+"'.");r[f]="id"}return e({},t,((o={})[f]=c[r[f]],o))},{})},f.p=function(t){var n,r=this.v().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,""),i=function(t,n,r){void 0===n&&(n="");var i=[t,n].map(function(t){return t.split(r)}),o=i[0];return i[1].reduce(function(t,n,r){var i;return/{[^}?]+\??}/.test(n)&&o[r]?e({},t,((i={})[n.replace(/.*{|\??}.*/g,"")]=o[r].replace(n.match(/^[^{]*/g),"").replace(n.match(/[^}]*$/g),""),i)):t},{})};return e({},i(this.v().host,t.domain,"."),i(r,t.uri,"/"),function(t,n){var r=N;if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var e="string"==typeof t?function(t,n){var r,e={},i=(n.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(n.delimiter,Infinity===n.parameterLimit?void 0:n.parameterLimit),o=-1,u=n.charset;if(n.charsetSentinel)for(r=0;r-1&&(c=C(c)?[c]:c),e[f]=T.call(e,f)?b.combine(e[f],c):c}return e}(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(e),u=0;u1&&"boolean"!=typeof r)throw new b('"allowMissing" argument must be a boolean');var e=N(t),n=e.length>0?e[0]:"",o=B("%"+n+"%",r),i=o.name,u=o.value,f=!1,a=o.alias;a&&(n=a[0],k(e,I([0,1],a)));for(var c=1,y=!0;c=e.length){var h=g(u,p);u=(y=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:u[p]}else y=s(u,p),u=u[p];y&&!f&&(E[i]=u)}}return u},C=(function(t){var r=T("%Function.prototype.apply%"),e=T("%Function.prototype.call%"),n=T("%Reflect.apply%",!0)||l.call(e,r),o=T("%Object.getOwnPropertyDescriptor%",!0),i=T("%Object.defineProperty%",!0),u=T("%Math.max%");if(i)try{i({},"a",{value:1})}catch(t){i=null}t.exports=function(t){var r=n(l,e,arguments);if(o&&i){var f=o(r,"length");f.configurable&&i(r,"length",{value:1+u(0,t.length-(arguments.length-1))})}return r};var f=function(){return n(l,r,arguments)};i?i(t.exports,"apply",{value:f}):t.exports.apply=f}(m={exports:{}}),m.exports),D=C(T("String.prototype.indexOf")),$=function(t,r){var e=T(t,!!r);return"function"==typeof e&&D(t,".prototype.")>-1?C(e):e},G="function"==typeof Map&&Map.prototype,_=Object.getOwnPropertyDescriptor&&G?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,q=G&&_&&"function"==typeof _.get?_.get:null,V=G&&Map.prototype.forEach,z="function"==typeof Set&&Set.prototype,J=Object.getOwnPropertyDescriptor&&z?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,L=z&&J&&"function"==typeof J.get?J.get:null,H=z&&Set.prototype.forEach,Z="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,Q="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,K="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,X=Boolean.prototype.valueOf,Y=Object.prototype.toString,tt=Function.prototype.toString,rt=String.prototype.match,et="function"==typeof BigInt?BigInt.prototype.valueOf:null,nt=Object.getOwnPropertySymbols,ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,it="function"==typeof Symbol&&"object"==typeof Symbol.iterator,ut=Object.prototype.propertyIsEnumerable,ft=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),at={__proto__:null,default:{}}.custom,ct=at&&vt(at)?at:null,yt="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null,pt=function t(r,e,n,o){var i=e||{};if(ht(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ht(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&Infinity!==i.maxStringLength:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!ht(i,"customInspect")||i.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ht(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return jt(r,i);if("number"==typeof r)return 0===r?Infinity/r>0?"0":"-0":String(r);if("bigint"==typeof r)return String(r)+"n";var f=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=f&&f>0&&"object"==typeof r)return dt(r)?"[Array]":"[Object]";var a,c=function(t,r){var e;if("\t"===t.indent)e="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;e=Array(t.indent+1).join(" ")}return{base:e,prev:Array(r+1).join(e)}}(i,n);if(void 0===o)o=[];else if(mt(o,r)>=0)return"[Circular]";function y(r,e,u){if(e&&(o=o.slice()).push(e),u){var f={depth:i.depth};return ht(i,"quoteStyle")&&(f.quoteStyle=i.quoteStyle),t(r,f,n+1,o)}return t(r,i,n+1,o)}if("function"==typeof r){var p=function(t){if(t.name)return t.name;var r=rt.call(tt.call(t),/^function\s*([\w$]+)/);return r?r[1]:null}(r),l=Et(r,y);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(l.length>0?" { "+l.join(", ")+" }":"")}if(vt(r)){var s=it?String(r).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):ot.call(r);return"object"!=typeof r||it?s:At(s)}if((a=r)&&"object"==typeof a&&("undefined"!=typeof HTMLElement&&a instanceof HTMLElement||"string"==typeof a.nodeName&&"function"==typeof a.getAttribute)){for(var d="<"+String(r.nodeName).toLowerCase(),v=r.attributes||[],b=0;b"}if(dt(r)){if(0===r.length)return"[]";var h=Et(r,y);return c&&!function(t){for(var r=0;r=0)return!1;return!0}(h)?"["+Pt(h,c)+"]":"[ "+h.join(", ")+" ]"}if(function(t){return!("[object Error]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r)){var g=Et(r,y);return 0===g.length?"["+String(r)+"]":"{ ["+String(r)+"] "+g.join(", ")+" }"}if("object"==typeof r&&u){if(ct&&"function"==typeof r[ct])return r[ct]();if("symbol"!==u&&"function"==typeof r.inspect)return r.inspect()}if(function(t){if(!q||!t||"object"!=typeof t)return!1;try{q.call(t);try{L.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(r)){var m=[];return V.call(r,function(t,e){m.push(y(e,r,!0)+" => "+y(t,r))}),wt("Map",q.call(r),m,c)}if(function(t){if(!L||!t||"object"!=typeof t)return!1;try{L.call(t);try{q.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(r)){var j=[];return H.call(r,function(t){j.push(y(t,r))}),wt("Set",L.call(r),j,c)}if(function(t){if(!Z||!t||"object"!=typeof t)return!1;try{Z.call(t,Z);try{Q.call(t,Q)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(r))return Ot("WeakMap");if(function(t){if(!Q||!t||"object"!=typeof t)return!1;try{Q.call(t,Q);try{Z.call(t,Z)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(r))return Ot("WeakSet");if(function(t){if(!K||!t||"object"!=typeof t)return!1;try{return K.call(t),!0}catch(t){}return!1}(r))return Ot("WeakRef");if(function(t){return!("[object Number]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r))return At(y(Number(r)));if(function(t){if(!t||"object"!=typeof t||!et)return!1;try{return et.call(t),!0}catch(t){}return!1}(r))return At(y(et.call(r)));if(function(t){return!("[object Boolean]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r))return At(X.call(r));if(function(t){return!("[object String]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r))return At(y(String(r)));if(!function(t){return!("[object Date]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r)&&!function(t){return!("[object RegExp]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}(r)){var S=Et(r,y),A=ft?ft(r)===Object.prototype:r instanceof Object||r.constructor===Object,O=r instanceof Object?"":"null prototype",w=!A&&yt&&Object(r)===r&&yt in r?gt(r).slice(8,-1):O?"Object":"",P=(A||"function"!=typeof r.constructor?"":r.constructor.name?r.constructor.name+" ":"")+(w||O?"["+[].concat(w||[],O||[]).join(": ")+"] ":"");return 0===S.length?P+"{}":c?P+"{"+Pt(S,c)+"}":P+"{ "+S.join(", ")+" }"}return String(r)};function lt(t,r,e){var n="double"===(e.quoteStyle||r)?'"':"'";return n+t+n}function st(t){return String(t).replace(/"/g,""")}function dt(t){return!("[object Array]"!==gt(t)||yt&&"object"==typeof t&&yt in t)}function vt(t){if(it)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!ot)return!1;try{return ot.call(t),!0}catch(t){}return!1}var bt=Object.prototype.hasOwnProperty||function(t){return t in this};function ht(t,r){return bt.call(t,r)}function gt(t){return Y.call(t)}function mt(t,r){if(t.indexOf)return t.indexOf(r);for(var e=0,n=t.length;er.maxStringLength){var e=t.length-r.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return jt(t.slice(0,r.maxStringLength),r)+n}return lt(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,St),"single",r)}function St(t){var r=t.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return e?"\\"+e:"\\x"+(r<16?"0":"")+r.toString(16).toUpperCase()}function At(t){return"Object("+t+")"}function Ot(t){return t+" { ? }"}function wt(t,r,e,n){return t+" ("+r+") {"+(n?Pt(e,n):e.join(", "))+"}"}function Pt(t,r){if(0===t.length)return"";var e="\n"+r.prev+r.base;return e+t.join(","+e)+"\n"+r.prev}function Et(t,r){var e=dt(t),n=[];if(e){n.length=t.length;for(var o=0;o1;){var r=t.pop(),e=r.obj[r.prop];if(_t(e)){for(var n=[],o=0;o=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||o===$t.RFC1738&&(40===a||41===a)?u+=i.charAt(f):a<128?u+=qt[a]:a<2048?u+=qt[192|a>>6]+qt[128|63&a]:a<55296||a>=57344?u+=qt[224|a>>12]+qt[128|a>>6&63]+qt[128|63&a]:(a=65536+((1023&a)<<10|1023&i.charCodeAt(f+=1)),u+=qt[240|a>>18]+qt[128|a>>12&63]+qt[128|a>>6&63]+qt[128|63&a])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if(_t(t)){for(var e=[],n=0;n0?h.join(",")||null:void 0}];else if(Ht(f))g=f;else{var j=Object.keys(h);g=a?j.sort(a):j}for(var S=0;S-1?t.split(","):t},ur=function(t,r,e,n){if(t){var o=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,u=e.depth>0&&/(\[[^[\]]*])/.exec(o),f=u?o.slice(0,u.index):o,a=[];if(f){if(!e.plainObjects&&rr.call(Object.prototype,f)&&!e.allowPrototypes)return;a.push(f)}for(var c=0;e.depth>0&&null!==(u=i.exec(o))&&c=0;--i){var u,f=t[i];if("[]"===f&&e.parseArrays)u=[].concat(o);else{u=e.plainObjects?Object.create(null):{};var a="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,c=parseInt(a,10);e.parseArrays||""!==a?!isNaN(c)&&f!==a&&String(c)===a&&c>=0&&e.parseArrays&&c<=e.arrayLimit?(u=[])[c]=o:u[a]=o:u={0:o}}o=u}return o}(a,r,e,n)}},fr=function(){function t(t,r,e){var n;this.name=t,this.definition=r,this.bindings=null!=(n=r.bindings)?n:{},this.config=e}var e=t.prototype;return e.matchesUrl=function(t){if(!this.definition.methods.includes("GET"))return!1;var r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+r+"$").test(t.replace(/\/+$/,"").split("?").shift())},e.compile=function(t){var r=this;return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,function(e,n){var o;if([null,void 0].includes(t[n])&&r.parameterSegments.find(function(t){return t.name===n}).required)throw new Error("Ziggy error: '"+n+"' parameter is required for route '"+r.name+"'.");return encodeURIComponent(null!=(o=t[n])?o:"")}).replace(/\/+$/,""):this.template},r(t,[{key:"template",get:function(){return((this.config.absolute?this.definition.domain?""+this.config.url.match(/^\w+:\/\//)[0]+this.definition.domain+(this.config.port?":"+this.config.port:""):this.config.url:"")+"/"+this.definition.uri).replace(/\/+$/,"")}},{key:"parameterSegments",get:function(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(function(t){return{name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)}}))?t:[]}}]),t}(),ar=function(t){var n,i;function u(r,n,o,i){var u;if(void 0===o&&(o=!0),(u=t.call(this)||this).t=null!=i?i:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,u.t=e({},u.t,{absolute:o}),r){if(!u.t.routes[r])throw new Error("Ziggy error: route '"+r+"' is not in the route list.");u.i=new fr(r,u.t.routes[r],u.t),u.u=u.p(n)}return u}i=t,(n=u).prototype=Object.create(i.prototype),n.prototype.constructor=n,o(n,i);var f=u.prototype;return f.toString=function(){var t=this,r=Object.keys(this.u).filter(function(r){return!t.i.parameterSegments.some(function(t){return t.name===r})}).filter(function(t){return"_query"!==t}).reduce(function(r,n){var o;return e({},r,((o={})[n]=t.u[n],o))},{});return this.i.compile(this.u)+function(t,r){var e,n=t,o=function(t){if(!t)return Yt;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||Yt.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=$t.default;if(void 0!==t.format){if(!Jt.call($t.formatters,t.format))throw new TypeError("Unknown format option provided.");e=t.format}var n=$t.formatters[e],o=Yt.filter;return("function"==typeof t.filter||Ht(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:Yt.addQueryPrefix,allowDots:void 0===t.allowDots?Yt.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Yt.charsetSentinel,delimiter:void 0===t.delimiter?Yt.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:Yt.encode,encoder:"function"==typeof t.encoder?t.encoder:Yt.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:Yt.encodeValuesOnly,filter:o,format:e,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:Yt.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:Yt.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Yt.strictNullHandling}}(r);"function"==typeof o.filter?n=(0,o.filter)("",n):Ht(o.filter)&&(e=o.filter);var i=[];if("object"!=typeof n||null===n)return"";var u=Lt[r&&r.arrayFormat in Lt?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];e||(e=Object.keys(n)),o.sort&&e.sort(o.sort);for(var f=Tt(),a=0;a0?p+y:""}(e({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:function(t,r){return"boolean"==typeof t?Number(t):r(t)}})},f.current=function(t,r){var e=this,n=this.t.absolute?this.l().host+this.l().pathname:this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),o=Object.entries(this.t.routes).find(function(r){return new fr(t,r[1],e.t).matchesUrl(n)})||[void 0,void 0],i=o[0],u=o[1];if(!t)return i;var f=new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(i);if([null,void 0].includes(r)||!f)return f;var a=new fr(i,u,this.t);r=this.p(r,a);var c=this.v(u);return!(!Object.values(r).every(function(t){return!t})||Object.values(c).length)||Object.entries(r).every(function(t){return c[t[0]]==t[1]})},f.l=function(){var t,r,e,n,o,i,u="undefined"!=typeof window?window.location:{},f=u.host,a=u.pathname,c=u.search;return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:void 0===f?"":f,pathname:null!=(e=null==(n=this.t.location)?void 0:n.pathname)?e:void 0===a?"":a,search:null!=(o=null==(i=this.t.location)?void 0:i.search)?o:void 0===c?"":c}},f.has=function(t){return Object.keys(this.t.routes).includes(t)},f.p=function(t,r){var n=this;void 0===t&&(t={}),void 0===r&&(r=this.i),t=["string","number"].includes(typeof t)?[t]:t;var o=r.parameterSegments.filter(function(t){return!n.t.defaults[t.name]});if(Array.isArray(t))t=t.reduce(function(t,r,n){var i,u;return e({},t,o[n]?((i={})[o[n].name]=r,i):((u={})[r]="",u))},{});else if(1===o.length&&!t[o[0].name]&&(t.hasOwnProperty(Object.values(r.bindings)[0])||t.hasOwnProperty("id"))){var i;(i={})[o[0].name]=t,t=i}return e({},this.h(r),this.g(t,r))},f.h=function(t){var r=this;return t.parameterSegments.filter(function(t){return r.t.defaults[t.name]}).reduce(function(t,n,o){var i,u=n.name;return e({},t,((i={})[u]=r.t.defaults[u],i))},{})},f.g=function(t,r){var n=r.bindings,o=r.parameterSegments;return Object.entries(t).reduce(function(t,r){var i,u,f=r[0],a=r[1];if(!a||"object"!=typeof a||Array.isArray(a)||!o.some(function(t){return t.name===f}))return e({},t,((u={})[f]=a,u));if(!a.hasOwnProperty(n[f])){if(!a.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+f+"' parameter is missing route model binding key '"+n[f]+"'.");n[f]="id"}return e({},t,((i={})[f]=a[n[f]],i))},{})},f.v=function(t){var r,n=this.l().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,""),o=function(t,r,n){void 0===r&&(r="");var o=[t,r].map(function(t){return t.split(n)}),i=o[0];return o[1].reduce(function(t,r,n){var o;return/{[^}?]+\??}/.test(r)&&i[n]?e({},t,((o={})[r.replace(/.*{|\??}.*/g,"")]=i[n].replace(r.match(/^[^{]*/g),"").replace(r.match(/[^}]*$/g),""),o)):t},{})};return e({},o(this.l().host,t.domain,"."),o(n,t.uri,"/"),function(t,r){var e=nr;if(""===t||null==t)return e.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,r){var e,n={},o=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),i=-1,u=r.charset;if(r.charsetSentinel)for(e=0;e-1&&(a=er(a)?[a]:a),n[f]=rr.call(n,f)?zt.combine(n[f],a):a}return n}(t,e):t,o=e.plainObjects?Object.create(null):{},i=Object.keys(n),u=0;u1;){var r=t.pop(),n=r.obj[r.prop];if(v(n)){for(var e=[],i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===l.RFC1738&&(40===c||41===c)?u+=o.charAt(f):c<128?u+=p[c]:c<2048?u+=p[192|c>>6]+p[128|63&c]:c<55296||c>=57344?u+=p[224|c>>12]+p[128|c>>6&63]+p[128|63&c]:(c=65536+((1023&c)<<10|1023&o.charCodeAt(f+=1)),u+=p[240|c>>18]+p[128|c>>12&63]+p[128|c>>6&63]+p[128|63&c])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,r){if(v(t)){for(var n=[],e=0;e0?b.join(",")||null:void 0}];else if(g(f))k=f;else{var C=Object.keys(b);k=c?C.sort(c):C}for(var F=0;F-1?t.split(","):t},T=function(t,r,n,e){if(t){var i=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,u=n.depth>0&&/(\[[^[\]]*])/.exec(i),f=u?i.slice(0,u.index):i,c=[];if(f){if(!n.plainObjects&&k.call(Object.prototype,f)&&!n.allowPrototypes)return;c.push(f)}for(var a=0;n.depth>0&&null!==(u=o.exec(i))&&a=0;--o){var u,f=t[o];if("[]"===f&&n.parseArrays)u=[].concat(i);else{u=n.plainObjects?Object.create(null):{};var c="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,a=parseInt(c,10);n.parseArrays||""!==c?!isNaN(a)&&f!==c&&String(a)===c&&a>=0&&n.parseArrays&&a<=n.arrayLimit?(u=[])[a]=i:"__proto__"!==c&&(u[c]=i):u={0:i}}i=u}return i}(c,r,n,e)}},D=/*#__PURE__*/function(){function t(t,r,n){var e,i;this.name=t,this.definition=r,this.bindings=null!=(e=r.bindings)?e:{},this.wheres=null!=(i=r.wheres)?i:{},this.config=n}var n=t.prototype;return n.matchesUrl=function(t){if(!this.definition.methods.includes("GET"))return!1;var r=this.template.replace(/\/{[^}?]*\?}/g,"(/[^/?]+)?").replace(/{[^}?]*\?}/g,"([^/?]+)?").replace(/{[^}]+}/g,"[^/?]+").replace(/^\w+:\/\//,"");return new RegExp("^"+r+"$").test(t.replace(/\/+$/,"").split("?").shift())},n.compile=function(t){var r=this;return this.parameterSegments.length?this.template.replace(/{([^}?]+)\??}/g,function(n,e){var i,o;if([null,void 0].includes(t[e])&&r.parameterSegments.find(function(t){return t.name===e}).required)throw new Error("Ziggy error: '"+e+"' parameter is required for route '"+r.name+"'.");return r.parameterSegments[r.parameterSegments.length-1].name===e&&".*"===r.wheres[e]?null!=(o=t[e])?o:"":encodeURIComponent(null!=(i=t[e])?i:"")}).replace(/\/+$/,""):this.template},r(t,[{key:"template",get:function(){return((this.config.absolute?this.definition.domain?""+this.config.url.match(/^\w+:\/\//)[0]+this.definition.domain+(this.config.port?":"+this.config.port:""):this.config.url:"")+"/"+this.definition.uri).replace(/\/+$/,"")}},{key:"parameterSegments",get:function(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(function(t){return{name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)}}))?t:[]}}]),t}(),$=/*#__PURE__*/function(t){var e,o;function u(r,e,i,o){var u;if(void 0===i&&(i=!0),(u=t.call(this)||this).t=null!=o?o:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,u.t=n({},u.t,{absolute:i}),r){if(!u.t.routes[r])throw new Error("Ziggy error: route '"+r+"' is not in the route list.");u.i=new D(r,u.t.routes[r],u.t),u.u=u.l(e)}return u}o=t,(e=u).prototype=Object.create(o.prototype),e.prototype.constructor=e,i(e,o);var f=u.prototype;return f.toString=function(){var t=this,r=Object.keys(this.u).filter(function(r){return!t.i.parameterSegments.some(function(t){return t.name===r})}).filter(function(t){return"_query"!==t}).reduce(function(r,e){var i;return n({},r,((i={})[e]=t.u[e],i))},{});return this.i.compile(this.u)+function(t,r){var n,e=t,i=function(t){if(!t)return E;if(null!=t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var r=t.charset||E.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=l.default;if(void 0!==t.format){if(!h.call(l.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var e=l.formatters[n],i=E.filter;return("function"==typeof t.filter||g(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:E.addQueryPrefix,allowDots:void 0===t.allowDots?E.allowDots:!!t.allowDots,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:E.charsetSentinel,delimiter:void 0===t.delimiter?E.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:E.encode,encoder:"function"==typeof t.encoder?t.encoder:E.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:E.encodeValuesOnly,filter:i,format:n,formatter:e,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:E.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:E.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:E.strictNullHandling}}(r);"function"==typeof i.filter?e=(0,i.filter)("",e):g(i.filter)&&(n=i.filter);var o=[];if("object"!=typeof e||null===e)return"";var u=b[r&&r.arrayFormat in b?r.arrayFormat:r&&"indices"in r?r.indices?"indices":"repeat":"indices"];n||(n=Object.keys(e)),i.sort&&n.sort(i.sort);for(var f=0;f0?s+a:""}(n({},r,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:function(t,r){return"boolean"==typeof t?Number(t):r(t)}})},f.current=function(t,r){var n=this,e=this.t.absolute?this.v().host+this.v().pathname:this.v().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"),i=Object.entries(this.t.routes).find(function(r){return new D(t,r[1],n.t).matchesUrl(e)})||[void 0,void 0],o=i[0],u=i[1];if(!t)return o;var f=new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(o);if([null,void 0].includes(r)||!f)return f;var c=new D(o,u,this.t);r=this.l(r,c);var a=this.p(u);return!(!Object.values(r).every(function(t){return!t})||Object.values(a).length)||Object.entries(r).every(function(t){return a[t[0]]==t[1]})},f.v=function(){var t,r,n,e,i,o,u="undefined"!=typeof window?window.location:{},f=u.host,c=u.pathname,a=u.search;return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:void 0===f?"":f,pathname:null!=(n=null==(e=this.t.location)?void 0:e.pathname)?n:void 0===c?"":c,search:null!=(i=null==(o=this.t.location)?void 0:o.search)?i:void 0===a?"":a}},f.has=function(t){return Object.keys(this.t.routes).includes(t)},f.l=function(t,r){var e=this;void 0===t&&(t={}),void 0===r&&(r=this.i),t=["string","number"].includes(typeof t)?[t]:t;var i=r.parameterSegments.filter(function(t){return!e.t.defaults[t.name]});if(Array.isArray(t))t=t.reduce(function(t,r,e){var o,u;return n({},t,i[e]?((o={})[i[e].name]=r,o):((u={})[r]="",u))},{});else if(1===i.length&&!t[i[0].name]&&(t.hasOwnProperty(Object.values(r.bindings)[0])||t.hasOwnProperty("id"))){var o;(o={})[i[0].name]=t,t=o}return n({},this.h(r),this.g(t,r))},f.h=function(t){var r=this;return t.parameterSegments.filter(function(t){return r.t.defaults[t.name]}).reduce(function(t,e,i){var o,u=e.name;return n({},t,((o={})[u]=r.t.defaults[u],o))},{})},f.g=function(t,r){var e=r.bindings,i=r.parameterSegments;return Object.entries(t).reduce(function(t,r){var o,u,f=r[0],c=r[1];if(!c||"object"!=typeof c||Array.isArray(c)||!i.some(function(t){return t.name===f}))return n({},t,((u={})[f]=c,u));if(!c.hasOwnProperty(e[f])){if(!c.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+f+"' parameter is missing route model binding key '"+e[f]+"'.");e[f]="id"}return n({},t,((o={})[f]=c[e[f]],o))},{})},f.p=function(t){var r,e=this.v().pathname.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,""),i=function(t,r,e){void 0===r&&(r="");var i=[t,r].map(function(t){return t.split(e)}),o=i[0];return i[1].reduce(function(t,r,e){var i;return/{[^}?]+\??}/.test(r)&&o[e]?n({},t,((i={})[r.replace(/.*{|\??}.*/g,"")]=o[e].replace(r.match(/^[^{]*/g),"").replace(r.match(/[^}]*$/g),""),i)):t},{})};return n({},i(this.v().host,t.domain,"."),i(e,t.uri,"/"),function(t,r){var n=C;if(""===t||null==t)return n.plainObjects?Object.create(null):{};for(var e="string"==typeof t?function(t,r){var n,e={},i=(r.ignoreQueryPrefix?t.replace(/^\?/,""):t).split(r.delimiter,Infinity===r.parameterLimit?void 0:r.parameterLimit),o=-1,u=r.charset;if(r.charsetSentinel)for(n=0;n-1&&(c=x(c)?[c]:c),e[f]=k.call(e,f)?y.combine(e[f],c):c}return e}(t,n):t,i=n.plainObjects?Object.create(null):{},o=Object.keys(e),u=0;u