1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"e9cc7b2420e5d76423b99ff4271bbeade7bff705"},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var r=1;r<arguments.length;r++){var s=arguments[r];if(null!=s)for(var n in s)s.hasOwnProperty(n)&&(e[n]=s[n])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:finviz":!0});var r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="29637bc1-51ad-48a0-bfaa-533415b0b096",e._sentryDebugIdIdentifier="sentry-dbid-29637bc1-51ad-48a0-bfaa-533415b0b096")}catch(e){}}(),(self.webpackChunkFinvizModern=self.webpackChunkFinvizModern||[]).push([[2101],{4124(e,r,s){s.d(r,{b:()=>t});s(63696);var n=s(52386),a=s(62540);function t(e){const r=(0,n.hN)();return(0,a.jsx)("div",{ref:r.portalRef,...e})}},3485(e,r,s){s.r(r),s.d(r,{default:()=>C});s(66184),s(14846),s(6211),s(94364);var n=s(63696),a=s(65227),t=s(78898),i=s(10354),l=s(96288),d=s(57490),o=s(88601),c=(s(27458),s(75568),s(4110)),u=s(8837),m=s(26373),h=s(44394),p=s(79510),g=s(90289),x=s(38476),f=s(12845),v=s(4124),b=s(14930),j=s(85670),w=s(35721),y=s(24104),_=s(62540);function S(e){let{presets:r,onSave:s,errorMessage:a,notificationClassName:i,ref:d}=e;const o=(0,w.wX)(j.TO.ScreenerSplit),S=o?"grid-cols-[24px_1fr_3fr_auto_auto]":"grid-cols-[24px_1fr_3fr_auto]",N=(0,f.hN)(),{isOpen:C}=(0,f.IB)(),[k,I]=n.useState(r),[M,P]=n.useState(!1),[E,T]=n.useState(null),F=(0,m.pA)();n.useEffect(()=>{a&&N.show((0,_.jsx)(c.F,{theme:"error",onClose:N.hide,children:a}))},[a,N]);const $=n.useCallback((e,r)=>{I(s=>(0,w.HD)(s,e,r))},[]),R=n.useCallback(e=>{I(r=>r.filter((r,s)=>s!==e))},[]),z=n.useCallback((e,r,s)=>{I(n=>n.map((n,a)=>a===e?{...n,[r]:s}:n))},[]),D=n.useCallback(()=>{N.hide();if(k.some(e=>0===e.name.trim().length))return P(!0),void N.show((0,_.jsx)(c.F,{theme:"error",onClose:N.hide,children:"Your changes could not be saved. Please correct the errors highlighted in red."}));P(!1),s(k)},[k,s]);n.useImperativeHandle(d,()=>({save:D}),[D]);const O=(0,g._)({itemsCount:k.length,reorderItems:$,focusFirstOnTabPress:!0});return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:C?i??"mb-2":"hidden",children:(0,_.jsx)(v.b,{})}),k.length>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:`mb-1 grid ${S} gap-x-1 border border-transparent p-1 text-2xs text-muted`,children:[(0,_.jsx)("span",{}),(0,_.jsx)("span",{className:"px-2",children:"Name"}),(0,_.jsx)("span",{className:"px-2",children:"Screen Parameters"}),o&&(0,_.jsx)("span",{className:"px-2",children:"Screener"}),(0,_.jsx)("span",{})]}),(0,_.jsx)("div",{children:(0,_.jsx)(h.qU,{id:"screener-presets-list",reorderItems:$,children:(0,_.jsxs)("div",{...O.listProps,"aria-label":"Screener presets",className:"relative w-full divide-y divide-secondary overflow-hidden rounded-md border border-primary",children:[k.map((e,r)=>(0,_.jsx)(p.T,{id:e.id>0?String(e.id):`new-${r}`,index:r,hasCustomHandle:!0,children:(0,_.jsxs)("div",{...O.itemProps(r),className:`grid ${S} items-center gap-x-1 bg-primary p-1 outline-none focus-within:bg-accent`,children:[(0,_.jsx)(h.tk,{children:(0,_.jsx)("div",{className:"cursor-grab",children:(0,_.jsx)(l.I,{name:"drag",height:16,width:16,className:"text-muted"})})}),(0,_.jsx)(b.g,{className:"border-0 bg-transparent",value:e.name,onChange:e=>z(r,"name",e.target.value),maxLength:50,placeholder:"Preset name",error:M&&0===e.name.trim().length,tooltipSettings:{color:"red"},children:M&&0===e.name.trim().length?"Preset name is required":void 0}),(0,_.jsx)(x.pd,{className:"border-0 bg-transparent",value:e.url,onChange:e=>z(r,"url",e.target.value),maxLength:5e3,placeholder:"Screen parameters"}),o&&(0,_.jsx)("span",{className:"px-2",children:(0,_.jsx)(u.E,{size:"small",children:(0,y.B3)(e.screenerType)})}),(0,_.jsx)(t.$n,{size:"small",appearance:"square",leftContent:"trashCan",onClick:()=>(e=>{T(e),F.show()})(r)})]})},e.id>0?String(e.id):`new-${r}`)),(0,_.jsx)(h.uA,{})]})})})]}),(0,_.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:O.announcement}),0===k.length&&(0,_.jsx)("div",{className:"py-8 text-center text-muted",children:"There are no presets."}),(0,_.jsx)(m.KK,{state:F,title:"Remove Preset?","aria-label":"Remove preset confirmation",actions:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(t.$n,{as:m.d$,children:"Cancel"}),(0,_.jsx)(t.$n,{theme:"red",onClick:()=>{null!==E&&(R(E),T(null)),F.hide()},children:"Remove"})]}),children:"Are you sure you want to remove this preset?"})]})}var N=s(45106);function C(){const e=(0,o.t0)(e=>e.userId),{data:r}=(0,d.TT)(),s=(0,a.mP)(),c=(0,a.of)(),u=(0,a.zy)(),m=(0,a.cq)(),h=["loading","submitting"].includes(m.state),p=s?.isSuccess&&"idle"===m.state,g=(0,y.mE)(u.search,r?.backUrl),x=n.useMemo(()=>r?.presets??[],[r?.presets]),f=n.useMemo(()=>JSON.stringify(x.map(e=>[e.id,e.name,e.url])),[x]),v=n.useRef(null),b=n.useRef(null);n.useEffect(()=>{if(s?.isSuccess&&window.location.search&&!(0,y.h4)(window.location.search)&&window.history.replaceState(null,"",window.location.pathname),s?.isSuccess&&null!==b.current){const{name:r,url:s}=b.current;b.current=null,(0,N.y)({name:r,url:s,userId:e})}},[s]);const j=n.useCallback(e=>{const r=e.find(e=>e.id<=0);b.current=r?{name:r.name,url:r.url}:null,c(JSON.stringify(e),{method:"PUT",encType:"application/json"})},[c]);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"mx-auto w-244",children:(0,_.jsx)(S,{ref:v,presets:x,onSave:j,errorMessage:s?.isError?s.message??"Failed to save presets":null,notificationClassName:"sticky-0 z-notification -mt-1 mb-4 bg-primary py-2 h-xs:sticky"},f)}),(0,_.jsx)("div",{className:"bottom-0 my-6 bg-primary/85 backdrop-blur-md h-xs:sticky",children:(0,_.jsxs)("div",{className:"mx-auto flex w-244 items-center gap-2 border-t-2 border-gray-50 py-4 dark:border-gray-700",children:[(0,_.jsx)(t.$n,{theme:"blue",onClick:()=>v.current?.save(),disabled:h,children:h?(0,_.jsx)(i.v,{delayComponent:(0,_.jsx)("span",{children:"Save Changes"}),children:(0,_.jsx)("span",{children:"Savingâ¦"})}):(0,_.jsx)("span",{children:"Save Changes"})}),(0,_.jsx)(t.$n,{onClick:()=>window.location.href=g,children:"Back to Screener"}),p&&(0,_.jsx)(i.v,{initialVisible:!0,delay:2e3,children:(0,_.jsxs)("div",{className:"flex items-center gap-1 text-2xs text-muted",children:[(0,_.jsx)(l.I,{name:"done",className:"text-blue-400"}),"Changes Saved"]})})]})})]})}},45106(e,r,s){s.d(r,{y:()=>a});s(14846),s(94364),s(5673),s(30164),s(21279);function n(e){const r=e.includes("?")?e.split("?")[1]:e,s=new URLSearchParams(r),n=s.get("o")??"",a=s.get("f")??"",t=a?a.split(","):[];return{order_by:n.replace(/^-/,"")||void 0,order:n.startsWith("-")?"desc":"asc",signal:s.get("s")||void 0,ticker:s.get("t")||void 0,filter:t.map(e=>e.replace(/_.*/,"")),value:t.map(e=>e.replace(/^[^_]*_/,"")),view:s.get("v")||void 0,refresh_rate:s.get("r")||void 0,show_etf:s.get("show_etf")||void 0,show_industry:s.get("show_industry")||void 0,preset_order:s.get("preset_order")||void 0,show_wiim:s.get("show_wiim")||void 0}}function a(e){let{name:r,url:s,userId:a}=e;window.gtag&&window.gtag("event","screener_save_screen",{screen_name:r,created_timestamp:Date.now(),...a?{user_id:a}:{},...n(s)})}}}]); 2//# sourceMappingURL=2101.v1.a425611b.js.map
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.