(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[634],{192206(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{K:()=>i});var e=__webpack_require__(798777);let t=/\$?([\d.,]+)([KMBT])?/u;let r={K:1e3,M:1e6,B:1e9,T:1e12};let n=n=>{if(!n||n===e.dt.FallbackPriceDisplay)return-1;if(n==="$<1")return .5;let i=t.exec(n);if(i){let[,e,t]=i;let n=Number.parseFloat((0,e.replace(/,/gu,"")));return Number.isNaN(n)?-1:(0,t?n*r[t]:n)}let l=Number.parseFloat(n.replace(/[$,]/gu,""));return Number.isNaN(l)?-1:l};let i=({markets:t,sortBy:r,direction:i=e.LH.DefaultDirection})=>{let l=[...t];return l.sort((t,l)=>{let a=0;switch(r){case e.LH.SortFields.Volume:{a=n(t.volume)-n(l.volume);break}case e.LH.SortFields.PriceChange:{a=parseFloat(t.change24hPercent?.replace(/[%+]/gu,"")||"0")-parseFloat(l.change24hPercent?.replace(/[%+]/gu,"")||"0");break}case e.LH.SortFields.FundingRate:{a=(t.fundingRate??0)-(l.fundingRate??0);break}case e.LH.SortFields.OpenInterest:{a=n(t.openInterest)-n(l.openInterest);break}default:break}return i===e.LH.DefaultDirection?a*-1:a}),l}}}).call(__webpack_require__._LM_("@metamask/perps-controller",{__webpack_require__,__webpack_exports__}))()},810634(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{Js:()=>n,Kj:()=>i,WH:()=>o,_:()=>s,lt:()=>a});var e=__webpack_require__(192206);let t=e=>Boolean(e.isHip3)||Boolean(e.marketSource);function r(e,r){switch(r){case"all":return!0;case"new":return e.isNewMarket===!0||t(e)&&e.marketType===undefined;case"crypto":return!t(e)||e.marketType==="crypto";default:return e.marketType!==undefined&&e.marketType===r}}function n(e){let{marketType:r}=e;return r||(0,t(e)?"new":"crypto")}function i(t,n){let i=t;if(n?.categories?.length){let{categories:e}=n;i=i.filter(t=>e.some(e=>r(t,e)))}if(n?.excludeSymbols?.length){let e=new Set(n.excludeSymbols);i=i.filter(t=>!e.has(t.symbol))}return n?.sortBy&&(i=(0,e.K)({markets:i,sortBy:n.sortBy,direction:n.direction})),n?.limit!==undefined&&(i=i.slice(0,n.limit)),i}let l=e=>e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");let a=e=>{if(!e||e.trim().length===0)throw new Error("Market pattern cannot be empty");let t=e.trim();if(t.length>100)throw new Error(`Market pattern exceeds maximum length (${"100"} chars): ${t}`);if(/[\\()[\]{}^$+?.|]/u.test(t))throw new Error(`Market pattern contains invalid regex characters: ${t}`);if(!/^[a-zA-Z0-9:_\-*]+$/u.test(t))throw new Error(`Market pattern contains invalid characters: ${t}`);return!0};let s=e=>{let t=e.trim();if(a(t),t.endsWith(":*")){let e=t.slice(0,-2);return new RegExp(`^${l(e)}:`,"u")}return!t.includes(":")?new RegExp(`^${l(t)}:`,"u"):(0,t)};let u=(e,t)=>{return typeof t=="string"?e===t:(0,t.test(e))};let o=(e,t,r,n,i)=>{if(t===null)return!0;if(!r)return!1;if(n.length>0){if(!n.some(({matcher:t})=>u(e,t)))return!1}return i.length===0?!0:(0,!i.some(({matcher:t})=>u(e,t)))}}}).call(__webpack_require__._LM_("@metamask/perps-controller",{__webpack_require__,__webpack_exports__}))()}}]);