PageSourceSearch

https://astmh.org/_nuxt/BJu00Q4_.js

js astmh.org collected 2026-10-02 03:01:59 UTC 9,867 bytes, 1 lines download raw bytes

1import{u as pe,_ as de}from"./Bq0OCghm.js";import{d as I,q as d,c as p,a as t,o as a,k as w,e as u,w as g,C as ue,T as me,A as y,r as ce,t as M,D as B,_ as xe,M as fe,L as ge,U as be,N as ve,f as q,z as j,s as _e,u as n,i as _,h as V,P as D,E as $,F as h,b as S,y as ye,j as he,Q as we,n as ke}from"./Ci3hYp0f.js";import{l as G,g as Te,u as Ce,_ as $e}from"./B8qIBrk2.js";import{_ as Me}from"./Ffht8uEn.js";import{a as Le,u as Fe}from"./B8zKm2_Y.js";import{_ as je}from"./CotY-VCX.js";import{u as Ve}from"./BEQ5Arzq.js";import"./C-rFsY97.js";const De={class:"w-12 h-12 bg-blue-150 rounded-full flex items-center justify-center mb-4"},Se=["innerHTML"],Be=I({__name:"DropZone",emits:["drop","open"],setup(A,{emit:c}){const x=c,i=d(null);return Le(i,{onDrop(s){if(!s)return;const r=["application/pdf","image/jpeg","image/png","image/gif","image/svg+xml"],f=[...s].filter(b=>r.includes(b.type));x("drop",f)}}),(s,r)=>(a(),p("div",{ref_key:"dropRef",ref:i,class:"flex flex-col items-center justify-center border-2 border-dashed border-blue-300 bg-blue-50 rounded-xl py-10 px-4 cursor-pointer text-center hover:bg-gray-blue transition duration-300",onClick:r[0]||(r[0]=f=>x("open"))},[t("div",De,[t("i",{class:"h-[24px] w-[24px]",innerHTML:s.$getIcon("cloud-download-icon")},null,8,Se)]),r[1]||(r[1]=t("p",{class:"text-gray-400"},[t("span",{class:"text-blue-200 font-medium"},"Click to upload"),t("span",{class:"hidden sm:inline"}," or drag and drop")],-1)),r[2]||(r[2]=t("p",{class:"text-sm text-gray-500"},"PNG, JPG or PDF (max. 1MB)",-1))],512))}}),Ie={class:"bg-white rounded-2xl shadow-xl w-full mx-[20px] md:max-w-[520px]",tabindex:"-1"},Ae={class:"p-[20px] sm:px-[30px]"},He={class:"flex items-center justify-between mb-[10px]"},Re={key:0,class:"text-xl font-semibold"},Ne=["innerHTML"],Ue={key:0,class:"text-primary"},Ee=I({__name:"Modal",props:{modelValue:{type:Boolean},title:{},description:{}},emits:["update:modelValue"],setup(A,{emit:c}){const x=c;function i(){x("update:modelValue",!1)}return(s,r)=>(a(),w(me,{to:"body"},[u(ue,{name:"modal-fade"},{default:g(()=>[s.modelValue?(a(),p("div",{key:0,class:"backdrop fixed inset-0 z-50 flex items-center justify-center",role:"dialog","aria-modal":"true",onClick:B(i,["self"])},[t("div",Ie,[t("div",Ae,[t("div",He,[s.title?(a(),p("h2",Re,M(s.title),1)):y("",!0),t("button",{class:"cursor-pointer p-1 text-gray-500 hover:text-gray-800 hover:bg-gray-800/10 rounded-[50px] transition duration-300","aria-label":"Close modal",onClick:i},[t("i",{class:"cross-icon fill-gray-500",innerHTML:s.$getIcon("cross")},null,8,Ne)])]),s.description?(a(),p("p",Ue,M(s.description),1)):y("",!0)]),ce(s.$slots,"default",{},void 0,!0)])])):y("",!0)]),_:3})]))}}),ze=xe(Ee,[["__scopeId","data-v-176e7903"]]),Pe={class:"bg-[#FAFEFF] lg:px-[70px] md:pt-[80px] pb-[100px] sm:px-10 sm:pt-[87px] px-5 pt-[103px] relative max-w-[1700px] mx-auto"},qe={class:"flex absolute top-5"},Ge=["innerHTML"],Oe={class:"md:w-full lg:max-w-[860px] p-0 lg:p-10 md:mx-auto md:rounded-[20px] lg:shadow-[0_5px_20px_5px_#172a3514] max-w-full rounded-none shadow-none lg:bg-white"},Ze={class:"flex items-center gap-[10px] font-semibold"},Qe={class:"p-3 bg-sky-400 text-white rounded-[50px]"},Je=["innerHTML"],Ye={class:"flex flex-col gap-2.5"},Ke={class:"flex flex-col gap-2.5"},We={class:"flex flex-col gap-2.5"},Xe={key:0,class:"flex flex-col"},et={class:"flex gap-[5px] mt-[10px] mb-[10px] flex-wrap"},tt={key:1},ot=["innerHTML"],st={class:"flex flex-col gap-2.5"},lt={key:0,class:"flex flex-wrap gap-4 mt-[10px] mb-[10px]"},nt={key:1,class:"text-red-500 text-sm mb-2"},at={class:"sm:mt-[20px] flex justify-end gap-[10px]"},rt={class:"px-[20px] sm:px-[30px]"},it={class:"flex flex-col mt-[30px] mb-[5px] gap-4 max-h-[350px] overflow-auto"},pt={class:"flex flex-wrap justify-end gap-[10px] border-t border-gray-100 px-[20px] sm:px-[30px] py-[15px]"},O=5,vt=I({__name:"new-topic",setup(A){const c=d(""),x=d(""),i=d(!1),s=d([]),r=d(null),f=d([]),b=d(),k=d([]),T=d([]),C=d(!1),Z=Ve(),{currentSection:H}=fe(Z),Q=ge(),R=be(),{user:J}=ve(),Y=pe(Q.path),L=q(()=>!c.value.trim()||s.value.some(o=>o.tooLarge)||!!r.value),N=async()=>{try{if(L.value)return;C.value=!0;const o=await Te({title:c.value,description:x.value,section:H.value,tags:k.value.map(e=>e.id.toString())});s.value.length&&await Ce("topic",o.documentId,s.value),C.value=!1,ke(`/forum/${o.documentId}`,{replace:!0})}catch{C.value=!1}},{files:K,open:W}=Fe({accept:"application/pdf, image/jpeg, image/png, image/gif, image/svg+xml",multiple:!0}),X=q(()=>s.value.length>O);j(X,o=>{r.value=o?`You can upload up to ${O} files only.`:""});const U=o=>{s.value=[...s.value,...Array.from(o)]};j(K,o=>{o!=null&&o.length&&U(o)});const ee=o=>{U(o)},te=o=>{const e=s.value.find(v=>
1v.name===o);e&&(URL.revokeObjectURL(e.preview),s.value=s.value.filter(v=>v.name!==o))},oe=o=>{f.value=f.value.map(e=>e.name===o?{...e,value:!e.value}:e),k.value=f.value.filter(e=>!!e.value)},se=async()=>{const o=b.value?`?filters[name][$containsi]=${b.value}`:"",e=await G(o),v=E(e);f.value=v.map(m=>k.value.find(F=>F.documentId===m.documentId)||m)};j(b,(o,e)=>{(o||!o&&e)&&se()});const E=o=>o.map(e=>({...e,name:e.name,value:!1})),z=()=>{if(window.history.length>1){R.back();return}R.push({path:"/forum",query:{section:H.value||"Global"}})};return _e(async()=>{const o=await G();f.value=E(o)}),(o,e)=>{var P;const v=de,m=he,F=$e,le=Me,ne=Be,ae=we("v-progress-circular"),re=je,ie=ze;return a(),p(h,null,[t("div",Pe,[t("div",qe,[u(v,{items:n(Y)},null,8,["items"])]),u(m,{class:"hidden absolute xl:flex border border-blue-200 mb-6 text-blue-200",onClick:z},{default:g(()=>[t("i",{class:"h-[20px] w-[20px] fill-blue-200",innerHTML:o.$getIcon("arrow-left")},null,8,Ge),e[8]||(e[8]=_(" Back "))]),_:1,__:[8]}),t("div",Oe,[t("form",{class:"flex flex-col gap-10",onSubmit:B(N,["prevent"])},[e[17]||(e[17]=t("h1",{class:"sm:text-[32px] text-[22px] font-bold"},"Create New Topic",-1)),t("div",Ze,[t("div",Qe,[t("i",{class:"fill-white",innerHTML:o.$getIcon("user")},null,8,Je)]),_(" "+M(((P=n(J))==null?void 0:P.name)??""),1)]),t("div",Ye,[e[9]||(e[9]=t("label",{class:"sm:text-[17px] text-[15px] font-semibold",for:"title"},"Title",-1)),V(t("input",{id:"title","onUpdate:modelValue":e[0]||(e[0]=l=>$(c)?c.value=l:null),class:"w-full border border-gray-200 py-2.5 px-5 placeholder-gray-200 placeholder-gray-200 rounded-[10px]",placeholder:"Add topic title",required:"",maxlength:"255"},null,512),[[D,n(c)]])]),t("div",Ke,[e[10]||(e[10]=t("label",{class:"sm:text-[17px] text-[15px] font-semibold",for:"content"},"Body Text (optional)",-1)),V(t("textarea",{id:"content","onUpdate:modelValue":e[1]||(e[1]=l=>$(x)?x.value=l:null),class:"w-full border border-gray-200 py-2.5 px-5 placeholder-gray-200 placeholder-gray-200 rounded-[10px] placeholder-gray-200 min-h-[160px]",placeholder:"Add a description to your topic"},null,512),[[D,n(x)]])]),t("div",We,[e[14]||(e[14]=t("label",{class:"sm:text-[17px] text-[15px] font-semibold"},"Tags",-1)),n(T).length?(a(),p("div",Xe,[t("div",et,[(a(!0),p(h,null,S(n(T),l=>(a(),w(F,{key:l.id,text:l.name,class:"bg-gray-blue px-[10px] py-[5px] rounded-[50px] text-blue-600"},null,8,["text"]))),128))]),u(m,{class:"border border-blue-200 text-blue-200 w-max justify-center mt-[10px]",type:"button",onClick:e[2]||(e[2]=l=>i.value=!0)},{default:g(()=>e[11]||(e[11]=[_(" Edit Tags ")])),_:1,__:[11]})])):n(T).length?y("",!0):(a(),p("div",tt,[u(m,{class:"border border-blue-200 text-blue-200 w-full sm:w-max justify-center items-center",type:"button",onClick:e[3]||(e[3]=l=>i.value=!0)},{default:g(()=>[t("i",{class:"h-[20px] w-[20px] fill-blue-200",innerHTML:o.$getIcon("plus")},null,8,ot),e[12]||(e[12]=t("span",{class:"whitespace-nowrap"},"Add tags",-1)),e[13]||(e[13]=t("span",{class:"hidden sm:inline"},"to make your post discoverable",-1))]),_:1,__:[12,13]})]))]),t("div",st,[e[15]||(e[15]=t("label",{class:"sm:text-[17px] text-[15px] font-semibold"},"Attachments",-1)),n(s).length?(a(),p("div",lt,[(a(!0),p(h,null,S(n(s),l=>(a(),w(le,{key:l.name,item:l,removable:!0,onRemove:te},null,8,["item"]))),128))])):y("",!0),n(r)?(a(),p("div",nt,M(n(r)),1)):y("",!0),u(ne,{onDrop:ee,onOpen:n(W)},null,8,["onOpen"])]),t("div",at,[u(m,{class:"border border-blue-200 text-blue-200 px-[20px] sm:px-[40px] py-[9px] sm:py-[11px] bg-white",type:"button",onClick:z},{default:g(()=>e[16]||(e[16]=[_(" Cancel ")])),_:1,__:[16]}),u(m,{class:ye({"bg-blue-200 text-white mb-auto px-[20px] sm:px-[40px] py-[9px] sm:py-[12px]":!0,"bg-gray-300 filter blur-[0.1px]":n(L)}),disabled:n(L),type:"submit",onClick:B(N,["prevent"])},{default:g(()=>[n(C)?(a(),w(ae,{key:0,"bg-color":"#335598",color:"white",indeterminate:"",size:"20"})):(a(),p(h,{key:1},[_(" Submit Topic")],64))]),_:1},8,["class","disabled"])])],32)])]),u(ie,{modelValue:n(i),"onUpdate:modelValue":e[7]||(e[7]=l=>$(i)?i.value=l:null),description:"Adding tags to your forum topic helps others discover it more easily by connecting it to related content.",title:"Add tag"},{default:g(()=>[t("div",rt,[V(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>$(b)?b.value=l:null),class:"w-full border border-gray-200 py-2.5 px-5 placeholder-gray-200",name:"text",placeholder:"Search tags..."},null,512),[[D,n(b),void 0,{trim:!0}]]),t("div",it,[(a(!0),p(h,null,S(n(f),l=>(a(),w(re,{key:l.name,item:l,onToggle:oe},null,8,["item"]))),128))])]),t("div",pt,[u(m,{class:"order-2 w-full sm:order-none sm:w-auto justify-center border border-blue-200 text-blue-200 px-[40px] py-[11px]",type:"button",onClick:e[5]||(e[5]=l=>i.value=!1)},{default:g(()=>e[18]||(e[18]=[_(" Cancel ")])),_:1,__:[18]}),u(m,{class:"order-1 w-full sm:order-none sm:w-auto justify-center bg-blue-200 text-white px-[40px] py-[12px]",type:"submit",onClick:e[6]||(e[6]=()=>{T.value=n(k),i.value=!1})},{default:g(()=>e[19]||(e[19]=[_(" Add Tags ")])),_:1,__:[19]})])]),_:1},8,["modelValue"])],64)}}});
1export{vt as default};

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.