106 lines
33 KiB
JavaScript
106 lines
33 KiB
JavaScript
import{Ct as e,Dt as t,Et as n,H as r,In as i,Jt as a,Kt as o,Ln as s,Mt as c,Ot as l,Pt as u,Rn as d,St as f,U as p,Y as m,Yt as h,_n as g,at as _,bn as v,bt as y,cn as b,d as ee,f as x,g as S,hn as C,ht as w,in as T,it as E,kt as D,m as O,nt as k,ot as A,p as j,qt as M,r as te,tt as N,vn as P,wt as F,xt as I}from"./client-Bz0sY7Lm.js";import{t as ne}from"./Card-DL2KXmKm.js";import{r as re,t as ie}from"./es-D-sREWjF.js";import{i as ae}from"./Suffix-Bm031ONx.js";import{t as oe}from"./Modal-B0y3ZylS.js";import{t as L}from"./use-merged-state-z45UzW9G.js";import{r as se,t as R}from"./Button-BDXKfTYe.js";import{a as z,c as ce,i as le,t as ue}from"./_plugin-vue_export-helper-CaiaXQaI.js";import{n as de,t as B}from"./Upload-D-SSV1zB.js";import{t as fe}from"./use-form-item-Bl3X3aXB.js";import{t as pe}from"./Add-BlaQeLtQ.js";import{t as V}from"./Input-CljXp9mH.js";import{n as me,t as he}from"./Switch-ogA5uVbh.js";import{t as H}from"./Space-BBbNikB6.js";import{t as U}from"./text-BjwmQK96.js";import{D as ge,J as W,g as _e,k as ve,nt as ye,ut as G}from"./index-BtdmUaqY.js";import{n as K,r as q,t as be}from"./application-Bg005825.js";import{t as xe}from"./MessagePaper-C6R1Irzd.js";var Se=D({name:`ArrowDown`,render(){return c(`svg`,{viewBox:`0 0 28 28`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},c(`g`,{stroke:`none`,"stroke-width":`1`,"fill-rule":`evenodd`},c(`g`,{"fill-rule":`nonzero`},c(`path`,{d:`M23.7916,15.2664 C24.0788,14.9679 24.0696,14.4931 23.7711,14.206 C23.4726,13.9188 22.9978,13.928 22.7106,14.2265 L14.7511,22.5007 L14.7511,3.74792 C14.7511,3.33371 14.4153,2.99792 14.0011,2.99792 C13.5869,2.99792 13.2511,3.33371 13.2511,3.74793 L13.2511,22.4998 L5.29259,14.2265 C5.00543,13.928 4.53064,13.9188 4.23213,14.206 C3.93361,14.4931 3.9244,14.9679 4.21157,15.2664 L13.2809,24.6944 C13.6743,25.1034 14.3289,25.1034 14.7223,24.6944 L23.7916,15.2664 Z`}))))}}),Ce=D({name:`ArrowUp`,render(){return c(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},c(`g`,{fill:`none`},c(`path`,{d:`M3.13 9.163a.5.5 0 1 0 .74.674L9.5 3.67V17.5a.5.5 0 0 0 1 0V3.672l5.63 6.165a.5.5 0 0 0 .738-.674l-6.315-6.916a.746.746 0 0 0-.632-.24a.746.746 0 0 0-.476.24L3.131 9.163z`,fill:`currentColor`})))}}),we=k(`input-group`,`
|
|
display: inline-flex;
|
|
width: 100%;
|
|
flex-wrap: nowrap;
|
|
vertical-align: bottom;
|
|
`,[N(`>`,[k(`input`,[N(`&:not(:last-child)`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`),N(`&:not(:first-child)`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
margin-left: -1px!important;
|
|
`)]),k(`button`,[N(`&:not(:last-child)`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`,[E(`state-border, border`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`)]),N(`&:not(:first-child)`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`,[E(`state-border, border`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`)])]),N(`*`,[N(`&:not(:last-child)`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`,[N(`>`,[k(`input`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`),k(`base-selection`,[k(`base-selection-label`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`),k(`base-selection-tags`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`),E(`box-shadow, border, state-border`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`)])])]),N(`&:not(:first-child)`,`
|
|
margin-left: -1px!important;
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`,[N(`>`,[k(`input`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`),k(`base-selection`,[k(`base-selection-label`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`),k(`base-selection-tags`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`),E(`box-shadow, border, state-border`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`)])])])])])]),J=D({name:`InputGroup`,props:{},setup(e){let{mergedClsPrefixRef:t}=p(e);return O(`-input-group`,we,t),{mergedClsPrefix:t}},render(){let{mergedClsPrefix:e}=this;return c(`div`,{class:`${e}-input-group`},this.$slots)}}),Y=`0!important`,Te=`-1px!important`;function X(e){return _(`${e}-type`,[N(`& +`,[k(`button`,{},[_(`${e}-type`,[E(`border`,{borderLeftWidth:Y}),E(`state-border`,{left:Te})])])])])}function Z(e){return _(`${e}-type`,[N(`& +`,[k(`button`,[_(`${e}-type`,[E(`border`,{borderTopWidth:Y}),E(`state-border`,{top:Te})])])])])}var Ee=k(`button-group`,`
|
|
flex-wrap: nowrap;
|
|
display: inline-flex;
|
|
position: relative;
|
|
`,[A(`vertical`,{flexDirection:`row`},[A(`rtl`,[k(`button`,[N(`&:first-child:not(:last-child)`,`
|
|
margin-right: ${Y};
|
|
border-top-right-radius: ${Y};
|
|
border-bottom-right-radius: ${Y};
|
|
`),N(`&:last-child:not(:first-child)`,`
|
|
margin-left: ${Y};
|
|
border-top-left-radius: ${Y};
|
|
border-bottom-left-radius: ${Y};
|
|
`),N(`&:not(:first-child):not(:last-child)`,`
|
|
margin-left: ${Y};
|
|
margin-right: ${Y};
|
|
border-radius: ${Y};
|
|
`),X(`default`),_(`ghost`,[X(`primary`),X(`info`),X(`success`),X(`warning`),X(`error`)])])])]),_(`vertical`,{flexDirection:`column`},[k(`button`,[N(`&:first-child:not(:last-child)`,`
|
|
margin-bottom: ${Y};
|
|
margin-left: ${Y};
|
|
margin-right: ${Y};
|
|
border-bottom-left-radius: ${Y};
|
|
border-bottom-right-radius: ${Y};
|
|
`),N(`&:last-child:not(:first-child)`,`
|
|
margin-top: ${Y};
|
|
margin-left: ${Y};
|
|
margin-right: ${Y};
|
|
border-top-left-radius: ${Y};
|
|
border-top-right-radius: ${Y};
|
|
`),N(`&:not(:first-child):not(:last-child)`,`
|
|
margin: ${Y};
|
|
border-radius: ${Y};
|
|
`),Z(`default`),_(`ghost`,[Z(`primary`),Z(`info`),Z(`success`),Z(`warning`),Z(`error`)])])])]),De=D({name:`ButtonGroup`,props:{size:String,vertical:Boolean},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:n}=p(e);return O(`-button-group`,Ee,t),M(se,e),{rtlEnabled:S(`ButtonGroup`,n,t),mergedClsPrefix:t}},render(){let{mergedClsPrefix:e}=this;return c(`div`,{class:[`${e}-button-group`,this.rtlEnabled&&`${e}-button-group--rtl`,this.vertical&&`${e}-button-group--vertical`],role:`group`},this.$slots)}});function Oe(){return _e}var ke=x({name:`DynamicInput`,common:ee,peers:{Input:ve,Button:ge},self:Oe}),Ae=m(`n-dynamic-input`),je=D({name:`DynamicInputInputPreset`,props:{clsPrefix:{type:String,required:!0},value:{type:String,default:``},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(){let{mergedThemeRef:e,placeholderRef:t}=u(Ae);return{mergedTheme:e,placeholder:t}},render(){let{mergedTheme:e,placeholder:t,value:n,clsPrefix:r,onUpdateValue:i,disabled:a}=this;return c(`div`,{class:`${r}-dynamic-input-preset-input`},c(V,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:n,placeholder:t,onUpdateValue:i,disabled:a}))}}),Me=D({name:`DynamicInputPairPreset`,props:{clsPrefix:{type:String,required:!0},value:{type:Object,default:()=>({key:``,value:``})},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(e){let{mergedThemeRef:t,keyPlaceholderRef:n,valuePlaceholderRef:r}=u(Ae);return{mergedTheme:t,keyPlaceholder:n,valuePlaceholder:r,handleKeyInput(t){e.onUpdateValue({key:t,value:e.value.value})},handleValueInput(t){e.onUpdateValue({key:e.value.key,value:t})}}},render(){let{mergedTheme:e,keyPlaceholder:t,valuePlaceholder:n,value:r,clsPrefix:i,disabled:a}=this;return c(`div`,{class:`${i}-dynamic-input-preset-pair`},c(V,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:r.key,class:`${i}-dynamic-input-pair-input`,placeholder:t,onUpdateValue:this.handleKeyInput,disabled:a}),c(V,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:r.value,class:`${i}-dynamic-input-pair-input`,placeholder:n,onUpdateValue:this.handleValueInput,disabled:a}))}}),Ne=k(`dynamic-input`,{width:`100%`},[k(`dynamic-input-item`,`
|
|
margin-bottom: 10px;
|
|
display: flex;
|
|
flex-wrap: nowrap;
|
|
`,[k(`dynamic-input-preset-input`,{flex:1,alignItems:`center`}),k(`dynamic-input-preset-pair`,`
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
`,[k(`dynamic-input-pair-input`,[N(`&:first-child`,{"margin-right":`12px`})])]),E(`action`,`
|
|
align-self: flex-start;
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
flex-shrink: 0;
|
|
flex-grow: 0;
|
|
margin: var(--action-margin);
|
|
`,[_(`icon`,{cursor:`pointer`})]),N(`&:last-child`,{marginBottom:0})]),k(`form-item`,`
|
|
padding-top: 0 !important;
|
|
margin-right: 0 !important;
|
|
`,[k(`form-item-blank`,{paddingTop:`0 !important`})])]),Q=new WeakMap,$=D({name:`DynamicInput`,props:Object.assign(Object.assign({},j.props),{max:Number,min:{type:Number,default:0},value:Array,defaultValue:{type:Array,default:()=>[]},preset:{type:String,default:`input`},keyField:String,itemClass:String,itemStyle:[String,Object],keyPlaceholder:{type:String,default:``},valuePlaceholder:{type:String,default:``},placeholder:{type:String,default:``},disabled:Boolean,showSortButton:Boolean,createButtonProps:Object,onCreate:Function,onRemove:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClear:Function,onInput:[Function,Array]}),setup(e,{slots:t}){let{mergedComponentPropsRef:n,mergedClsPrefixRef:i,mergedRtlRef:a,inlineThemeDisabled:o}=p(),s=u(fe,null),c=C(e.defaultValue),l=L(P(e,`value`),c),d=j(`DynamicInput`,`-dynamic-input`,Ne,ke,e,i),f=y(()=>{let{value:t}=l;if(Array.isArray(t)){let{max:n}=e;return n!==void 0&&t.length>=n}return!1}),m=y(()=>{let{value:t}=l;return Array.isArray(t)?t.length<=e.min:!0}),h=y(()=>n?.value?.DynamicInput?.buttonSize);function _(t){let{onInput:n,"onUpdate:value":r,onUpdateValue:i}=e;n&&ce(n,t),r&&ce(r,t),i&&ce(i,t),c.value=t}function v(e,t){if(typeof e!=`object`||!e)return t;let n=b(e)?g(e):e,r=Q.get(n);return r===void 0&&Q.set(n,r=ye()),r}function ee(e,t){let{value:n}=l,r=Array.from(n??[]),i=r[e];if(r[e]=t,i&&t&&typeof i==`object`&&typeof t==`object`){let e=b(i)?g(i):i,n=b(t)?g(t):t,r=Q.get(e);r!==void 0&&Q.set(n,r)}_(r)}function x(){w(-1)}function w(n){let{value:r}=l,{onCreate:i}=e,a=Array.from(r??[]);if(i)a.splice(n+1,0,i(n+1)),_(a);else if(t.default)a.splice(n+1,0,null),_(a);else switch(e.preset){case`input`:a.splice(n+1,0,``),_(a);break;case`pair`:a.splice(n+1,0,{key:``,value:``}),_(a);break}}function T(t){let{value:n}=l;if(!Array.isArray(n))return;let{min:r}=e;if(n.length<=r)return;let{onRemove:i}=e;i&&i(t);let a=Array.from(n);a.splice(t,1),_(a)}function E(e,t,n){if(t<0||n<0||t>=e.length||n>=e.length||t===n)return;let r=e[t];e[t]=e[n],e[n]=r}function D(e,t){let{value:n}=l;if(!Array.isArray(n))return;let r=Array.from(n);e===`up`&&E(r,t,t-1),e===`down`&&E(r,t,t+1),_(r)}M(Ae,{mergedThemeRef:d,keyPlaceholderRef:P(e,`keyPlaceholder`),valuePlaceholderRef:P(e,`valuePlaceholder`),placeholderRef:P(e,`placeholder`)});let O=S(`DynamicInput`,a,i),k=y(()=>{let{self:{actionMargin:e,actionMarginRtl:t}}=d.value;return{"--action-margin":e,"--action-margin-rtl":t}}),A=o?r(`dynamic-input`,void 0,k,e):void 0;return{locale:ae(`DynamicInput`).localeRef,rtlEnabled:O,buttonSize:h,mergedClsPrefix:i,NFormItem:s,uncontrolledValue:c,mergedValue:l,insertionDisabled:f,removeDisabled:m,handleCreateClick:x,ensureKey:v,handleValueChange:ee,remove:T,move:D,createItem:w,mergedTheme:d,cssVars:o?void 0:k,themeClass:A?.themeClass,onRender:A?.onRender}},render(){let{$slots:e,itemClass:t,buttonSize:n,mergedClsPrefix:r,mergedValue:i,locale:a,mergedTheme:o,keyField:s,itemStyle:l,preset:u,showSortButton:d,NFormItem:f,ensureKey:p,handleValueChange:m,remove:h,createItem:g,move:_,onRender:v,disabled:y}=this;return v?.(),c(`div`,{class:[`${r}-dynamic-input`,this.rtlEnabled&&`${r}-dynamic-input--rtl`,this.themeClass],style:this.cssVars},!Array.isArray(i)||i.length===0?c(R,Object.assign({block:!0,ghost:!0,dashed:!0,size:n},this.createButtonProps,{disabled:this.insertionDisabled||y,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,onClick:this.handleCreateClick}),{default:()=>le(e[`create-button-default`],()=>[a.create]),icon:()=>le(e[`create-button-icon`],()=>[c(W,{clsPrefix:r},{default:()=>c(pe,null)})])}):i.map((a,v)=>c(`div`,{key:s?a[s]:p(a,v),"data-key":s?a[s]:p(a,v),class:[`${r}-dynamic-input-item`,t],style:l},z(e.default,{value:i[v],index:v},()=>[u===`input`?c(je,{disabled:y,clsPrefix:r,value:i[v],parentPath:f?f.path.value:void 0,path:f?.path.value?`${f.path.value}[${v}]`:void 0,onUpdateValue:e=>{m(v,e)}}):u===`pair`?c(Me,{disabled:y,clsPrefix:r,value:i[v],parentPath:f?f.path.value:void 0,path:f?.path.value?`${f.path.value}[${v}]`:void 0,onUpdateValue:e=>{m(v,e)}}):null]),z(e.action,{value:i[v],index:v,create:g,remove:h,move:_},()=>[c(`div`,{class:`${r}-dynamic-input-item__action`},c(De,{size:n},{default:()=>[c(R,{disabled:this.removeDisabled||y,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,circle:!0,onClick:()=>{h(v)}},{icon:()=>c(W,{clsPrefix:r},{default:()=>c(me,null)})}),c(R,{disabled:this.insertionDisabled||y,circle:!0,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,onClick:()=>{g(v)}},{icon:()=>c(W,{clsPrefix:r},{default:()=>c(pe,null)})}),d?c(R,{disabled:v===0||y,circle:!0,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,onClick:()=>{_(`up`,v)}},{icon:()=>c(W,{clsPrefix:r},{default:()=>c(Ce,null)})}):null,d?c(R,{disabled:v===i.length-1||y,circle:!0,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,onClick:()=>{_(`down`,v)}},{icon:()=>c(W,{clsPrefix:r},{default:()=>c(Se,null)})}):null]}))]))))}}),Pe={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 24 24`},Fe=D({name:`CloseOutlined`,render:function(e,t){return o(),F(`svg`,Pe,t[0]||=[I(`path`,{d:`M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z`,fill:`currentColor`},null,-1)])}}),Ie={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 24 24`},Le=D({name:`LockOutlined`,render:function(e,t){return o(),F(`svg`,Ie,t[0]||=[I(`path`,{d:`M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2z`,fill:`currentColor`},null,-1)])}}),Re={key:0},ze={class:`intro-text font`},Be={key:0,class:`intro-audio-block`},Ve=[`src`],He={class:`message-content`},Ue={key:0},We={key:1,class:`intro-empty`},Ge={key:2,class:`intro-audio-block`},Ke=[`src`],qe={key:2,class:`place-block`},Je={class:`intro-edit-audio`},Ye=[`src`],Xe={class:`slot-block`},Ze=ue(D({__name:`IntroBlock`,props:{introduction:{},mode:{}},emits:[`update:mode`],setup(n,{emit:r}){let i=n,a=r,s=e=>{a(`update:mode`,e)},c=y(()=>!!i.introduction?.text),u=y(()=>!!i.introduction?.audio),p=y(()=>{let e=i.introduction?.audio;if(e)return/^https?:\/\//i.test(e)?e:`${te()}/api/files/${encodeURIComponent(e)}`}),m=()=>{i.introduction&&(i.introduction.audio=``,i.introduction.fileList=void 0)};return(r,a)=>(o(),F(w,null,[n.mode==`show`?(o(),F(`div`,Re,[l(xe,null,{default:T(()=>[a[4]||=I(`div`,{class:`font`},`Вступление`,-1),a[5]||=I(`hr`,{class:`intro-hr`},null,-1),I(`div`,ze,d(n.introduction.text),1),u.value?(o(),F(`div`,Be,[I(`audio`,{src:p.value,controls:``,preload:`none`,class:`intro-audio`},null,8,Ve)])):e(``,!0)]),_:1})])):e(``,!0),n.mode==`show-editor`?(o(),F(`div`,{key:1,class:`place-block-hover show-editor-block`,onClick:a[0]||=e=>s(`edit`)},[a[6]||=I(`div`,{class:`message-header`},`Вступление`,-1),a[7]||=I(`hr`,{class:`hr`},null,-1),I(`div`,He,[c.value?(o(),F(`span`,Ue,d(n.introduction.text),1)):(o(),F(`span`,We,`Введение не задано — нажмите, чтобы добавить`)),u.value?(o(),F(`div`,Ge,[I(`audio`,{src:p.value,controls:``,preload:`none`,class:`intro-audio`},null,8,Ke)])):e(``,!0)])])):e(``,!0),n.mode==`edit`?(o(),F(`div`,qe,[l(v(H),{vertical:``},{default:T(()=>[a[11]||=I(`p`,{class:`settings-header`},`Текст вступления`,-1),l(v(V),{value:i.introduction.text,"onUpdate:value":a[1]||=e=>i.introduction.text=e,type:`textarea`,autosize:{minRows:4,maxRows:12},placeholder:`Дорогие сыщики! В этом деле вам предстоит...`},null,8,[`value`]),a[12]||=I(`p`,{class:`settings-header`},`Аудио вступления`,-1),I(`div`,Je,[l(v(H),{vertical:``},{default:T(()=>[u.value?(o(),F(`audio`,{key:0,src:p.value,controls:``,preload:`none`,class:`intro-audio`},null,8,Ye)):(o(),f(v(U),{key:1,depth:`3`},{default:T(()=>[...a[8]||=[t(`Аудио не задано`,-1)]]),_:1})),l(v(R),{onClick:a[2]||=e=>m(),disabled:!u.value},{default:T(()=>[...a[9]||=[t(`Убрать аудио`,-1)]]),_:1},8,[`disabled`])]),_:1}),l(v(B),{"directory-dnd":``,max:1,"file-list":i.introduction.fileList,"onUpdate:fileList":a[3]||=e=>i.introduction.fileList=e},{default:T(()=>[l(v(de),null,{default:T(()=>[l(v(U),{style:{"font-size":`16px`}},{default:T(()=>[...a[10]||=[t(` Щелкните или перетащите аудиофайл в эту область для загрузки `,-1)]]),_:1})]),_:1})]),_:1},8,[`file-list`])]),I(`div`,Xe,[h(r.$slots,`default`,{},void 0,!0)])]),_:3})])):e(``,!0)],64))}}),[[`__scopeId`,`data-v-11f63e45`]]),Qe={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 24 24`},$e=D({name:`Key24Regular`,render:function(e,t){return o(),F(`svg`,Qe,t[0]||=[I(`g`,{fill:`none`},[I(`path`,{d:`M18.25 7a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0zM15.5 2.05A6.554 6.554 0 0 0 8.95 8.6c0 .387.05.76.11 1.104a.275.275 0 0 1-.07.244l-6.235 6.236a2.75 2.75 0 0 0-.806 1.944V20.3c0 .966.784 1.75 1.75 1.75h2.5a1.75 1.75 0 0 0 1.75-1.75v-1.25H9.7c.69 0 1.25-.56 1.25-1.25v-1.75h1.75a1.25 1.25 0 0 0 1.25-1.204c.496.128 1.02.204 1.55.204a6.554 6.554 0 0 0 6.55-6.55c0-3.631-2.953-6.45-6.55-6.45zM10.45 8.6a5.054 5.054 0 0 1 5.05-5.05c2.802 0 5.05 2.181 5.05 4.95a5.054 5.054 0 0 1-5.05 5.05c-.68 0-1.38-.171-2.005-.44a.75.75 0 0 0-1.046.69v.75H10.7c-.69 0-1.25.56-1.25 1.25v1.75H7.7c-.69 0-1.25.56-1.25 1.25v1.5a.25.25 0 0 1-.25.25H3.7a.25.25 0 0 1-.25-.25v-2.172c0-.331.132-.65.366-.884l6.236-6.235a1.774 1.774 0 0 0 .486-1.564a4.917 4.917 0 0 1-.088-.845z`,fill:`currentColor`})],-1)])}}),et={key:1,class:`place-block`},tt={class:`message-header`},nt={class:`message-content`},rt={key:0},it=[`src`,`alt`],at={class:`door-button-label`},ot={key:0,class:`hr`},st={class:`application-name`},ct=[`onClick`],lt=[`src`,`alt`],ut=[`src`],dt=[`href`],ft={class:`gray-block`},pt={key:0},mt={key:3},ht={class:`message-show-header font`},gt={key:0,class:`mcp-label`,title:`Ход сделан через MCP`},_t={class:`message-show-content font`},vt={key:0},yt=[`src`,`alt`],bt=[`src`,`alt`],xt={key:2,class:`show-applications-block`},St=[`onClick`],Ct=[`src`,`alt`],wt={key:0,class:`show-hr`},Tt=[`onClick`],Et={class:`button-dialog-text`},Dt={key:1,class:`show-hr`},Ot=[`href`],kt={class:`application-label`},At=[`src`],jt={key:4},Mt={class:`message-header font`},Nt={key:0,class:`mcp-label`,title:`Ход сделан через MCP`},Pt={key:5,class:`place-block`},Ft=[`src`,`alt`],It={style:{display:`flex`,"flex-direction":`column`,width:`100%`}},Lt={key:0,class:`application-edit-file`},Rt=[`src`,`alt`],zt=[`src`],Bt=[`href`],Vt={style:{display:`flex`,"flex-direction":`column`}},Ht={style:{display:`flex`,"flex-direction":`column`,width:`100%`}},Ut={class:`door-add-block`},Wt={class:`door-field`},Gt={style:{"align-items":`center`,display:`flex`,width:`100%`}},Kt={style:{"align-items":`center`,display:`flex`,width:`100%`}},qt={class:`slot-block`},Jt={key:0,class:`view-application-image-block`},Yt=[`src`,`alt`],Xt=[`src`],Zt=[`src`],Qt={key:3,class:`view-application-image-block`},$t=[`src`,`alt`],en=ue(D({__name:`PlaceBlock`,props:{newPlaceCode:{},newPlaceName:{},newPlaceText:{},place:{},mode:{},mcp:{type:Boolean,default:!1},addAction:{}},emits:[`update:newPlaceCode`,`update:newPlaceName`,`update:newPlaceText`,`update:mode`,`navigate`],setup(r,{emit:c}){let u=r,f=c,p=e=>{f(`update:newPlaceCode`,e)},m=e=>{f(`update:newPlaceName`,e)},g=e=>{f(`update:newPlaceText`,e)},_=e=>{f(`update:mode`,e)};function b(){return{name:void 0,image:void 0,file_type:void 0}}function ee(){return{code:void 0,name:void 0,keys:void 0}}function x(){return{name:void 0}}function S(e){return e}function E(e){e.image=void 0,e.file_type=void 0,e.fileList=void 0}let D=C(null),O=C(null),k=C(!1),A=y(()=>O.value?O.value.url:K(D.value||void 0)==`image`?q(D.value?.image):``);function j(e){D.value=e,O.value=null,k.value=!0}function M(e,t){O.value={title:e,url:t},D.value=null,k.value=!0}function te(){k.value=!1,D.value=null,O.value=null}function N(e){let t=e||``;if(t.length==0)return{before:``,after:``};let n=Math.min(t.length,Math.max(120,Math.floor(t.length*.45))),r=-1,i=1/0;for(let e=0;e<t.length;e++){let a=t[e];if(a!=`
|
|
`&&a!=` `)continue;let o=Math.abs(t.length-e-n);o<i&&(i=o,r=e)}return r<0?{before:t,after:``}:{before:t.slice(0,r),after:t.slice(r)}}let P=y(()=>N(u.place?.text).before),ae=y(()=>N(u.place?.text).after),L=y(()=>u.place?.image?null:(u.place?.applications||[]).find(e=>K(e)==`image`&&e.image)||null),se=y(()=>(u.place?.applications||[]).filter(e=>e===L.value?!1:K(e)==`image`&&e.image)),z=y(()=>(u.place?.applications||[]).filter(e=>e===L.value?!1:!(K(e)==`image`&&e.image)));return(c,y)=>(o(),F(w,null,[r.mode==`mini-add`?(o(),F(`div`,{key:0,class:`place-block-hover show-editor-block`,onClick:y[0]||=e=>_(`add`)},[...y[21]||=[I(`p`,{class:`place-image-plus`},`+`,-1)]])):e(``,!0),r.mode==`add`?(o(),F(`div`,et,[l(v(H),{vertical:``},{default:T(()=>[l(v(J),null,{default:T(()=>[l(v(V),{style:{width:`20%`},value:r.newPlaceCode,"onUpdate:value":p,type:`text`,placeholder:`Ы-1`},null,8,[`value`]),l(v(V),{style:{width:`80%`},value:r.newPlaceName,"onUpdate:value":m,type:`text`,placeholder:`Дом №Ы`},null,8,[`value`])]),_:1}),l(v(V),{value:r.newPlaceText,"onUpdate:value":g,type:`textarea`,autosize:{minRows:3},placeholder:`В начале было слово...`},null,8,[`value`]),h(c.$slots,`default`,{},void 0,!0)]),_:3})])):e(``,!0),r.mode==`show-editor`?(o(),F(`div`,{key:2,class:`place-block-hover show-editor-block`,onClick:y[4]||=e=>_(`edit`)},[I(`div`,tt,d(u.place?.code)+`: `+d(u.place?.name),1),y[22]||=I(`hr`,{class:`hr`},null,-1),I(`div`,nt,[u.place?.image?(o(),F(`div`,rt,[I(`div`,{class:`message-image-border`,onClick:y[1]||=G(e=>M(u.place?.name||``,u.place?.image||``),[`stop`])},[I(`img`,{src:u.place?.image,alt:u.place?.name||`Изображение точки`,class:`message-image`},null,8,it)])])):e(``,!0),I(`span`,null,d(u.place?.text),1)]),(o(!0),F(w,null,a(u.place?.doors,e=>(o(),F(`div`,{key:e.code,class:`door-block`},[l(v(R),{class:`door-button`,onClick:G(t=>f(`navigate`,e.code),[`stop`])},{default:T(()=>[I(`span`,at,d(e.name||e.code||`Перейти к точке`),1)]),_:2},1032,[`onClick`]),(o(!0),F(w,null,a(e.keys,e=>(o(),F(`span`,{key:e.name,class:`key-block`},[l(v(ie),{class:`lock-icon`},{default:T(()=>[l(v(Le))]),_:1}),t(` `+d(e.name),1)]))),128))]))),128)),u.place?.applications?.length?(o(),F(`hr`,ot)):e(``,!0),(o(!0),F(w,null,a(u.place?.applications,t=>(o(),F(`div`,{class:`message-footer application-block`,key:t.name},[I(`div`,st,`Приложение: `+d(t.name),1),v(K)(t)==`image`&&t.image?(o(),F(`div`,{key:0,class:`application-image-border`,onClick:G(e=>j(t),[`stop`])},[I(`img`,{src:v(q)(t.image),alt:t.name||`Изображение улики`,class:`application-image`},null,8,lt)],8,ct)):v(K)(t)==`audio`&&t.image?(o(),F(`audio`,{key:1,src:v(q)(t.image),controls:``,preload:`none`,class:`application-audio`,onClick:y[2]||=G(()=>{},[`stop`])},null,8,ut)):v(K)(t)==`pdf`&&t.image?(o(),F(`a`,{key:2,href:v(q)(t.image),target:`_blank`,rel:`noopener`,class:`application-pdf-link`,onClick:y[3]||=G(()=>{},[`stop`])},` PDF `,8,dt)):e(``,!0)]))),128)),I(`p`,ft,[u.place?.hidden?(o(),F(`span`,pt,` Скрытая точка `)):e(``,!0),(o(!0),F(w,null,a(u.place?.keys,e=>(o(),F(`span`,{key:e.name,class:`key-block`},[l(v(ie),{class:`lock-icon`},{default:T(()=>[l(v($e))]),_:1}),t(` `+d(e.name),1)]))),128))])])):e(``,!0),r.mode==`show`?(o(),F(`div`,mt,[l(xe,null,{default:T(()=>[I(`div`,ht,[r.mcp?(o(),F(`span`,gt,`MCP`)):e(``,!0),t(` `+d(r.place?.code)+`: `+d(r.place?.name)+` `,1),I(`span`,{class:`collapse-icon collapse-icon-up`,onClick:y[5]||=e=>_(`show-collapse`)})]),y[23]||=I(`hr`,{class:`show-hr`},null,-1),I(`div`,_t,[r.place?.image?.length?(o(),F(`div`,vt,[I(`div`,{class:`message-image-border`,onClick:y[6]||=e=>M(r.place?.name||``,r.place?.image||``)},[I(`img`,{src:r.place?.image,alt:r.place?.name||`Изображение точки`,class:`message-image`},null,8,yt)])])):L.value?(o(),F(`div`,{key:1,class:`message-image-border`,onClick:y[7]||=e=>j(L.value)},[I(`img`,{src:v(q)(L.value.image),alt:L.value.name||`Изображение улики`,class:`message-image`},null,8,bt)])):e(``,!0),I(`span`,null,d(P.value),1),se.value.length?(o(),F(`div`,xt,[(o(!0),F(w,null,a(se.value,e=>(o(),F(`div`,{class:`show-application`,key:e.name},[I(`div`,{class:`application-image-block`,onClick:t=>j(e)},[I(`img`,{src:v(q)(e.image),alt:e.name||`Изображение улики`,class:`application-image`},null,8,Ct)],8,St)]))),128))])):e(``,!0),I(`span`,null,d(ae.value),1)]),u.place?.doors?.length?(o(),F(`hr`,wt)):e(``,!0),(o(!0),F(w,null,a(u.place?.doors,e=>(o(),F(`div`,{key:e.code,class:`button-dialog font`,onClick:t=>r.addAction(e.code)},[I(`div`,Et,d(e.code)+` `+d(e.name),1)],8,Tt))),128)),z.value.length?(o(),F(`hr`,Dt)):e(``,!0),(o(!0),F(w,null,a(z.value,t=>(o(),F(`div`,{class:`message-show-footer font`,key:t.name},[v(K)(t)==`pdf`&&t.image?(o(),F(`a`,{key:0,href:v(q)(t.image),target:`_blank`,rel:`noopener`,class:`pdf-application-name`},` Приложение: `+d(t.name),9,Ot)):(o(),F(w,{key:1},[I(`div`,kt,`Приложение: `+d(t.name),1),v(K)(t)==`audio`&&t.image?(o(),F(`audio`,{key:0,src:v(q)(t.image),controls:``,preload:`none`,class:`application-audio`},null,8,At)):e(``,!0)],64))]))),128))]),_:1})])):e(``,!0),r.mode==`show-collapse`?(o(),F(`div`,jt,[l(xe,null,{default:T(()=>[I(`div`,Mt,[r.mcp?(o(),F(`span`,Nt,`MCP`)):e(``,!0),t(` `+d(r.place?.code)+`: `+d(r.place?.name)+` `,1),I(`span`,{class:`collapse-icon`,onClick:y[8]||=e=>_(`show`)})])]),_:1})])):e(``,!0),r.mode==`edit`?(o(),F(`div`,Pt,[l(v(H),{vertical:``},{default:T(()=>[l(v(J),null,{default:T(()=>[l(v(V),{style:{width:`20%`},value:u.place.code,"onUpdate:value":y[9]||=e=>u.place.code=e,type:`text`,placeholder:`Ы-1`},null,8,[`value`]),l(v(V),{style:{width:`80%`},value:u.place.name,"onUpdate:value":y[10]||=e=>u.place.name=e,type:`text`,placeholder:`Дом №Ы`},null,8,[`value`])]),_:1}),l(v(V),{value:u.place.text,"onUpdate:value":y[11]||=e=>u.place.text=e,type:`textarea`,autosize:{minRows:3},placeholder:`В начале было слово...`},null,8,[`value`]),y[37]||=I(`p`,{class:`settings-header`},`Картинка`,-1),I(`div`,null,[l(v(H),null,{default:T(()=>[l(v(H),{vertical:``},{default:T(()=>[I(`img`,{src:u.place.image,alt:u.place?.name||`Изображение точки`,class:`message-edit-image`},null,8,Ft),l(v(R),{onClick:y[12]||=e=>(u.place.image=``,u.place.fileList=void 0)},{default:T(()=>[...y[24]||=[t(`Убрать картинку`,-1)]]),_:1})]),_:1}),l(v(H),{vertical:``},{default:T(()=>[l(v(V),{value:u.place.image,"onUpdate:value":y[13]||=e=>u.place.image=e,type:`text`,placeholder:`Не задано`,disabled:``},null,8,[`value`]),l(v(B),{"directory-dnd":``,max:1,"file-list":u.place.fileList,"onUpdate:fileList":y[14]||=e=>u.place.fileList=e},{default:T(()=>[l(v(de),null,{default:T(()=>[l(v(U),{style:{"font-size":`16px`}},{default:T(()=>[...y[25]||=[t(` Щелкните или перетащите файл в эту область для загрузки `,-1)]]),_:1})]),_:1})]),_:1},8,[`file-list`])]),_:1})]),_:1})]),y[38]||=I(`p`,{class:`settings-header`},`Видимость точки`,-1),l(v(he),{value:u.place.hidden,"onUpdate:value":y[15]||=e=>u.place.hidden=e},{checked:T(()=>[...y[26]||=[t(` Скрытая точка `,-1)]]),unchecked:T(()=>[...y[27]||=[t(` Обычная точка `,-1)]]),_:1},8,[`value`]),y[39]||=t(` Улики `,-1),l(v($),{value:u.place.applications,"onUpdate:value":y[16]||=e=>u.place.applications=e,"on-create":b},{"create-button-default":T(()=>[...y[28]||=[t(` Добавить улику `,-1)]]),default:T(({value:n})=>[I(`div`,It,[l(v(V),{value:n.name,"onUpdate:value":e=>n.name=e,type:`text`,placeholder:`Название`},null,8,[`value`,`onUpdate:value`]),n.image?(o(),F(`div`,Lt,[l(v(H),{align:`center`,justify:`space-between`},{default:T(()=>[l(v(U),{depth:`3`},{default:T(()=>[t(d(v(be)(n.image))+` `,1),l(v(re),{size:`small`,bordered:!1},{default:T(()=>[t(d(v(K)(n)||`файл`),1)]),_:2},1024)]),_:2},1024),l(v(R),{size:`small`,quaternary:``,onClick:e=>E(S(n))},{default:T(()=>[...y[29]||=[t(` Убрать файл `,-1)]]),_:1},8,[`onClick`])]),_:2},1024),v(K)(n)==`image`?(o(),F(`img`,{key:0,src:v(q)(n.image),alt:n.name||`Изображение улики`,class:`application-edit-image`},null,8,Rt)):v(K)(n)==`audio`?(o(),F(`audio`,{key:1,src:v(q)(n.image),controls:``,preload:`none`,class:`application-edit-audio`},null,8,zt)):v(K)(n)==`pdf`?(o(),F(`a`,{key:2,href:v(q)(n.image),target:`_blank`,rel:`noopener`,class:`application-pdf-link`},` PDF `,8,Bt)):e(``,!0)])):e(``,!0),l(v(B),{max:1,"file-list":S(n).fileList,"onUpdate:fileList":e=>S(n).fileList=e,accept:`image/*,application/pdf,audio/*`},{default:T(()=>[l(v(R),{size:`small`},{default:T(()=>[...y[30]||=[t(`Загрузить файл улики`,-1)]]),_:1})]),_:1},8,[`file-list`,`onUpdate:fileList`])])]),_:1},8,[`value`]),y[40]||=t(` Действия `,-1),l(v($),{value:u.place.doors,"onUpdate:value":y[17]||=e=>u.place.doors=e,"on-create":ee},{"create-button-default":T(()=>[...y[31]||=[t(` Добавить действие `,-1)]]),action:T(({index:e,create:n,remove:r})=>[I(`div`,Vt,[l(v(R),{onClick:()=>n(e),class:`plus-minus-buttons`},{default:T(()=>[...y[32]||=[t(`+`,-1)]]),_:1},8,[`onClick`]),l(v(R),{onClick:()=>r(e),class:`plus-minus-buttons`},{default:T(()=>[...y[33]||=[t(`-`,-1)]]),_:1},8,[`onClick`])])]),default:T(({value:e})=>[I(`div`,Ht,[I(`div`,Ut,[l(v(J),null,{default:T(()=>[l(v(V),{style:{width:`30%`},value:e.code,"onUpdate:value":t=>e.code=t,type:`text`,placeholder:`Код`},null,8,[`value`,`onUpdate:value`]),l(v(V),{style:{width:`70%`},value:e.name,"onUpdate:value":t=>e.name=t,type:`text`,placeholder:`Название`},null,8,[`value`,`onUpdate:value`])]),_:2},1024),y[35]||=I(`p`,{class:`need-keys-text`},`Требуемые ключи`,-1),I(`div`,Wt,[l(v($),{value:e.keys,"onUpdate:value":t=>e.keys=t,"on-create":x},{"create-button-default":T(()=>[...y[34]||=[t(` Добавить ключ `,-1)]]),default:T(({value:e})=>[I(`div`,Gt,[l(v(V),{value:e.name,"onUpdate:value":t=>e.name=t,type:`text`,placeholder:`Название`},null,8,[`value`,`onUpdate:value`])])]),_:1},8,[`value`,`onUpdate:value`])])])])]),_:1},8,[`value`]),y[41]||=t(` Получаемые ключи `,-1),l(v($),{value:u.place.keys,"onUpdate:value":y[18]||=e=>u.place.keys=e,"on-create":x},{"create-button-default":T(()=>[...y[36]||=[t(` Добавить ключ `,-1)]]),default:T(({value:e})=>[I(`div`,Kt,[l(v(V),{value:e.name,"onUpdate:value":t=>e.name=t,type:`text`,placeholder:`Название`},null,8,[`value`,`onUpdate:value`])])]),_:1},8,[`value`]),I(`div`,qt,[h(c.$slots,`default`,{},void 0,!0)])]),_:3})])):e(``,!0),l(v(oe),{show:k.value,"onUpdate:show":y[20]||=e=>k.value=e,"mask-closable":!0},{default:T(()=>[l(v(ne),{class:i({"photo-paper":A.value}),"theme-overrides":A.value?{titleTextColor:`black`,actionColor:`transparent`,paddingMedium:`14px`,borderRadius:`10px`}:void 0,style:s({maxWidth:`min(94vw, 1200px)`,width:A.value?`max-content`:`min(94vw, 1200px)`}),bordered:!1,role:`dialog`,"aria-modal":`true`,"header-style":A.value?{paddingBottom:`10px`}:void 0,"content-style":{padding:A.value?`0 14px`:`14px`}},n({header:T(()=>[I(`span`,{class:i({"photo-paper-title":A.value})},d(D.value?.name||O.value?.title),3)]),"header-extra":T(()=>[l(v(R),{quaternary:``,circle:``,"theme-overrides":A.value?{textColor:`black`,textColorHover:`#63e2b7`}:void 0,"aria-label":`Закрыть`,onClick:y[19]||=e=>te()},{default:T(()=>[l(v(ie),{size:`20`},{default:T(()=>[l(v(Fe))]),_:1})]),_:1},8,[`theme-overrides`])]),default:T(()=>[D.value&&v(K)(D.value)==`image`?(o(),F(`div`,Jt,[I(`img`,{src:v(q)(D.value.image),alt:D.value.name||`Фото улики`,class:`view-application-image`},null,8,Yt)])):D.value&&v(K)(D.value)==`pdf`?(o(),F(`iframe`,{key:1,src:v(q)(D.value.image),class:`view-application-pdf`},null,8,Xt)):D.value&&v(K)(D.value)==`audio`?(o(),F(`audio`,{key:2,src:v(q)(D.value.image),controls:``,autoplay:``,class:`view-application-audio`},null,8,Zt)):O.value?(o(),F(`div`,Qt,[I(`img`,{src:O.value.url,alt:O.value.title||`Фото точки`,class:`view-application-image`},null,8,$t)])):e(``,!0)]),_:2},[A.value?{name:`action`,fn:T(()=>[l(v(R),{class:`photo-paper-action`,tag:`a`,href:A.value,target:`_blank`,rel:`noopener noreferrer`,bordered:!1,"theme-overrides":{textColor:`#bfa07d`,textColorHover:`#63e2b7`}},{default:T(()=>[...y[42]||=[t(` Открыть в новой вкладке `,-1)]]),_:1},8,[`href`])]),key:`0`}:void 0]),1032,[`class`,`theme-overrides`,`style`,`header-style`,`content-style`])]),_:1},8,[`show`])],64))}}),[[`__scopeId`,`data-v-c907363d`]]);export{Ze as n,J as r,en as t}; |