1import{d as F,bf as X,a as O,ah as R,a8 as N,c as x,w as f,o as v,f as t,h as L,b as r,l as d,X as A,q as T,a6 as me,a5 as ue,y as V,bT as G,g as U,L as de,M as pe,N as _e,u as ye,a0 as ve,$ as fe,aA as he,e as j,i as Ce,k as B,t as I,F as Se,r as we,B as Me,R as ke,G as xe,av as ge,j as Q}from"./DIOtIui4.js";import{_ as be}from"./PmSyh7A7.js";import{_ as Ee}from"./DsmObmbW.js";import{_ as z,a as J}from"./CZok0Rg8.js";import{u as $e,_ as je,a as Ie}from"./DM-CNw3d.js";import{u as D}from"./DZ0-kZf5.js";import{_ as Ae}from"./DU3wVPRe.js";import{b as Le,a as Ue}from"./CM--geaX.js";import{_ as Be}from"./DvvPpSpS.js";import{u as Ne}from"./-NazG4BB.js";import{_ as Ve}from"./DHkpunnk.js";import{_ as Fe}from"./DxeFZapj.js";import{a as Oe}from"./WwI-GCfH.js";import"./Cpj98o6Y.js";import"./C6XU3jXz.js";import"./C4T6KSpF.js";import"./BetH2KAS.js";import"./C7Q_DdcZ.js";import"./BB-EpzLQ.js";import"./DupmalGw.js";import"./CfS6j89A.js";import"./Cz4gNNvc.js";import"./C5Zg79hw.js";import"./DJY19LpX.js";import"./D4esiY7C.js";import"./09u8smkP.js";import"./wSIo5EFd.js";import"./DU50ucFS.js";import"./CbnCiHWg.js";import"./Td_Tic2p.js";import"./B9Ud5sYM.js";import"./DFhUtBKY.js";import"./CgAfL8V0.js";import"./CZJzQwgq.js";import"./D_q09_Ex.js";import"./BKjew6K2.js";import"./Bhk96Xyo.js";import"./CxPi7CvT.js";import"./J7tEAoTX.js";import"./D7OumJ6h.js";import"./bnIKODjr.js";import"./CiQB0dAD.js";import"./BbK79bHe.js";import"./CpxHEf-7.js";import"./CUs8XrJ5.js";import"./D7cDxI21.js";import"./C1ioIIgP.js";import"./BcivcLfI.js";import"./CZiGfzld.js";import"./CNOdoM9v.js";import"./DLBtnyBK.js";import"./rvR07MHo.js";import"./Dv83smFj.js";import"./DsXVY3Co.js";import"./CLkcWahu.js";import"./yCe-AuBG.js";import"./BjFLqLBF.js";import"./BLCgHVwq.js";import"./DKO5sq3b.js";const Re=F({__name:"MysearchEditor",emits:["finish"],setup(H,{emit:S}){const p=D(),{initCsForEdit:b}=X(),M=O(),m=S,o=d(null),l=d(null),h=d(!1),g=async()=>{h.value=!0;try{const a=A(e.undoable.value);a.id=l.value.id,l.value=await p.updateCs(a)}catch(a){console.info(a)}finally{h.value=!1,e.waitSaving.value=!1}},{editstate:n,undo:e}=$e({mode:"mysearch",saveImpl:g});e.autosaveEnabled.value=!0,e.undoable.value=null;const _=async()=>{if(e.undoable.value&&e.undoable.value.id===M.activeMySearch)return;e.waitSaving.value&&await e.forceSave(),e.ignoreChange.value=!0;const a=await p.getCs(M.activeMySearch);delete a.cs.edit,b(a.cs),l.value=a,e.undoable.value=a.cs,e.resetHistory()};return R(()=>{_()}),N(()=>M.activeMySearch,()=>{_()}),(a,c)=>{const y=J,E=je,k=z;return v(),x(k,{class:"jps-mysearch-editor jps-layout-sm-content"},{tools:f(()=>[t(n).undo?(v(),x(y,{key:0,type:"UNDO",onClick:c[0]||(c[0]=u=>{var w;return(w=t(o))==null?void 0:w.undo()}),disabled:!t(n).canUndo},null,8,["disabled"])):L("",!0),t(n).redo?(v(),x(y,{key:1,type:"REDO",onClick:c[1]||(c[1]=u=>{var w;return(w=t(o))==null?void 0:w.redo()}),disabled:!t(n).canRedo},null,8,["disabled"])):L("",!0),r(y,{type:"SAVE",onClick:c[2]||(c[2]=u=>g()),"is-saving":t(h)},null,8,["is-saving"]),r(y,{type:"FINISH",onClick:c[3]||(c[3]=u=>m("finish")),"button-class":["is-primary"]})]),default:f(()=>[t(e).undoable?(v(),x(E,{key:0,ref_key:"csEditor",ref:o,"no-menu":!0,editstate:t(n),onFinish:c[4]||(c[4]=u=>m("finish"))},null,8,["editstate"])):L("",!0)]),_:1})}}}),Te=Object.assign(T(Re,[["__scopeId","data-v-a68a1c3d"]]),{__name:"MysearchEditor"}),De={key:0,class:"search-main"},He=F({__name:"MysearchViewer",emits:["add","copy","delete","import","export","edit"],setup(H,{emit:S}){const p=O(),b=D(),{testCustomSearch:M}=me(),m=S,o=d(null),l=d(),h=async()=>{try{p.activeMySearch?(o.value=(await b.getCs(p.activeMySearch)).cs,l.value=Ne(o.value,M(o.value)),V(()=>{const n=G(window.location.search);n.csid&&(n.csid=o.value.id,l.value.restoreQuery(n))})):(o.value=null,l.value=null)}catch{o.value=null,l.value=null}};R(async()=>{await h()}),N(()=>p.activeMySearch,()=>{h()},{immediate:!0});const g=ue();return N(()=>g.query,()=>{if(l.value){const n=G(window.location.search);n.csid==p.activeMySearch?V(()=>{l.value.restoreQuery()}):p.activeMySearch=n.csid}}),(n,e)=>{const _=J,a=Ae,c=Ue,y=Le,E=Be,k=z;return v(),x(k,{class:"mysearch-viewer"},{tools:f(()=>[r(_,{type:"NEW_SEARCH",onClick:e[0]||(e[0]=u=>m("add"))}),r(_,{type:"COPY",onClick:e[1]||(e[1]=u=>m("copy")),disabled:!t(o)},null,8,["disabled"]),r(_,{type:"DELETE",onClick:e[2]||(e[2]=u=>m("delete")),disabled:!t(o)},null,8,["disabled"]),r(_,{type:"IMPORT",onClick:e[3]||(e[3]=u=>m("import"))}),r(_,{type:"EXPORT",onClick:e[4]||(e[4]=u=>m("export")),disabled:!t(o)},null,8,["disabled"]),r(_,{type:"EDIT",onClick:e[5]||(e[5]=u=>m("edit")),"button-class":["is-primary","is-right"]})]),default:f(()=>[t(o)&&t(l)?(v(),U("div",De,[r(a,{cs:t(o)},null,8,["cs"]),r(c,{ss:t(l)},null,8,["ss"]),r(E,null,{default:f(()=>[r(y,{ss:t(l),nonote:!0},null,8,["ss"])]),_:1})])):L("",!0)]),_:1})}}}),Pe=Object.assign(T(He,[["__scopeId","data-v-f5a722b9"]]),{__name:"MysearchViewer"}),qe={class:"jps-mysearch jps-layout-sm"},Ge={class:"side-menu-item"},Qe={class:"side-menu-item"},Xe=["onClick"],ze=F({__name:"index",async setup(H){let S,p;const{getPageAndCache:b}=de(),{meta:M}=([S,p]=pe(()=>b()),S=await S,p(),S);_e(M);const m=d(!1),{ls:o,lst:l}=ye(),{snackbarSuccess:h}=ve(),{loadingExecuteAndNotify:g}=fe(),n=O(),e=D(),{initCsForEdit:_}=X(),a=d([]),c=d("view"),y=async()=>{a.value=await e.getAll()};R(async()=>{await y(),e.addListener(y)}),he(()=>{e.removeListener(y)});const E=i=>{c.value="view",n.activeMySearch=i},k=d(),u=async()=>{try{const i=await k.value.openAwait({title:{ja:"æ°ããã«ã¹ã¿ã æ¤ç´¢ã®åå",en:"Title for new custom search"}});if(!i)return;n.activeMySearch=await e.addCs({name:{ja:i},keywordFields:["keywords"]},a.value.length)}catch{}},w=d(),W=async()=>{try{const i=await w.value.openAwait(A(a.value));if(!i)return;await e.sort(i.map(s=>s.id))}catch{}},Y=async()=>
1{if(!n.activeMySearch)return;const i=await e.getCs(n.activeMySearch),s=await k.value.openAwait({title:{ja:"ã³ãã¼å
ã®åå",en:"Name for copied custom search"}});if(!s)return;const $=A(i.cs);$.name={ja:s},await e.addCs($,a.value.length),h({ja:s+"ãã³ãã¼ãã¾ãã",en:s+" is copied"})},P=d(),K=async()=>{try{if(!n.activeMySearch)return;const i=await e.getCs(n.activeMySearch);if(!await P.value.openAwait({message:Q.deleteConfirm,messageVars:[o(i.cs.name)]}))return;await g(l(Q.deleteSuccess,o(i.cs.name)),e.deleteCs(n.activeMySearch)),V(async()=>{await y(),n.activeMySearch=a.value.length>0?a.value[0].id:null})}catch(i){console.info(i)}},q=d(),Z=async()=>{try{const i=await q.value.openAwait();if(!i)return;_(i);const s=A(i);await e.addCs(s,a.value.length),h({ja:o(s.name)+"ãã¤ã³ãã¼ããã¾ãã",en:o(s.name)+" is imported"})}catch{}},ee=async()=>{try{const i=await e.getCs(n.activeMySearch),s=A(i.cs);delete s.edit,delete s.permission,Oe(s,o(s.name)+".json")}catch{}};return(i,s)=>{const $=Ce,te=xe,oe=be,ne=Ee,se=Te,ae=Pe,ie=ge,re=Ve,ce=Ie,le=Fe;return v(),U("div",qe,[r(ne,{class:"mysearch-menu","is-clicked":t(m)},{default:f(()=>[j("div",Ge,[r($,{to:"/mynote"},{default:f(()=>[B(I(t(o)({ja:"ãã¤ãã¼ã",en:"My Notes"})),1)]),_:1})]),j("div",Qe,[r($,{to:"/mygallery"},{default:f(()=>[B(I(t(o)({ja:"ãã¤ã®ã£ã©ãªã¼",en:"My Gallery"})),1)]),_:1})]),r(oe,{class:"side-menu-item"},{head:f(()=>[j("h3",null,I(t(o)({ja:"ãã¤ãµã¼ã",en:"My Search"})),1),j("button",{onClick:s[0]||(s[0]=C=>W())},I(t(o)({ja:"ä¸¦ã¹æ¿ã",en:"Sort"})),1)]),list:f(()=>
1[(v(!0),U(Se,null,we(t(a),C=>(v(),U("li",{key:C.id},[j("button",{class:ke(["cs-list-item",{"jps-active":t(n).activeMySearch===C.id}]),onClick:Me(()=>{E(C.id),m.value=!t(m)},["stop"])},[r(te,{name:"mdi/magnify"}),B(" "+I(t(o)(C.cs.name)),1)],10,Xe)]))),128))]),_:1})]),_:1},8,["is-clicked"]),t(c)==="edit"?(v(),x(se,{key:0,class:"mysearch-main",onFinish:s[1]||(s[1]=C=>c.value="view")})):(v(),x(ae,{key:1,class:"mysearch-main",onAdd:u,onDelete:K,onCopy:Y,onImport:Z,onExport:ee,onEdit:s[2]||(s[2]=C=>c.value="edit")})),r(ie,{ref_key:"inputModal",ref:k},null,512),r(re,{ref_key:"confirmModal",ref:P},null,512),r(ce,{ref_key:"csImportModal",ref:q},null,512),r(le,{ref_key:"sortModal",ref:w,renderer:C=>t(o)(C.cs.name)},null,8,["renderer"])])}}}),eo=T(ze,[["__scopeId","data-v-a93f7325"]]);export{eo as default}; 2//# sourceMappingURL=C9Og1wqU.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.