1import{t as b,v as D,w as A,z as M,B as k,K as x,C as y,E as L}from"./esnext-vendor.B9Da21W6.js";import{M as _,a as E,b as R,R as O,N as h,c as U,d as w,e as S}from"./extensions-remote-dom.MLww-Mka.js";function K(n,a){const r=new Map;function c(o){for(const e of o){const[s,t]=e;switch(s){case _:{const i=e[2],f=e[3];u(t,i,f);break}case E:{const i=e[2];I(t,i);break}}}n.mutate(o)}function u(o,e,s){if(r.has(o)||r.set(o,[]),r.get(o).splice(s,0,{id:e.id,slot:"attributes"in e?e.attributes?.slot:void 0}),"children"in e&&e.children)for(const[i,f]of e.children.entries())u(e.id,f,i)}function I(o,e){const s=r.get(o);if(!s?.[e])return;const t=s[e].id;s.splice(e,1),N(t)}function N(o){const e=r.get(o);if(e){for(const s of e)N(s.id);r.delete(o)}}return function(e,...s){switch(e){case k:{const[t]=s,i=t.map((f,d)=>[_,O,m(f,a),d]);c(i);break}case M:{const[t=O,i,f]=s,d=[],T=r.get(t);if(T){const p=T.findIndex(({id:l})=>l===f.id);p>=0&&d.push([E,t,p])}d.push([_,t,m(f,a),i]),c(d);break}case A:{const[t,i]=s;c([[E,t??O,i]]);break}case D:{const[t,i]=s;c([[w,t,i]]);break}case b:{const[t,i]=s,f=r.get(t),d=[];for(const[T,p]of Object.entries(i)){const l=f?.findIndex(({slot:C})=>C===T)??-1;g(p)?(l>=0&&d.push([E,t,l]),d.push([_,t,P(T,p,a),r.get(t)?.length??0])):l>=0?d.push([E,t,l]):d.push([R,t,T,p])}c(d);break}default:throw new Error(`Unsupported action type: ${e}`)}}}function m(n,a){switch(n.kind){case L:return Y(n);case y:return z(n,a);default:return{id:n.id,type:U,data:"added by remote-ui legacy adaptor to replace a fragment rendered as a child"}}}function Y({id:n,text:a}){return{id:n,type:S,data:a}}function z({id:n,type:a,props:r,children:c},u){const I=u?.elements?.[a]??a,[N,o]=v(r);return{id:n,type:h,element:I,properties:o,children:[...c.map(e=>m(e,u)),...F(N,u)]}}function v(n){const a={},r={};for(const[c,u]of Object.entries(n))g(u)?a[c]=u:r[c]=u;return[a,r]}function g(n){return n!=null&&typeof n=="object"&&"kind"in n&&n.kind===x}function F(n,a){return Object.entries(n).map(([r,c])=>P(r,c,a))}function P(n,a,r){return{id:a.id,element:r?.slotProps?.wrapper??"remote-fragment",attributes:{slot:n},type:h,children:a.children.map(c=>m(c,r))}}export{K as a};
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.