var j=Symbol("cache-parser");function S(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,f=new Array(r);t<r;t++)f[t]=e[t];return f}function l(e){return(typeof e=="string"||typeof e=="number")&&(e=Number(e))>=0&&e<1/0}function n(e){return e===!0||typeof e=="number"||typeof e=="string"&&e!=="false"}var s=Number;function O(e){var r=Object.defineProperty({},j,{enumerable:!1,value:1});if(!e||typeof e!="string")return r;var t=function(I){for(var v,b={},w=function(a,C){var u=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(u)return(u=u.call(a)).next.bind(u);if(Array.isArray(a)||(u=function(o,A){if(o){if(typeof o=="string")return S(o,A);var i=Object.prototype.toString.call(o).slice(8,-1);return i==="Object"&&o.constructor&&(i=o.constructor.name),i==="Map"||i==="Set"?Array.from(o):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?S(o,A):void 0}}(a))){u&&(a=u);var x=0;return function(){return x>=a.length?{done:!0}:{done:!1,value:a[x++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}(I.toLowerCase().replace(/\s+/g,"").split(","));!(v=w()).done;){var h,g=v.value.split("=",2);b[g[0]]=(h=g[1])==null||h}return b}(e),f=t["max-age"],m=t["max-stale"],c=t["min-fresh"],p=t["s-maxage"],y=t["stale-if-error"],d=t["stale-while-revalidate"];return n(t.immutable)&&(r.immutable=!0),l(f)&&(r.maxAge=s(f)),l(m)&&(r.maxStale=s(m)),l(c)&&(r.minFresh=s(c)),n(t["must-revalidate"])&&(r.mustRevalidate=!0),n(t["must-understand"])&&(r.mustUnderstand=!0),n(t["no-cache"])&&(r.noCache=!0),n(t["no-store"])&&(r.noStore=!0),n(t["no-transform"])&&(r.noTransform=!0),n(t["only-if-cached"])&&(r.onlyIfCached=!0),n(t.private)&&(r.private=!0),n(t["proxy-revalidate"])&&(r.proxyRevalidate=!0),n(t.public)&&(r.public=!0),l(p)&&(r.sMaxAge=s(p)),l(y)&&(r.staleIfError=s(y)),l(d)&&(r.staleWhileRevalidate=s(d)),r}export{O as o};
