PageSourceSearch

https://app.picussecurity.com/assets/middleware-C-k0Z28O.js

js picussecurity.com collected 2026-09-24 08:49:04 UTC 6,304 bytes, 6 lines download raw bytes

1const E={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},C=(s,i)=>(e,r,t)=>(t.dispatch=o=>(e(S=>s(S,o),!1,o),o),t.dispatchFromDevtools=!0,{dispatch:(...o)=>t.dispatch(...o),...i}),J=C,g=new Map,b=s=>{const i=g.get(s);return i?Object.fromEntries(Object.entries(i.stores).map(([e,r])=>[e,r.getState()])):{}},R=(s,i,e)=>{if(s===void 0)return{type:"untracked",connection:i.connect(e)};const r=g.get(e.name);if(r)return{type:"tracked",store:s,...r};const t={connection:i.connect(e),stores:{}};return g.set(e.name,t),{type:"tracked",store:s,...t}},N=(s,i)=>{if(i===void 0)return;const e=g.get(s);e&&(delete e.stores[i],Object.keys(e.stores).length===0&&g.delete(s))},D=s=>{var i,e;if(!s)return;const r=s.split(`
2`),t=r.findIndex(S=>S.includes("api.setState"));if(t<0)return;const o=((i=r[t+1])==null?void 0:i.trim())||"";return(e=/.+ (.+) .+/.exec(o))==null?void 0:e[1]},k=(s,i={})=>(e,r,t)=>{const{enabled:o,anonymousActionType:S,store:c,...f}=i;let m;try{m=(o??(E?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!m)return s(e,r,t);const{connection:a,...y}=R(c,m,f);let h=!0;t.setState=(n,v,l)=>{const u=e(n,v);if(!h)return u;const p=l===void 0?{type:S||D(new Error().stack)||"anonymous"}:typeof l=="string"?{type:l}:l;return c===void 0?(a?.send(p,r()),u):(a?.send({...p,type:`${c}/${p.type}`},{...b(f.name),[c]:t.getState()}),u)},t.devtools={cleanup:()=>{a&&typeof a.unsubscribe=="function"&&a.unsubscribe(),N(f.name,c)}};const d=(...n)=>{const v=h;h=!1,e(...n),h=v},_=s(t.setState,r,t);if(y.type==="untracked"?a?.init(_):(y.stores[y.store]=t,a?.init(Object.fromEntries(Object.entries(y.stores).map(([n,v])=>[n,n===y.store?_:v.getState()])))),t.dispatchFromDevtools&&typeof t.dispatch=="function"){let n=!1;const v=t.dispatch;t.dispatch=(...l)=>{(E?"production":void 0)!=="production"&&l[0].type==="__setState"&&!n&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),n=!0),v(...l)}}return a.subscribe(n=>{var v;switch(n.type){case"ACTION":if(typeof n.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return O(n.payload,l=>{if(l.type==="__setState"){if(c===void 0){d(l.state);return}Object.keys(l.state).length!==1&&console.error(`
3                    [zustand devtools middleware] Unsupported __setState action format.
4                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
5                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
6                    `);const u=l.state[c];if(u==null)return;JSON.stringify(t.getState())!==JSON.stringify(u)&&d(u);return}t.dispatchFromDevtools&&typeof t.dispatch=="function"&&t.dispatch(l)});case"DISPATCH":switch(n.payload.type){case"RESET":return d(_),c===void 0?a?.init(t.getState()):a?.init(b(f.name));case"COMMIT":if(c===void 0){a?.init(t.getState());return}return a?.init(b(f.name));case"ROLLBACK":return O(n.state,l=>{if(c===void 0){d(l),a?.init(t.getState());return}d(l[c]),a?.init(b(f.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return O(n.state,l=>{if(c===void 0){d(l);return}JSON.stringify(t.getState())!==JSON.stringify(l[c])&&d(l[c])});case"IMPORT_STATE":{const{nextLiftedState:l}=n.payload,u=(v=l.computedStates.slice(-1)[0])==null?void 0:v.state;if(!u)return;d(c===void 0?u:u[c]),a?.send(null,l);return}case"PAUSE_RECORDING":return h=!h}return}}),_},A=k,O=(s,i)=>{let e;try{e=JSON.parse(s)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}e!==void 0&&i(e)},j=s=>(i,e,r)=>{const t=r.subscribe;return r.subscribe=(S,c,f)=>{let m=S;if(c){const a=f?.equalityFn||Object.is;let y=S(r.getState());m=h=>{const d=S(h);if(!a(y,d)){const _=y;c(y=d,_)}},f?.fireImmediately&&c(y,y)}return t(m)},s(i,e,r)},P=j;function L(s,i){return(...e)=>Object.assign({},s,i(...e))}function x(s,i){let e;try{e=s()}catch{return}return{getItem:t=>{var o;const S=f=>f===null?null:JSON.parse(f,i?.reviver),c=(o=e.getItem(t))!=null?o:null;return c instanceof Promise?c.then(S):S(c)},setItem:(t,o)=>e.setItem(t,JSON.stringify(o,i?.replacer)),removeItem:t=>e.removeItem(t)}}const w=s=>i=>{try{const e=s(i);return e instanceof Promise?e:{then(r){return w(r)(e)},catch(r){return this}}}catch(e){return{then(r){return this},catch(r){return w(r)(e)}}}},F=(s,i)=>(e,r,t)=>{let o={storage:x(()=>localStorage),partialize:n=>n,version:0,merge:(n,v)=>({...v,...n}),...i},S=!1;const c=new Set,f=new Set;let m=o.storage;if(!m)return s((...n)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),e(...n)},r,t);const a=()=>{const n=o.partialize({...r()});return m.setItem(o.name,{state:n,version:o.version})},y=t.setState;t.setState=(n,v)=>(y(n,v),a());const h=s((...n)=>(e(...n),a()),r,t);t.getInitialState=()=>h;let d;const _=()=>{var n,v;if(!m)return;
6S=!1,c.forEach(u=>{var p;return u((p=r())!=null?p:h)});const l=((v=o.onRehydrateStorage)==null?void 0:v.call(o,(n=r())!=null?n:h))||void 0;return w(m.getItem.bind(m))(o.name).then(u=>{if(u)if(typeof u.version=="number"&&u.version!==o.version){if(o.migrate){const p=o.migrate(u.state,u.version);return p instanceof Promise?p.then(I=>[!0,I]):[!0,p]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,u.state];return[!1,void 0]}).then(u=>{var p;const[I,T]=u;if(d=o.merge(T,(p=r())!=null?p:h),e(d,!0),I)return a()}).then(()=>{l?.(d,void 0),d=r(),S=!0,f.forEach(u=>u(d))}).catch(u=>{l?.(void 0,u)})};return t.persist={setOptions:n=>{o={...o,...n},n.storage&&(m=n.storage)},clearStorage:()=>{m?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>_(),hasHydrated:()=>S,onHydrate:n=>(c.add(n),()=>{c.delete(n)}),onFinishHydration:n=>(f.add(n),()=>{f.delete(n)})},o.skipHydration||_(),d||h},U=F;function H(s,i=typeof window>"u"){return(e,r,t)=>{if(!i)return s(e,r,t);const o=()=>{throw new Error("Cannot set state of Zustand store in SSR")};return t.setState=o,s(o,r,t)}}export{L as combine,x as createJSONStorage,A as devtools,U as persist,J as redux,P as subscribeWithSelector,H as unstable_ssrSafe};

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.