1/*! For license information please see 6506.63820a10f342a0fda0be.js.LICENSE.txt */ 2"use strict";(self.webpackChunk_vkmedia_services_frontrobot=self.webpackChunk_vkmedia_services_frontrobot||[]).push([[6506,7263],{56506(t,r,e){e.r(r),e.d(r,{Section:()=>B,default:()=>N});var n=e(77810),o=e(64965),i=e(85715),u=e(11734),a=e(88550),s=e(38020),c=e(38764),l=e(41016),f=e(55180),y=e(51311),d=e(73344),b=e(75857),p=e(99743),h=e(80773),m=e(30146),v=e(56902),g=e(72630),O=e(55822),j=e(55323),A=e(64922),S=function(t){var r=t.loading,e=t.error,n=t.data,o=t.layout,i=t.pagination,u=t.showStickyAds;return e?(0,A.jsx)(g.M,{errorCode:e.status}):(0,A.jsxs)(A.Fragment,{children:[!r&&0===n.result.includedHits&&(0,A.jsx)(O.D,{}),(0,A.jsx)(j.Y,{layout:o,data:r?void 0:n.result,pagination:i,showStickyAd:u})]})};S.displayName="PageLoader";var w=e(37035),C=e(15751),k=e(17493),P=e(46256),E=e(18495),I=e(40442),M=e(38765);function F(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,u,a=[],s=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;s=!1}else for(;!(s=(n=i.call(e)).done)&&(a.push(n.value),a.length!==r);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(t,r)||function(t,r){if(t){if("string"==typeof t)return R(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?R(t,r):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var T=function(t,r){var e,n,o,i=function(t){if((null==t?void 0:t.type)===a.l.ConceptQuery){var r=[E.q[k.V.Kronika],E.q[k.V.Ledare]],e=t.query.queryItems[0].ids,n=e.find(function(t){return r.includes(t)});return[e.find(function(t){return!r.includes(t)}),n]}return(null==t?void 0:t.type)===a.l.CategoryBySlug?[t.query,void 0]:[void 0,void 0]}(r.articleQuery),u=F(i,2),s=u[0],c=u[1],l=!!s&&function(t){return t.includes("Arkiv")||t.includes("Kategori")}(t),f=(0,M.h)({concepts:[s],enabled:l}),y=f.concepts,d=f.loading,b=f.error,p=(0,P.z)((0,I.getBylineDisplayName)(null==y||null===(e=y[0])||void 0===e?void 0:e.name),null==y||null===(n=y[0])||void 0===n?void 0:n.uuid,c,null==y||null===(o=y[0])||void 0===o?void 0:o.imType);return l&&!b&&(d||null!=y&&y[0])?p:t},x=e(84870),L=e(9096);function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function q(t,r,e){return(r=function(t){var r=function(t,r){if("object"!=Q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=Q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==Q(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var D=q(q({},u.OD.Desktop,l.applyModifiersDesktop),u.OD.Mobile,f.applyModifiersMobile)[m.iD],_={desktop:[],mobile:[],name:"empty"},B=function(t){var r,e=t.layouts,u=t.articleQuery,l=t.theme,f=t.showStickyAds,g=void 0===f||f,O=(0,o.zy)().pathname,j=(0,o.W6)(),C=(0,p.M)(),k=Array.isArray(e)?e:[e],P=C.loaded?(0,b.getABTestItemByTombola)(k,C.value):_,E=P[m.iD],I=(0,n.useMemo)(function(){var t=D(E);return(0,d.prepareLayout)(t)},[E]),M=u.type===a.l.OCList?void 0:(0,y.getNumberOfArticlesFromLayout)(E),F=function(t,r,e,n){if(t.disablePagination||t.type===a.l.OCList)return{pageNumber:void 0,pagination:void 0};var o=new URLSearchParams(location.search).get("page"),u=(0,i.r)(o);return{pageNumber:u,pagination:{onChangePage:function(t){r.push("".concat(e,"?page=").concat(t+1))},page:u,limit:n}}}(u,j,O,M),R=F.pageNumber,T=F.pagination,x=(0,s.U)({articleQuery:u,page:R,limit:M}),L=x.loading,Q=x.error,q=x.data,B=(0,n.useMemo)(function(){var t;return null!=q&&null!==(t=q.result)&&void 0!==t&&t.hits?q.result.hits.map(function(t){return t.uuid}):[]},[null==q||null===(r=q.result)||void 0===r?void 0:r.hits]),N=(0,c.P)({discussionIds:B,enabled:!!h.xs}),U=N.counts,G=N.loading,H=(0,n.useMemo)(function(){return{counts:U,loading:G}},[U,G]);return(0,A.jsx)(w.N,{theme:l,children:(0,A.jsx)(v.n.Provider,{value:H,children:(0,A.jsx)(S,{loading:L,error:Q,data:q,layout:{name:P.name,items:I},showStickyAds:g,pagination:T})})})};const N=B;B.Layout=function(t){var r=t.data,e=t.title,n=t.children,o=T(e,r);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(x.l.Title,{children:(0,A.jsx)(L.G,{title:o})}),(0,A.jsx)(C.C,{children:n})]})}},38764(t,r,e){e.d(r,{P:()=>A,o:()=>j});var n=e(82610),o=e(27250),i=e(80933),u=e(77810),a=e(87263),s=e(80773);function c(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,u,a=[],s=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;s=!1}else for(;!(s=(n=i.call(e)).done)&&(a.push(n.value),a.length!==r);s=!0);}catch(t){c=!0,o=t}
2finally{try{if(!s&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(t,r)||f(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||f(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,r){if(t){if("string"==typeof t)return y(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?y(t,r):void 0}}function y(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function d(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return b(c,"_invoke",function(e,n,o){var i,a,s,c=0,l=o||[],f=!1,y={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(r,e){return i=r,a=0,s=t,y.n=e,u}};function d(e,n){for(a=e,s=n,r=0;!f&&c&&!o&&r<l.length;r++){var o,i=l[r],d=y.p,b=i[2];e>3?(o=b===n)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=e<2&&d<i[1])?(a=0,y.v=n,y.n=i[1]):d<b&&(o=e<3||i[0]>n||n>b)&&(i[4]=e,i[5]=n,y.n=b,a=0))}if(o||e>1)return u;throw f=!0,n}return function(o,l,b){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,b),a=l,s=b;(r=a<2?t:s)||!f;){i||(a?a<3?(a>1&&(y.n=-1),d(a,s)):y.n=s:y.v=s);try{if(c=2,i){if(a||(o="next"),r=i[o]){if(!(r=r.call(i,s)))throw TypeError("iterator result is not an object");if(!r.done)return r;s=r.value,a<2&&(a=0)}else 1===a&&(r=i.return)&&r.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((r=(f=y.n<0)?s:e.call(n,y))!==u)break}catch(r){i=t,a=1,s=r}finally{c=1}}return{value:r,done:f}}}(e,o,i),!0),c}var u={};function a(){}function s(){}function c(){}r=Object.getPrototypeOf;var l=[][n]?r(r([][n]())):(b(r={},n,function(){return this}),r),f=c.prototype=a.prototype=Object.create(l);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,b(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return s.prototype=c,b(f,"constructor",c),b(c,"constructor",s),s.displayName="GeneratorFunction",b(c,o,"GeneratorFunction"),b(f),b(f,o,"Generator"),b(f,n,function(){return this}),b(f,"toString",function(){return"[object Generator]"}),(d=function(){return{w:i,m:y}})()}function b(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}b=function(t,r,e,n){function i(r,e){b(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},b(t,r,e,n)}function p(t,r,e,n,o,i,u){try{var a=t[i](u),s=a.value}catch(t){return void e(t)}a.done?r(s):Promise.resolve(s).then(n,o)}function h(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function u(t){p(i,n,o,u,a,"next",t)}function a(t){p(i,n,o,u,a,"throw",t)}u(void 0)})}}var m=18e5,v=function(){var t=h(d().m(function t(r){var e;return d().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,fetch("".concat(s.Oj,"/counts/commentaries/").concat(s.xs,"/batch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({discussion_ids:r})});case 1:if((e=t.v).ok){t.n=2;break}throw new Error("Failed to fetch comment counts: ".concat(e.statusText));case 2:return t.a(2,e.json())}},t)}));return function(r){return t.apply(this,arguments)}}(),g=function(t){return["commentCount",t]},O=function(){var t=h(d().m(function t(r){var e,n;return d().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,fetch("".concat(s.Oj,"/counts/commentaries/").concat(s.xs,"/").concat(r,"/counter.json"));case 1:if((e=t.v).ok){t.n=2;break}throw new Error("Failed to fetch comment count: ".concat(e.statusText));case 2:return t.n=3,e.json();case 3:return n=t.v,t.a(2,null==n?void 0:n[r])}},t)}));return function(r){return t.apply(this,arguments)}}(),j=function(t){var r=(0,o.I)({queryKey:g(null!=t?t:""),queryFn:function(){return O(t)},staleTime:m,gcTime:m,enabled:!!t});return{count:r.data,loading:r.isLoading}}
2,A=function(t){var r=t.discussionIds,e=t.enabled,o=void 0===e||e,s=(0,i.jE)(),f=(0,u.useMemo)(function(){return r.filter(function(t){return t&&t.length>0})},[r]),y=(0,u.useMemo)(function(){return(0,a.chunkArray)(f,50)},[f]),d=(0,n.E)({queries:y.map(function(t){return{queryKey:["commentCounts"].concat(l(t.sort())),queryFn:function(){return v(t)},staleTime:m,gcTime:m,enabled:o&&t.length>0}})});(0,u.useEffect)(function(){d.forEach(function(t){t.data&&Object.entries(t.data).forEach(function(t){var r=c(t,2),e=r[0],n=r[1];s.setQueryData(g(e),n,{updatedAt:Date.now()})})})},[d,s]);var b=d.some(function(t){return t.isLoading});return{counts:(0,u.useMemo)(function(){var t=new Map;return d.forEach(function(r){r.data&&Object.entries(r.data).forEach(function(r){var e=c(r,2),n=e[0],o=e[1];t.set(n,o)})}),t},[d]),loading:b}}},87263(t,r,e){e.r(r),e.d(r,{chunkArray:()=>n});var n=function(t,r){for(var e=[],n=0;n<t.length;n+=r)e.push(t.slice(n,n+r));return e}},41016(t,r,e){e.r(r),e.d(r,{applyModifiersDesktop:()=>b});var n=e(81659),o=e(26015);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function u(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,u,a=[],s=!0,c=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;s=!1}else for(;!(s=(n=i.call(e)).done)&&(a.push(n.value),a.length!==r);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(t,r)||s(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||s(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,r){if(t){if("string"==typeof t)return c(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?c(t,r):void 0}}function c(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function l(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function f(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?l(Object(e),!0).forEach(function(r){y(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):l(Object(e)).forEac
2h(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function y(t,r,e){return(r=function(t){var r=function(t,r){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==i(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var d=function(t,r){var e=t.reduce(function(t,r){var e=t.layout,i=t.articleCount,u=t.blockArticleCount;if(!(0,o.isArticleLayout)(r))return{layout:[].concat(a(e),[r]),articleCount:i,blockArticleCount:u};var s=function(t,r){var e=0===t;return{isFirstArticle:e,isSecondArticle:1===t,isFirstInBlock:0===r&&!e}}(i,u),c=function(t,r){var e=r.isFirstArticle,o=r.isSecondArticle,i=r.isFirstInBlock;return e?f(f({},t),{},{modifier:n.W.Lead}):o||i?f(f({},t),{},{modifier:n.W.First}):t}(r,{isFirstArticle:s.isFirstArticle,isSecondArticle:s.isSecondArticle,isFirstInBlock:s.isFirstInBlock});return{layout:[].concat(a(e),[c]),articleCount:i+1,blockArticleCount:u+1}},{layout:[],articleCount:r,blockArticleCount:0});return{layout:e.layout,articleCount:e.articleCount}},b=function(t){return t.reduce(function(t,r){var e=t.layout,n=t.articleCount;if(!(0,o.isBlockLayout)(r))return{layout:[].concat(a(e),[r]),articleCount:n};var i=u(r.blockLayout,2),s=i[0],c=i[1],l=d(s,n),y=[l.layout,c];return{layout:[].concat(a(e),[f(f({},r),{},{blockLayout:y})]),articleCount:l.articleCount}},{layout:[],articleCount:0}).layout}},55180(t,r,e){e.r(r),e.d(r,{applyModifiersMobile:()=>f});var n=e(81659),o=e(26015);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function u(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(t){if("string"==typeof t)return a(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?a(t,r):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function s(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function c(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?s(Object(e),!0).forEach(function(r){l(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):s(Object(e)).forEac
2h(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function l(t,r,e){return(r=function(t){var r=function(t,r){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==i(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var f=function(t){return t.reduce(function(t,r){var e=t.layout,i=t.articleCount,a=t.previousItem;if(!(0,o.isArticleLayout)(r))return{layout:[].concat(u(e),[r]),articleCount:i,previousItem:r};var s=function(t,r){return{isFirstArticle:0===t,isFirstArticleAfterAd:!!r&&(0,o.isPanoramaAdLayout)(r)}}(i,a),l=function(t,r){var e=r.isFirstArticle,o=r.isFirstArticleAfterAd;return e?c(c({},t),{},{modifier:n.W.Lead}):o?c(c({},t),{},{modifier:n.W.First}):t}(r,{isFirstArticle:s.isFirstArticle,isFirstArticleAfterAd:s.isFirstArticleAfterAd});return{layout:[].concat(u(e),[l]),articleCount:i+1,previousItem:l}},{layout:[],articleCount:0,previousItem:void 0}).layout}},26015(t,r,e){e.r(r),e.d(r,{isArticleLayout:()=>o,isBlockLayout:()=>u,isPanoramaAdLayout:()=>i});var n=e(88682),o=function(t){return t.type===n.p.Article},i=function(t){return t.type===n.p.PanoramaAd},u=function(t){return t.type===n.p.Block}},82610(t,r,e){e.d(r,{E:()=>p});var n=e(77810),o=e(10049),i=e(20671),u=e(21664),a=e(47396);function s(t,r){const e=new Set(r);return t.filter(t=>!e.has(t))}var c=class extends u.Q{#t;#r;#e;#n;#o;#i;#u;#a;#s;#c=[];constructor(t,r,e){super(),this.#t=t,this.#n=e,this.#e=[],this.#o=[],this.#r=[],this.setQueries(r)}onSubscribe(){1===this.listeners.size&&this.#o.forEach(t=>{t.subscribe(r=>{this.#l(t,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#o.forEach(t=>{t.destroy()})}setQueries(t,r){this.#e=t,this.#n=r,o.jG.batch(()=>{const t=this.#o,r=this.#f(this.#e);r.forEach(t=>t.observer.setOptions(t.defaultedQueryOptions));const e=r.map(t=>t.observer),n=e.map(t=>t.getCurrentResult()),o=t.length!==e.length,i=e.some((r,e)=>r!==t[e]),u=o||i,c=!!u||n.some((t,r)=>{const e=this.#r[r];return!e||!(0,a.f8)(t,e)});(u||c)&&(u&&(this.#c=r,this.#o=e),this.#r=n,this.hasListeners()&&(u&&(s(t,e).forEach(t=>{t.destroy()}),s(e,t).forEach(t=>{t.subscribe(r=>{this.#l(t,r)})})),this.#y()))})}getCurrentResult(){return this.#r}getQueries(){return this.#o.map(t=>t.getCurrentQuery())}getObservers(){return this.#o}getOptimisticResult(t,r){const e=this.#f(t),n=e.map(t=>t.observer.getOptimisticResult(t.defaultedQueryOptions)),o=e.map(t=>t.defaultedQueryOptions.queryHash);return[n,t=>this.#d(t??n,r,o),()=>this.#b(n,e)]}#b(t,r){return r.map((e,n)=>{const o=t[n];return e.defaultedQueryOptions.notifyOnChangeProps?o:e.observer.trackResult(o,t=>{r.forEach(r=>{r.observer.trackProp(t)})})})}#d(t,r,e){if(r){const n=this.#s,o=void 0!==e&&void 0!==n&&(n.length!==e.length||e.some((t,r)=>t!==n[r]));return this.#i&&this.#r===this.#a&&!o&&r===this.#u||(this.#u=r,this.#a=this.#r,void 0!==e&&(this.#s=e),this.#i=(0,a.BH)(this.#i,r(t))),this.#i}return t}#f(t){const r=new Map;this.#o.forEach(t=>{const e=t.options.queryHash;if(!e)return;const n=r.get(e);n?n.push(t):r.set(e,[t])});const e=[];return t.forEach(t=>{const n=this.#t.defaultQueryOptions(t),o=r.get(n.queryHash)?.shift(),u=o??new i.$(this.#t,n);e.push({defaultedQueryOptions:n,observer:u})}),e}#l(t,r){const e=this.#o.indexOf(t);-1!==e&&(this.#r=function(t,r,e){const n=t.slice(0);return n[r]=e,n}(this.#r,e,r),this.#y())}#y(){if(this.hasListeners()){const t=this.#i,r=this.#b(this.#r,this.#c);t!==this.#d(r,this.#n?.combine)&&o.jG.batch(()=>{this.listeners.forEach(t=>{t(this.#r)})})}}},l=e(80933),f=e(65395),y=e(73276),d=e(24770),b=e(18227);function p({queries:t,...r},e){const u=(0,l.jE)(e),s=(0,f.w)(),p=(0,y.h)(),h=n.useMemo(()=>t.map(t=>{const r=u.defaultQueryOptions(t);return r._optimisticResults=s?"isRestoring":"optimistic",r}),[t,u,s]);h.forEach(t=>{(0,b.jv)(t);const r=u.getQueryCache().get(t.queryHash);(0,d.LJ)(t,p,r)}),(0,d.wZ)(p);const[m]=n.useState(()=>new c(u,h,r)),[v,g,O]=m.getOptimisticResult(h,r.combine),j=!s&&!1!==r.subscribed;n.useSyncExternalStore(n.useCallback(t=>j?m.subscribe(o.jG.batchCalls(t)):a.lQ,[m,j]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),n.useEffect(()=>{m.setQueries(h,r)},[h,r,m]);const A=v.some((t,r)=>(0,b.EU)(h[r],t))?v.flatMap((t,r)=>{const e=h[r];if(e&&(0,b.EU)(e,t)){const t=new i.$(u,e);return(0,b.iL)(e,t,p)}return[]}):[];if(A.length>0)throw Promise.all(A);const S=v.find((t,r)=>{const e=h[r];return e&&(0,d.$1)({result:t,errorResetBoundary:p,throwOnError:e.throwOnError,query:u.getQueryCache().get(e.queryHash),suspense:e.suspense})});if(S?.error)throw S.error;return g(O())}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.