!function(){"use strict";var e={d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{onSubKey:function(){return n},useApiFetch:function(){return s}});var n=e=>t=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;const r=o[e];if(void 0===r)return n;const a=t(n[r],o);return a===n[r]?n:{...n,[r]:a}},o=window.React,r=window.nisje.app.fetch;const a=e=>e.json?e.json():Promise.reject(e);var s=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[s,i]=(0,o.useState)(),[c,u]=(0,o.useState)({}),[d,l]=(0,o.useState)();return(0,o.useEffect)((()=>{(s||d)&&(l(void 0),i(void 0));const o=t=(async()=>{if(n.fetchHeaders){const t=await(0,r.apiFetch)({path:e,parse:!1}),n={};return n.totalPages=parseInt(t.headers.get("X-WP-TotalPages"),10),n.total=parseInt(t.headers.get("X-WP-Total"),10),{response:await a(t),responseHeaders:n}}return{response:await(0,r.apiFetch)({path:e})}})().then((e=>{let{response:r,responseHeaders:a}=e;o===t&&(n.callback&&n.callback(r),u(a),i(r))})).catch((e=>{l(e)}));return()=>{t=void 0}}),[e]),n.fetchHeaders?[s,c,d]:[s,d]};(window.nisje=window.nisje||{}).data=t}();