PageSourceSearch

https://community.bipolaruk.org/dist/v2/forum/chunks/attachmentUtils.Tgsg2I-f.min.js

js bipolaruk.org collected 2026-10-03 19:30:36 UTC 8,020 bytes, 24 lines download raw bytes

1import"./rolldown-runtime.CMxvf4Kt.min.js";import{Pm as e,Vm as t,Wu as n,Zu as r,cf as i,gd as a,gu as o,hc as s,vd as c,xp as l}from"./addons/dashboard/titlebar.BTiouRZu.min.js";import{at as u,dt as d,ft as f}from"../vendor/react-core.0yyGfSgD.min.js";
2/*
3* @author Stéphane LaFlèche <[email protected]>
4* @copyright 2009-2019 Vanilla Forums Inc.
5* @license GPL-2.0-only
6*/
7var p=i(()=>{let e=n(),t=a(`attachmentIcon`);return{spacing:{default:12,...t.subComponentStyles(`spacing`)},shadow:{color:e.mixBgAndFg(.1),...t.subComponentStyles(`shadow`)},icon:{size:16,errorIconHeight:14.39}}}),m=i(()=>{n();let i=p(),a=c(`attachmentIcons`),o=s();return{root:a({display:`block`,position:`relative`}),items:a(`items`,{display:`flex`,flexWrap:`wrap`,alignItems:`flex-start`,justifyContent:`flex-end`,width:e(`100% + ${t(i.spacing.default*2)}`),overflow:`hidden`,...r.margin({top:-i.spacing.default,left:-i.spacing.default,right:o.spacing.horizontal})}),item:a(`item`,{margin:i.spacing.default})}}),h=i(()=>{let e=p(),n=c(`attachmentIcon`);return{root:n({display:`block`,width:t(e.icon.size),height:t(e.icon.size),boxShadow:`0 0 0 1px ${e.shadow.color}`}),error:n(`error`,{width:t(e.icon.size),height:t(e.icon.errorIconHeight)})}});f();
8/**
9* @copyright 2009-2019 Vanilla Forums Inc.
10* @license GPL-2.0-only
11*/
12var g={FILE:`A file`,PDF:`Adobe Portable Document Format (PDF)`,EXCEL:`Microsoft Excel Spreadsheet`,WORD:`Microsoft Word Document`,PPT:`Microsoft PowerPoint Presentation`,ARCHIVE:`An archived file or files`,IMAGE:`An image file`},_=d();
13/*
14* @author Stéphane LaFlèche <[email protected]>
15* @copyright 2009-2019 Vanilla Forums Inc.
16* @license GPL-2.0-only
17*/
18function v(e){let t=e.fileType?e.fileType:l(`File`);return(0,_.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,className:u(`attachmentIcon-fileGeneric`,`attachmentIcon`,o().fileType,e.className),role:`img`,"aria-label":t,children:[(0,_.jsx)(`title`,{children:t}),(0,_.jsx)(`rect`,{width:`16`,height:`16`,rx:`1`,style:{fill:`#777b81`}}),(0,_.jsx)(`path`,{d:`M11.5,6v4a3.418,3.418,0,0,1-3.334,3.5H8a3.418,3.418,0,0,1-3.5-3.334c0-.055,0-.111,0-.166V5A2.362,2.362,0,0,1,6.715,2.5,2.259,2.259,0,0,1,7,2.5,2.362,2.362,0,0,1,9.5,4.715,2.258,2.258,0,0,1,9.5,5V9.5c0,1-.5,2-1.5,2s-1.5-1-1.5-2V6`,style:{fill:`none`,stroke:`#f1f2f2`,strokeLinecap:`round`}})]})}function y(e){let t=l(`Word`);return(0,_.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,className:u(`attachmentIcon-fileWord`,`attachmentIcon`,o().fileType,e.className),role:`img`,"aria-label":l(g.WORD),children:[(0,_.jsx)(`title`,{children:t}),(0,_.jsx)(`rect`,{width:`16`,height:`16`,rx:`1`,style:{fill:`#0175fc`}}),(0,_.jsx)(`rect`,{x:`3`,y:`3`,width:`10`,height:`1`,style:{fill:`#cce3fe`}}),(0,_.jsx)(`rect`,{x:`3`,y:`5`,width:`10`,height:`1`,style:{fill:`#cce3fe`}}),(0,_.jsx)(`rect`,{x:`3`,y:`12`,width:`10`,height:`1`,style:{fill:`#cce3fe`}}),(0,_.jsx)(`rect`,{x:`3`,y:`10`,width:`10`,height:`1`,style:{fill:`#cce3fe`}}),(0,_.jsx)(`rect`,{x:`3`,y:`7`,width:`6`,height:`1`,style:{fill:`#cce3fe`}})]})}function b(e){let t=l(`Excel`);return(0,_.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,className:u(`attachmentIcon-fileExcel`,`attachmentIcon`,o().fileType,e.className),role:`img`,"aria-label":l(g.EXCEL),children:[(0,_.jsx)(`title`,{children:t}),(0,_.jsx)(`rect`,{width:`16`,height:`16`,fill:`#2f7d32`}),(0,_.jsx)(`polygon`,{style:{fill:`#fff`},points:`9.334 10.361 7.459 13.543 6 13.543 8.613 9.166 6.164 5 7.629 5 9.334 7.965 11.039 5 12.498 5 10.055 9.166 12.668 13.543 11.203 13.543 9.334 10.361`})]})}function x(e){let t=l(g.PDF);return(0,_.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,className:u(`attachmentIcon-filePDF`,`attachmentIcon`,o().fileType,e.className),role:`img`,"aria-label":l(g.PDF),children:[(0,_.jsx)(`title`,{children:(0,_.jsx)(`abbr`,{title:t||void 0,children:g.PDF})}),(0,_.jsx)(`rect`,{width:`16`,height:`16`,rx:`1`,style:{fill:`#c80000`}}),(0,_.jsx)(`path`,{d:`M2.5,11V8.5m4.5,2v-5H8q1.5,0,1.5,2.143v.714Q9.5,10.5,8,10.5Zm-4.5-2v-3h1Q5,5.5,5,6.786v.428Q5,8.5,3.5,8.5Z`,style:{stroke:`#fff`,fill:`none`}}),(0,_.jsx)(`polygon`,{points:`11 11 11 5 14 5 14 6 12.007 6 12 7.5 13.493 7.5 13.493 8.5 12 8.5 12 11 11 11`,style:{fill:`#fff`}})]})}function S(e){let t=l(`Image`);return(0,_.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,className:u(`attachmentIcon-fileImage`,`attachmentIcon`,o().fileType,e.className),role:`img`,"aria-label":l(g.IMAGE),children:[(0,_.jsx)(`title`,{children:t}),(0,_.jsx)(`rect`,{width:`16`,height:`16`,rx:`1`,style:{fill:`#c80090`}}),(0,_.jsx)(`path`,{d:`M3,12.5a1,1,0,0,1-1-1V6A1,1,0,0,1,3,5h.5V4.75a.25.25,0,0,1,.25-.25h.5a.25.25,0,0,1,.25.25V5a.81.81,0,0,0,.724-.447l.5-1A1,1,0,0,1,6.618,3H9.382a1,1,0,0,1,.894.553l.448.894A1,1,0,0,0,11.618,5H13a1,1,0,0,1,1,1v5.5a1,1,0,0,1-1,1Zm5-2a2,2,0,1,1,2-2A2,2,0,0,1,8,10.5Zm0,1a3,3,0,1,0-3-3A3,3,0,0,0,8,11.5
18ZM11.5,6V7H13V6Z`,style:{fill:`#fff`,fillOpacity:.97}})]})}function C(e){l(`PPT`);let t=l(g.PPT);return(0,_.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,className:u(`attachmentIcon-filePowerPoint`,`attachmentIcon`,o().fileType,e.className),role:`img`,"aria-label":l(g.IMAGE),children:[(0,_.jsx)(`title`,{children:t?(0,_.jsx)(`abbr`,{title:t,children:g.PDF}):g.PDF}),(0,_.jsx)(`rect`,{width:`16`,height:`16`,rx:`1`,style:{fill:`#ee6a01`}}),(0,_.jsx)(`path`,{d:`M8,4V7.5h3.55A3.5,3.5,0,1,1,8,4Z`,style:{fill:`#fbe1cc`}}),(0,_.jsx)(`path`,{d:`M9,3h.05a3.5,3.5,0,0,1,3.5,3.5H9Z`,style:{fill:`#fbe1cc`}}),(0,_.jsx)(`rect`,{x:`3`,y:`12`,width:`10`,height:`1`,style:{fill:`#fbe1cc`}})]})}function w(e){l(`Zip`);let t=l(g.ARCHIVE),n={fill:`#fff`,fillOpacity:.9};return(0,_.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,className:u(`attachmentIcon-fileZip`,`attachmentIcon`,o().fileType,e.className),role:`img`,"aria-label":l(g.IMAGE),children:[(0,_.jsx)(`title`,{children:t?(0,_.jsx)(`abbr`,{title:t,children:g.PDF}):g.PDF}),(0,_.jsx)(`rect`,{width:`16`,height:`16`,rx:`1`,style:{fill:`#eeb601`}}),(0,_.jsx)(`path`,{d:`M6,7.5h4l.45,4.955A.5.5,0,0,1,10,13H6.054a.5.5,0,0,1-.5-.5.338.338,0,0,1,0-.045Zm.99,3a.149.149,0,0,0-.149.14l-.08,1.2v.01a.15.15,0,0,0,.15.15H9.1a.149.149,0,0,0,.139-.16l-.08-1.2a.149.149,0,0,0-.149-.14Z`,style:{fill:`#fdf7e6`}}),(0,_.jsx)(`rect`,{x:`6`,y:`6`,width:`2`,height:`1`,style:n}),(0,_.jsx)(`rect`,{x:`8`,y:`5`,width:`2`,height:`1`,style:n}),(0,_.jsx)(`rect`,{x:`6`,y:`4`,width:`2`,height:`1`,style:n}),(0,_.jsx)(`rect`,{x:`8`,y:`3`,width:`2`,height:`1`,style:n}),(0,_.jsx)(`rect`,{x:`6`,y:`2`,width:`2`,height:`1`,style:n}),(0,_.jsx)(`rect`,{x:`8`,y:`1`,width:`2`,height:`1`,style:n}),(0,_.jsx)(`rect`,{x:`6`,width:`2`,height:`1`,style:n})]})}
19/*
20* @author Stéphane LaFlèche <[email protected]>
21* @copyright 2009-2019 Vanilla Forums Inc.
22* @license GPL-2.0-only
23*/
24function T(e){if(!e)return g.FILE;if(e.startsWith(`image/`))return g.IMAGE;switch(e){case`application/pdf`:return g.PDF;case`application/vnd.ms-excel`:case`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`:return g.EXCEL;case`application/msword`:case`application/vnd.openxmlformats-officedocument.wordprocessingml.document`:return g.WORD;case`application/vnd.ms-powerpoint`:case`application/vnd.openxmlformats-officedocument.presentationml.presentation`:return g.PPT;case`application/zip`:case`application/x-7z-compressed`:case`application/x-bzip`:case`application/x-bzip2`:case`application/x-rar-compressed`:return g.ARCHIVE;default:return g.FILE}}function E(e){switch(e.type){case g.PDF:return(0,_.jsx)(x,{className:e.className});case g.EXCEL:return(0,_.jsx)(b,{className:e.className});case g.WORD:return(0,_.jsx)(y,{className:e.className});case g.PPT:return(0,_.jsx)(C,{className:e.className});case g.ARCHIVE:return(0,_.jsx)(w,{className:e.className});case g.IMAGE:return(0,_.jsx)(S,{className:e.className});default:return(0,_.jsx)(v,{className:e.className})}}export{m as i,T as n,h as r,E as t};

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.