import{e as x,h as E,f as c,F as _,u as D,r as v,a9 as R,o as m,q as d,n as z,y as P,C as S,t as $,g as N,p as q}from"./iframe-Bl-fVlm8.js";import{g as A}from"./_commonjsHelpers-Cpj98o6Y.js";import{i as I,_ as M,a as p,b as w,c as B}from"./isArray-DPUC7i9_.js";import{l}from"./lodash-CdDiHlzQ.js";import{P as F}from"./PzDomHandler-BU7iMNnt.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";var G=M,L=I,X="[object Symbol]";function Z(e){return typeof e=="symbol"||L(e)&&G(e)==X}var g=Z,j=p,H=g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/;function J(e,t){if(j(e))return!1;var a=typeof e;return a=="number"||a=="symbol"||a=="boolean"||e==null||H(e)?!0:W.test(e)||!U.test(e)||t!=null&&e in Object(t)}var Q=J,T=w,Y="Expected a function";function b(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Y);var a=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=a.cache;if(o.has(s))return o.get(s);var u=e.apply(this,n);return a.cache=o.set(s,u)||o,u};return a.cache=new(b.Cache||T),a}b.Cache=T;var ee=b,te=ee,ae=500;function ne(e){var t=te(e,function(n){return a.size===ae&&a.clear(),n}),a=t.cache;return t}var re=ne,ie=re,se=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oe=/\\(\\)?/g,le=ie(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(se,function(a,n,s,o){t.push(s?o.replace(oe,"$1"):n||a)}),t}),ue=le;function ce(e,t){for(var a=-1,n=e==null?0:e.length,s=Array(n);++a<n;)s[a]=t(e[a],a,e);return s}var me=ce,k=B,ye=me,fe=p,de=g,C=k?k.prototype:void 0,K=C?C.toString:void 0;function V(e){if(typeof e=="string")return e;if(fe(e))return ye(e,V)+"";if(de(e))return K?K.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var pe=V,ge=pe;function be(e){return e==null?"":ge(e)}var he=be,_e=p,ve=Q,ze=ue,Pe=he;function Se(e,t){return _e(e)?e:ve(e,t)?[e]:ze(Pe(e))}var $e=Se,ke=g;function Ce(e){if(typeof e=="string"||ke(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Ke=Ce,Te=$e,Ve=Ke;function xe(e,t){t=Te(t,e);for(var a=0,n=t.length;e!=null&&a<n;)e=e[Ve(t[a++])];return a&&a==n?e:void 0}var Ee=xe,De=Ee;function Re(e,t,a){var n=e==null?void 0:De(e,t);return n===void 0?a:n}var Ne=Re;const qe=A(Ne),Ae={ref:"componentRef",class:"pz-key-value"},y=x({name:"PzKeyValue",__name:"PzKeyValue",props:{config:{},data:{},checkRequired:{type:Boolean,default:!0},flexDirection:{default:"column"},titleStyleClass:{default:""}},setup(e){const t=e,a=v([]),n=v("transparent"),s=R("componentRef");E(()=>{t.config.forEach(({key:r})=>{(!h(o(r))||!t.checkRequired)&&a.value.push(r)}),n.value=F.getParentNearestBackground(s.value)});const o=r=>{const f=qe(l.pickBy(t.data,l.identity),r.split("-"),"");return h(f)?"":f},u=r=>o(r),h=r=>l.isNumber(r)||l.isBoolean(r)?!1:l.isEmpty(r);return(r,f)=>(m(),c("div",Ae,[(m(!0),c(_,null,D(e.config,i=>(m(),c(_,null,[a.value.includes(i.key)?(m(),c("div",{key:i.id,class:"pz-key-value__item"},[d("h6",{class:N(["pz-key-value__title",[e.titleStyleClass,i.labelStyleClass]])},[d("span",{class:"pz-key-value__title-box",style:z({backgroundColor:n.value})},[P(r.$slots,`${i.key}_label`,{data:i.labelKey,source:e.data,item:i},()=>[S($(i.labelKey),1)],!0)],4)],2),d("div",{class:"pz-key-value__content",style:z({flexDirection:e.flexDirection})},[P(r.$slots,i.key,{data:u(i.key),source:e.data,item:i},()=>[S($(o(i.key)),1)],!0)],4)])):q("",!0)],64))),256))],512))}}),Ge=O(y,[["__scopeId","data-v-9ba625f4"]]);y.__docgenInfo=Object.assign({displayName:y.name??y.__name},{name:"PzKeyValue",exportName:"default",displayName:"PzKeyValue",description:"",tags:{},props:[{name:"config",required:!0,type:{name:"ReadonlyArray",elements:[{name:"PzKeyValueViewListItem",elements:[{name:"TKey"}]}]}},{name:"data",required:!0,type:{name:"TData"}},{name:"checkRequired",required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"flexDirection",required:!1,type:{name:"PzKeyValueFlexDirection"},defaultValue:{func:!1,value:'"column"'}},{name:"titleStyleClass",required:!1,type:{name:"string"},defaultValue:{func:!1,value:'""'}}],slots:[{name:"`${item.key}_label`",scoped:!0,bindings:[{name:"name",title:"binding"},{name:"data",title:"binding"},{name:"source",title:"binding"},{name:"item",title:"binding"}]},{name:"item.key",scoped:!0,bindings:[{name:"name",title:"binding"},{name:"data",title:"binding"},{name:"source",title:"binding"},{name:"item",title:"binding"}]}],sourceFiles:["/builds/Web-Projects/client-services/prozorro-ui/src/components/Display/PzKeyValue/PzKeyValue.vue"]});export{Ge as P};
