@kong-ui-public/forms 2.2.7 → 2.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/forms.es.js +3 -3
- package/dist/forms.umd.js +1 -1
- package/package.json +5 -5
package/dist/forms.es.js
CHANGED
|
@@ -5790,7 +5790,7 @@ const $l = /* @__PURE__ */ K(f0, [["render", M0], ["__scopeId", "data-v-22600a29
|
|
|
5790
5790
|
for (const [h, c] of a)
|
|
5791
5791
|
s[h] = c;
|
|
5792
5792
|
return s;
|
|
5793
|
-
}, A0 = (n) => (an("data-v-
|
|
5793
|
+
}, A0 = (n) => (an("data-v-a81be499"), n = n(), on(), n), E0 = ["aria-hidden"], F0 = {
|
|
5794
5794
|
key: 0,
|
|
5795
5795
|
"data-testid": "kui-icon-svg-title"
|
|
5796
5796
|
}, k0 = /* @__PURE__ */ A0(() => /* @__PURE__ */ E("path", {
|
|
@@ -5889,7 +5889,7 @@ const $l = /* @__PURE__ */ K(f0, [["render", M0], ["__scopeId", "data-v-22600a29
|
|
|
5889
5889
|
_: 1
|
|
5890
5890
|
}, 8, ["aria-hidden", "style"]));
|
|
5891
5891
|
}
|
|
5892
|
-
}), $0 = /* @__PURE__ */ Ll(O0, [["__scopeId", "data-v-
|
|
5892
|
+
}), $0 = /* @__PURE__ */ Ll(O0, [["__scopeId", "data-v-a81be499"]]), L0 = (n) => (an("data-v-2674553b"), n = n(), on(), n), U0 = ["aria-hidden"], R0 = {
|
|
5893
5893
|
key: 0,
|
|
5894
5894
|
"data-testid": "kui-icon-svg-title"
|
|
5895
5895
|
}, D0 = /* @__PURE__ */ L0(() => /* @__PURE__ */ E("path", {
|
|
@@ -5988,7 +5988,7 @@ const $l = /* @__PURE__ */ K(f0, [["render", M0], ["__scopeId", "data-v-22600a29
|
|
|
5988
5988
|
_: 1
|
|
5989
5989
|
}, 8, ["aria-hidden", "style"]));
|
|
5990
5990
|
}
|
|
5991
|
-
}), Qi = /* @__PURE__ */ Ll(N0, [["__scopeId", "data-v-
|
|
5991
|
+
}), Qi = /* @__PURE__ */ Ll(N0, [["__scopeId", "data-v-2674553b"]]), B0 = {
|
|
5992
5992
|
name: "FieldArrayItem",
|
|
5993
5993
|
components: { TrashIcon: Qi },
|
|
5994
5994
|
props: {
|
package/dist/forms.umd.js
CHANGED
|
@@ -24,4 +24,4 @@ __p += '`),K&&(B+=`' +
|
|
|
24
24
|
function print() { __p += __j.call(arguments, '') }
|
|
25
25
|
`:`;
|
|
26
26
|
`)+B+`return __p
|
|
27
|
-
}`;var q=ha(function(){return Z(c,N+"return "+B).apply(l,h)});if(q.source=B,Hi(q))throw q;return q}function o1(e){return X(e).toLowerCase()}function l1(e){return X(e).toUpperCase()}function s1(e,t,r){if(e=X(e),e&&(r||t===l))return kl(e);if(!e||!(t=De(t)))return e;var o=Qe(e),a=Qe(t),c=El(o,a),h=Sl(o,a)+1;return Mt(o,c,h).join("")}function a1(e,t,r){if(e=X(e),e&&(r||t===l))return e.slice(0,Bl(e)+1);if(!e||!(t=De(t)))return e;var o=Qe(e),a=Sl(o,Qe(t))+1;return Mt(o,0,a).join("")}function d1(e,t,r){if(e=X(e),e&&(r||t===l))return e.replace(Hr,"");if(!e||!(t=De(t)))return e;var o=Qe(e),a=El(o,Qe(t));return Mt(o,a).join("")}function c1(e,t){var r=rh,o=ih;if(oe(t)){var a="separator"in t?t.separator:a;r="length"in t?x(t.length):r,o="omission"in t?De(t.omission):o}e=X(e);var c=e.length;if(Zt(e)){var h=Qe(e);c=h.length}if(r>=c)return e;var p=r-Jt(o);if(p<1)return o;var _=h?Mt(h,0,p).join(""):e.slice(0,p);if(a===l)return _+o;if(h&&(p+=_.length-p),Wi(a)){if(e.slice(p).search(a)){var S,v=_;for(a.global||(a=si(a.source,X(Ho.exec(a))+"g")),a.lastIndex=0;S=a.exec(v);)var B=S.index;_=_.slice(0,B===l?p:B)}}else if(e.indexOf(De(a),p)!=p){var I=_.lastIndexOf(a);I>-1&&(_=_.slice(0,I))}return _+o}function u1(e){return e=X(e),e&&kh.test(e)?e.replace(Po,xm):e}var f1=rn(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Gi=ms("toUpperCase");function fa(e,t,r){return e=X(e),t=r?l:t,t===l?Om(e)?zm(e):Bm(e):e.match(t)||[]}var ha=z(function(e,t){try{return $e(e,l,t)}catch(r){return Hi(r)?r:new U(r)}}),h1=ht(function(e,t){return ze(t,function(r){r=ot(r),ut(e,r,qi(e[r],e))}),e});function m1(e){var t=e==null?0:e.length,r=V();return e=t?re(e,function(o){if(typeof o[1]!="function")throw new He(b);return[r(o[0]),o[1]]}):[],z(function(o){for(var a=-1;++a<t;){var c=e[a];if($e(c[0],this,o))return $e(c[1],this,o)}})}function p1(e){return xp(Ke(e,Q))}function Zi(e){return function(){return e}}function g1(e,t){return e==null||e!==e?t:e}var y1=gs(),_1=gs(!0);function Ve(e){return e}function Ji(e){return Kl(typeof e=="function"?e:Ke(e,Q))}function b1(e){return Gl(Ke(e,Q))}function w1(e,t){return Zl(e,Ke(t,Q))}var C1=z(function(e,t){return function(r){return Bn(r,e,t)}}),k1=z(function(e,t){return function(r){return Bn(e,r,t)}});function Xi(e,t,r){var o=pe(t),a=ur(t,o);r==null&&!(oe(t)&&(a.length||!o.length))&&(r=t,t=e,e=this,a=ur(t,pe(t)));var c=!(oe(r)&&"chain"in r)||!!r.chain,h=pt(e);return ze(a,function(p){var _=t[p];e[p]=_,h&&(e.prototype[p]=function(){var S=this.__chain__;if(c||S){var v=e(this.__wrapped__),B=v.__actions__=Ne(this.__actions__);return B.push({func:_,args:arguments,thisArg:e}),v.__chain__=S,v}return _.apply(e,Et([this.value()],arguments))})}),e}function E1(){return ge._===this&&(ge._=Zm),this}function Qi(){}function S1(e){return e=x(e),z(function(t){return Jl(t,e)})}var v1=Mi(re),B1=Mi(yl),T1=Mi(ei);function ma(e){return Di(e)?ti(ot(e)):rg(e)}function I1(e){return function(t){return e==null?l:xt(e,t)}}var M1=_s(),N1=_s(!0);function ji(){return[]}function eo(){return!1}function A1(){return{}}function F1(){return""}function V1(){return!0}function $1(e,t){if(e=x(e),e<1||e>Ct)return[];var r=nt,o=be(e,nt);t=V(t),e-=nt;for(var a=ii(o,t);++r<e;)t(r);return a}function O1(e){return R(e)?re(e,ot):Le(e)?[e]:Ne($s(X(e)))}function D1(e){var t=++Ym;return X(e)+t}var L1=yr(function(e,t){return e+t},0),U1=Ni("ceil"),R1=yr(function(e,t){return e/t},1),x1=Ni("floor");function P1(e){return e&&e.length?cr(e,Ve,pi):l}function q1(e,t){return e&&e.length?cr(e,V(t,2),pi):l}function z1(e){return wl(e,Ve)}function H1(e,t){return wl(e,V(t,2))}function W1(e){return e&&e.length?cr(e,Ve,bi):l}function K1(e,t){return e&&e.length?cr(e,V(t,2),bi):l}var Y1=yr(function(e,t){return e*t},1),G1=Ni("round"),Z1=yr(function(e,t){return e-t},0);function J1(e){return e&&e.length?ri(e,Ve):0}function X1(e,t){return e&&e.length?ri(e,V(t,2)):0}return d.after=b_,d.ary=Ws,d.assign=l0,d.assignIn=oa,d.assignInWith=Nr,d.assignWith=s0,d.at=a0,d.before=Ks,d.bind=qi,d.bindAll=h1,d.bindKey=Ys,d.castArray=A_,d.chain=qs,d.chunk=xg,d.compact=Pg,d.concat=qg,d.cond=m1,d.conforms=p1,d.constant=Zi,d.countBy=Jy,d.create=d0,d.curry=Gs,d.curryRight=Zs,d.debounce=Js,d.defaults=c0,d.defaultsDeep=u0,d.defer=w_,d.delay=C_,d.difference=zg,d.differenceBy=Hg,d.differenceWith=Wg,d.drop=Kg,d.dropRight=Yg,d.dropRightWhile=Gg,d.dropWhile=Zg,d.fill=Jg,d.filter=Qy,d.flatMap=t_,d.flatMapDeep=n_,d.flatMapDepth=r_,d.flatten=Us,d.flattenDeep=Xg,d.flattenDepth=Qg,d.flip=k_,d.flow=y1,d.flowRight=_1,d.fromPairs=jg,d.functions=_0,d.functionsIn=b0,d.groupBy=i_,d.initial=ty,d.intersection=ny,d.intersectionBy=ry,d.intersectionWith=iy,d.invert=C0,d.invertBy=k0,d.invokeMap=l_,d.iteratee=Ji,d.keyBy=s_,d.keys=pe,d.keysIn=Fe,d.map=Sr,d.mapKeys=S0,d.mapValues=v0,d.matches=b1,d.matchesProperty=w1,d.memoize=Br,d.merge=B0,d.mergeWith=la,d.method=C1,d.methodOf=k1,d.mixin=Xi,d.negate=Tr,d.nthArg=S1,d.omit=T0,d.omitBy=I0,d.once=E_,d.orderBy=a_,d.over=v1,d.overArgs=S_,d.overEvery=B1,d.overSome=T1,d.partial=zi,d.partialRight=Xs,d.partition=d_,d.pick=M0,d.pickBy=sa,d.property=ma,d.propertyOf=I1,d.pull=ay,d.pullAll=xs,d.pullAllBy=dy,d.pullAllWith=cy,d.pullAt=uy,d.range=M1,d.rangeRight=N1,d.rearg=v_,d.reject=f_,d.remove=fy,d.rest=B_,d.reverse=xi,d.sampleSize=m_,d.set=A0,d.setWith=F0,d.shuffle=p_,d.slice=hy,d.sortBy=__,d.sortedUniq=wy,d.sortedUniqBy=Cy,d.split=t1,d.spread=T_,d.tail=ky,d.take=Ey,d.takeRight=Sy,d.takeRightWhile=vy,d.takeWhile=By,d.tap=Py,d.throttle=I_,d.thru=Er,d.toArray=na,d.toPairs=aa,d.toPairsIn=da,d.toPath=O1,d.toPlainObject=ia,d.transform=V0,d.unary=M_,d.union=Ty,d.unionBy=Iy,d.unionWith=My,d.uniq=Ny,d.uniqBy=Ay,d.uniqWith=Fy,d.unset=$0,d.unzip=Pi,d.unzipWith=Ps,d.update=O0,d.updateWith=D0,d.values=sn,d.valuesIn=L0,d.without=Vy,d.words=fa,d.wrap=N_,d.xor=$y,d.xorBy=Oy,d.xorWith=Dy,d.zip=Ly,d.zipObject=Uy,d.zipObjectDeep=Ry,d.zipWith=xy,d.entries=aa,d.entriesIn=da,d.extend=oa,d.extendWith=Nr,Xi(d,d),d.add=L1,d.attempt=ha,d.camelCase=P0,d.capitalize=ca,d.ceil=U1,d.clamp=U0,d.clone=F_,d.cloneDeep=$_,d.cloneDeepWith=O_,d.cloneWith=V_,d.conformsTo=D_,d.deburr=ua,d.defaultTo=g1,d.divide=R1,d.endsWith=q0,d.eq=et,d.escape=z0,d.escapeRegExp=H0,d.every=Xy,d.find=jy,d.findIndex=Ds,d.findKey=f0,d.findLast=e_,d.findLastIndex=Ls,d.findLastKey=h0,d.floor=x1,d.forEach=zs,d.forEachRight=Hs,d.forIn=m0,d.forInRight=p0,d.forOwn=g0,d.forOwnRight=y0,d.get=Ki,d.gt=L_,d.gte=U_,d.has=w0,d.hasIn=Yi,d.head=Rs,d.identity=Ve,d.includes=o_,d.indexOf=ey,d.inRange=R0,d.invoke=E0,d.isArguments=zt,d.isArray=R,d.isArrayBuffer=R_,d.isArrayLike=Ae,d.isArrayLikeObject=se,d.isBoolean=x_,d.isBuffer=Nt,d.isDate=P_,d.isElement=q_,d.isEmpty=z_,d.isEqual=H_,d.isEqualWith=W_,d.isError=Hi,d.isFinite=K_,d.isFunction=pt,d.isInteger=Qs,d.isLength=Ir,d.isMap=js,d.isMatch=Y_,d.isMatchWith=G_,d.isNaN=Z_,d.isNative=J_,d.isNil=Q_,d.isNull=X_,d.isNumber=ea,d.isObject=oe,d.isObjectLike=le,d.isPlainObject=Fn,d.isRegExp=Wi,d.isSafeInteger=j_,d.isSet=ta,d.isString=Mr,d.isSymbol=Le,d.isTypedArray=ln,d.isUndefined=e0,d.isWeakMap=t0,d.isWeakSet=n0,d.join=oy,d.kebabCase=W0,d.last=Ge,d.lastIndexOf=ly,d.lowerCase=K0,d.lowerFirst=Y0,d.lt=r0,d.lte=i0,d.max=P1,d.maxBy=q1,d.mean=z1,d.meanBy=H1,d.min=W1,d.minBy=K1,d.stubArray=ji,d.stubFalse=eo,d.stubObject=A1,d.stubString=F1,d.stubTrue=V1,d.multiply=Y1,d.nth=sy,d.noConflict=E1,d.noop=Qi,d.now=vr,d.pad=G0,d.padEnd=Z0,d.padStart=J0,d.parseInt=X0,d.random=x0,d.reduce=c_,d.reduceRight=u_,d.repeat=Q0,d.replace=j0,d.result=N0,d.round=G1,d.runInContext=y,d.sample=h_,d.size=g_,d.snakeCase=e1,d.some=y_,d.sortedIndex=my,d.sortedIndexBy=py,d.sortedIndexOf=gy,d.sortedLastIndex=yy,d.sortedLastIndexBy=_y,d.sortedLastIndexOf=by,d.startCase=n1,d.startsWith=r1,d.subtract=Z1,d.sum=J1,d.sumBy=X1,d.template=i1,d.times=$1,d.toFinite=gt,d.toInteger=x,d.toLength=ra,d.toLower=o1,d.toNumber=Ze,d.toSafeInteger=o0,d.toString=X,d.toUpper=l1,d.trim=s1,d.trimEnd=a1,d.trimStart=d1,d.truncate=c1,d.unescape=u1,d.uniqueId=D1,d.upperCase=f1,d.upperFirst=Gi,d.each=zs,d.eachRight=Hs,d.first=Rs,Xi(d,function(){var e={};return rt(d,function(t,r){j.call(d.prototype,r)||(e[r]=t)}),e}(),{chain:!1}),d.VERSION=m,ze(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){d[e].placeholder=d}),ze(["drop","take"],function(e,t){W.prototype[e]=function(r){r=r===l?1:he(x(r),0);var o=this.__filtered__&&!t?new W(this):this.clone();return o.__filtered__?o.__takeCount__=be(r,o.__takeCount__):o.__views__.push({size:be(r,nt),type:e+(o.__dir__<0?"Right":"")}),o},W.prototype[e+"Right"]=function(r){return this.reverse()[e](r).reverse()}}),ze(["filter","map","takeWhile"],function(e,t){var r=t+1,o=r==Uo||r==ah;W.prototype[e]=function(a){var c=this.clone();return c.__iteratees__.push({iteratee:V(a,3),type:r}),c.__filtered__=c.__filtered__||o,c}}),ze(["head","last"],function(e,t){var r="take"+(t?"Right":"");W.prototype[e]=function(){return this[r](1).value()[0]}}),ze(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");W.prototype[e]=function(){return this.__filtered__?new W(this):this[r](1)}}),W.prototype.compact=function(){return this.filter(Ve)},W.prototype.find=function(e){return this.filter(e).head()},W.prototype.findLast=function(e){return this.reverse().find(e)},W.prototype.invokeMap=z(function(e,t){return typeof e=="function"?new W(this):this.map(function(r){return Bn(r,e,t)})}),W.prototype.reject=function(e){return this.filter(Tr(V(e)))},W.prototype.slice=function(e,t){e=x(e);var r=this;return r.__filtered__&&(e>0||t<0)?new W(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==l&&(t=x(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},W.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},W.prototype.toArray=function(){return this.take(nt)},rt(W.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),a=d[o?"take"+(t=="last"?"Right":""):t],c=o||/^find/.test(t);a&&(d.prototype[t]=function(){var h=this.__wrapped__,p=o?[1]:arguments,_=h instanceof W,S=p[0],v=_||R(h),B=function(H){var K=a.apply(d,Et([H],p));return o&&I?K[0]:K};v&&r&&typeof S=="function"&&S.length!=1&&(_=v=!1);var I=this.__chain__,N=!!this.__actions__.length,O=c&&!I,q=_&&!N;if(!c&&v){h=q?h:new W(this);var D=e.apply(h,p);return D.__actions__.push({func:Er,args:[B],thisArg:l}),new We(D,I)}return O&&q?e.apply(this,p):(D=this.thru(B),O?o?D.value()[0]:D.value():D)})}),ze(["pop","push","shift","sort","splice","unshift"],function(e){var t=Zn[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);d.prototype[e]=function(){var a=arguments;if(o&&!this.__chain__){var c=this.value();return t.apply(R(c)?c:[],a)}return this[r](function(h){return t.apply(R(h)?h:[],a)})}}),rt(W.prototype,function(e,t){var r=d[t];if(r){var o=r.name+"";j.call(en,o)||(en[o]=[]),en[o].push({name:t,func:r})}}),en[gr(l,Te).name]=[{name:"wrapper",func:l}],W.prototype.clone=up,W.prototype.reverse=fp,W.prototype.value=hp,d.prototype.at=qy,d.prototype.chain=zy,d.prototype.commit=Hy,d.prototype.next=Wy,d.prototype.plant=Yy,d.prototype.reverse=Gy,d.prototype.toJSON=d.prototype.valueOf=d.prototype.value=Zy,d.prototype.first=d.prototype.head,bn&&(d.prototype[bn]=Ky),d},Xt=Hm();Ot?((Ot.exports=Xt)._=Xt,Jr._=Xt):ge._=Xt}).call(an)}(Vn,Vn.exports);var C=Vn.exports;const no={methods:{getFieldRowClasses(n){const s=this.fieldErrors(n).length>0,l={[C.get(this.options,"validationErrorClass","error")]:s,[C.get(this.options,"validationSuccessClass","valid")]:!s,disabled:this.fieldDisabled(n),readonly:this.fieldReadonly(n),featured:this.fieldFeatured(n),required:this.fieldRequired(n)};return C.isArray(n.styleClasses)?C.forEach(n.styleClasses,m=>l[m]=!0):C.isString(n.styleClasses)&&(l[n.styleClasses]=!0),C.isNil(n.type)||(l["field-"+n.type]=!0),l},fieldErrors(n){return this.errors.filter(l=>l.field.fieldName===n.fieldName).map(l=>l.error)},fieldDisabled(n){return C.isFunction(n.disabled)?n.disabled.call(this,this.model,n,this):C.isNil(n.disabled)?!1:n.disabled},fieldReadonly(n){return C.isFunction(n.readonly)?n.readonly.call(this,this.model,n,this):C.isNil(n.readonly)?!1:n.readonly},fieldFeatured(n){return C.isFunction(n.featured)?n.featured.call(this,this.model,n,this):C.isNil(n.featured)?!1:n.featured},fieldRequired(n){return C.isFunction(n.required)?n.required.call(this,this.model,n,this):C.isNil(n.required)?!1:n.required}}},ro=(n,s="")=>typeof n.id<"u"?s+n.id:s+(n.inputName||n.label||n.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),io=(n="")=>n.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var oo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,_t="\\d\\d?",bt="\\d\\d",ga="\\d{3}",ya="\\d{4}",dn="[^\\s]+",lo=/\[([^]*?)\]/gm;function so(n,s){for(var l=[],m=0,f=n.length;m<f;m++)l.push(n[m].substr(0,s));return l}var ao=function(n){return function(s,l){var m=l[n].map(function(u){return u.toLowerCase()}),f=m.indexOf(s.toLowerCase());return f>-1?f:null}};function At(n){for(var s=[],l=1;l<arguments.length;l++)s[l-1]=arguments[l];for(var m=0,f=s;m<f.length;m++){var u=f[m];for(var b in u)n[b]=u[b]}return n}var co=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],uo=["January","February","March","April","May","June","July","August","September","October","November","December"],_a=so(uo,3),ba=so(co,3),fo={dayNamesShort:ba,dayNames:co,monthNamesShort:_a,monthNames:uo,amPm:["am","pm"],DoFn:function(n){return n+["th","st","nd","rd"][n%10>3?0:(n-n%10!==10?1:0)*n%10]}},$n=At({},fo),wa=function(n){return $n=At($n,n)},ho=function(n){return n.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Be=function(n,s){for(s===void 0&&(s=2),n=String(n);n.length<s;)n="0"+n;return n},Ca={D:function(n){return String(n.getDate())},DD:function(n){return Be(n.getDate())},Do:function(n,s){return s.DoFn(n.getDate())},d:function(n){return String(n.getDay())},dd:function(n){return Be(n.getDay())},ddd:function(n,s){return s.dayNamesShort[n.getDay()]},dddd:function(n,s){return s.dayNames[n.getDay()]},M:function(n){return String(n.getMonth()+1)},MM:function(n){return Be(n.getMonth()+1)},MMM:function(n,s){return s.monthNamesShort[n.getMonth()]},MMMM:function(n,s){return s.monthNames[n.getMonth()]},YY:function(n){return Be(String(n.getFullYear()),4).substr(2)},YYYY:function(n){return Be(n.getFullYear(),4)},h:function(n){return String(n.getHours()%12||12)},hh:function(n){return Be(n.getHours()%12||12)},H:function(n){return String(n.getHours())},HH:function(n){return Be(n.getHours())},m:function(n){return String(n.getMinutes())},mm:function(n){return Be(n.getMinutes())},s:function(n){return String(n.getSeconds())},ss:function(n){return Be(n.getSeconds())},S:function(n){return String(Math.round(n.getMilliseconds()/100))},SS:function(n){return Be(Math.round(n.getMilliseconds()/10),2)},SSS:function(n){return Be(n.getMilliseconds(),3)},a:function(n,s){return n.getHours()<12?s.amPm[0]:s.amPm[1]},A:function(n,s){return n.getHours()<12?s.amPm[0].toUpperCase():s.amPm[1].toUpperCase()},ZZ:function(n){var s=n.getTimezoneOffset();return(s>0?"-":"+")+Be(Math.floor(Math.abs(s)/60)*100+Math.abs(s)%60,4)},Z:function(n){var s=n.getTimezoneOffset();return(s>0?"-":"+")+Be(Math.floor(Math.abs(s)/60),2)+":"+Be(Math.abs(s)%60,2)}},mo=function(n){return+n-1},po=[null,_t],go=[null,dn],yo=["isPm",dn,function(n,s){var l=n.toLowerCase();return l===s.amPm[0]?0:l===s.amPm[1]?1:null}],_o=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(n){var s=(n+"").match(/([+-]|\d\d)/gi);if(s){var l=+s[1]*60+parseInt(s[2],10);return s[0]==="+"?l:-l}return 0}],ka={D:["day",_t],DD:["day",bt],Do:["day",_t+dn,function(n){return parseInt(n,10)}],M:["month",_t,mo],MM:["month",bt,mo],YY:["year",bt,function(n){var s=new Date,l=+(""+s.getFullYear()).substr(0,2);return+(""+(+n>68?l-1:l)+n)}],h:["hour",_t,void 0,"isPm"],hh:["hour",bt,void 0,"isPm"],H:["hour",_t],HH:["hour",bt],m:["minute",_t],mm:["minute",bt],s:["second",_t],ss:["second",bt],YYYY:["year",ya],S:["millisecond","\\d",function(n){return+n*100}],SS:["millisecond",bt,function(n){return+n*10}],SSS:["millisecond",ga],d:po,dd:po,ddd:go,dddd:go,MMM:["month",dn,ao("monthNamesShort")],MMMM:["month",dn,ao("monthNames")],a:yo,A:yo,ZZ:_o,Z:_o},On={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Ea=function(n){return At(On,n)},Sa=function(n,s,l){if(s===void 0&&(s=On.default),l===void 0&&(l={}),typeof n=="number"&&(n=new Date(n)),Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))throw new Error("Invalid Date pass to format");s=On[s]||s;var m=[];s=s.replace(lo,function(u,b){return m.push(b),"@@@"});var f=At(At({},$n),l);return s=s.replace(oo,function(u){return Ca[u](n,f)}),s.replace(/@@@/g,function(){return m.shift()})};function va(n,s,l){if(l===void 0&&(l={}),typeof s!="string")throw new Error("Invalid format in fecha parse");if(s=On[s]||s,n.length>1e3)return null;var m=new Date,f={year:m.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},u=[],b=[],g=s.replace(lo,function(Me,F){return b.push(ho(F)),"@@@"}),E={},T={};g=ho(g).replace(oo,function(Me){var F=ka[Me],L=F[0],G=F[1],ue=F[3];if(E[L])throw new Error("Invalid format. "+L+" specified twice in format");return E[L]=!0,ue&&(T[ue]=!0),u.push(F),"("+G+")"}),Object.keys(T).forEach(function(Me){if(!E[Me])throw new Error("Invalid format. "+Me+" is required in specified format")}),g=g.replace(/@@@/g,function(){return b.shift()});var A=n.match(new RegExp(g,"i"));if(!A)return null;for(var Q=At(At({},$n),l),J=1;J<A.length;J++){var me=u[J-1],de=me[0],lt=me[2],ce=lt?lt(A[J],Q):+A[J];if(ce==null)return null;f[de]=ce}f.isPm===1&&f.hour!=null&&+f.hour!=12?f.hour=+f.hour+12:f.isPm===0&&+f.hour==12&&(f.hour=0);var Te;if(f.timezoneOffset==null){Te=new Date(f.year,f.month,f.day,f.hour,f.minute,f.second,f.millisecond);for(var st=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],J=0,Ie=st.length;J<Ie;J++)if(E[st[J][0]]&&f[st[J][0]]!==Te[st[J][1]]())return null}else if(Te=new Date(Date.UTC(f.year,f.month,f.day,f.hour,f.minute-f.timezoneOffset,f.second,f.millisecond)),f.month>11||f.month<0||f.day>31||f.day<1||f.hour>23||f.hour<0||f.minute>59||f.minute<0||f.second>59||f.second<0)return null;return Te}var xe={format:Sa,parse:va,defaultI18n:fo,setGlobalDateI18n:wa,setGlobalDateMasks:Ea};const _e={fieldIsRequired:"This field is required!",invalidFormat:"Invalid format!",numberTooSmall:"The number is too small! Minimum: {0}",numberTooBig:"The number is too big! Maximum: {0}",invalidNumber:"Invalid number",invalidInteger:"The value is not an integer",textTooSmall:"The length of text is too small! Current: {0}, Minimum: {1}",textTooBig:"The length of text is too big! Current: {0}, Maximum: {1}",thisNotText:"This is not a text!",thisNotArray:"This is not an array!",selectMinItems:"Select minimum {0} items!",selectMaxItems:"Select maximum {0} items!",invalidDate:"Invalid date!",dateIsEarly:"The date is too early! Current: {0}, Minimum: {1}",dateIsLate:"The date is too late! Current: {0}, Maximum: {1}",invalidEmail:"Invalid e-mail address!",invalidURL:"Invalid URL!",invalidCard:"Invalid card format!",invalidCardNumber:"Invalid card number!",invalidTextContainNumber:"Invalid text! Cannot contains numbers or special characters",invalidTextContainSpec:"Invalid text! Cannot contains special characters"};function Pe(n,s,l=_e){return C.isNil(n)||n===""?s?[ie(l.fieldIsRequired)]:[]:null}function ie(n,...s){if(n!=null&&s.length>0)for(let l=0;l<s.length;l++)n=n.replace("{"+(l-1)+"}",s[l]);return n}const cn={resources:_e,required(n,s,l,m=_e){return Pe(n,s.required,m)},number(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;const u=[];return C.isFinite(n)?(!C.isNil(s.min)&&n<s.min&&u.push(ie(m.numberTooSmall,s.min)),!C.isNil(s.max)&&n>s.max&&u.push(ie(m.numberTooBig,s.max))):u.push(ie(m.invalidNumber)),u},integer(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;const u=cn.number(n,s,l,m);return C.isInteger(n)||u.push(ie(m.invalidInteger)),u},double(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!C.isNumber(n)||isNaN(n))return[ie(m.invalidNumber)]},string(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;const u=[];return C.isString(n)?(!C.isNil(s.min)&&n.length<s.min&&u.push(ie(m.textTooSmall,n.length,s.min)),!C.isNil(s.max)&&n.length>s.max&&u.push(ie(m.textTooBig,n.length,s.max))):u.push(ie(m.thisNotText)),u},array(n,s,l,m=_e){if(s.required){if(!C.isArray(n))return[ie(m.thisNotArray)];if(n.length===0)return[ie(m.fieldIsRequired)]}if(!C.isNil(n)){if(!C.isNil(s.min)&&n.length<s.min)return[ie(m.selectMinItems,s.min)];if(!C.isNil(s.max)&&n.length>s.max)return[ie(m.selectMaxItems,s.max)]}},date(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;const u=new Date(n);if(isNaN(u.getDate()))return[ie(m.invalidDate)];const b=[];if(!C.isNil(s.min)){const g=new Date(s.min);u.valueOf()<g.valueOf()&&b.push(ie(m.dateIsEarly,xe.format(u),xe.format(g)))}if(!C.isNil(s.max)){const g=new Date(s.max);u.valueOf()>g.valueOf()&&b.push(ie(m.dateIsLate,xe.format(u),xe.format(g)))}return b},regexp(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!C.isNil(s.pattern)&&!new RegExp(s.pattern).test(n))return[ie(m.invalidFormat)]},email(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n))return[ie(m.invalidEmail)]},url(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(n))return[ie(m.invalidURL)]},creditCard(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;const u=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,b=n.replace(/[^0-9]+/g,"");if(!u.test(b))return[ie(m.invalidCard)];let g=0,E,T,A;for(let Q=b.length-1;Q>=0;Q--)E=b.substring(Q,Q+1),T=parseInt(E,10),A?(T*=2,T>=10?g+=T%10+1:g+=T):g+=T,A=!A;if(!(g%10===0&&b))return[ie(m.invalidCardNumber)]},alpha(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!/^[a-zA-Z]*$/.test(n))return[ie(m.invalidTextContainNumber)]},alphaNumeric(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!/^[a-zA-Z0-9]*$/.test(n))return[ie(m.invalidTextContainSpec)]}};Object.keys(cn).forEach(n=>{const s=cn[n];C.isFunction(s)&&(s.locale=l=>(m,f,u)=>s(m,f,u,C.defaults(l,_e)))});function bo(n){return C.isString(n)?cn[n]!=null?cn[n]:(console.warn(`'${n}' is not a validator function!`),null):n}function Ar(n,s,l){let m=C.get(l.context,"schema.attributes",{});const f=s.value||"input";C.isString(f)&&(m=C.get(m,f)||m),C.forEach(m,(u,b)=>{n.setAttribute(b,u)})}const Y={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:Ar,updated:Ar,componentUpdated:Ar}},computed:{value:{cache:!1,get(){let n;return C.isFunction(C.get(this.schema,"get"))?n=this.schema.get(this.model):n=C.get(this.model,this.schema.model),this.formatValueToField(n)},set(n){const s=this.value;n=this.formatValueToModel(n),C.isFunction(n)?n(n,s):this.updateModelValue(n,s)}}},methods:{validate(n){this.clearValidationErrors();const s=C.get(this.formOptions,"validateAsync",!1);let l=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const f=[];C.isArray(this.schema.validator)?C.forEach(this.schema.validator,u=>{f.push(bo(u).bind(this))}):f.push(bo(this.schema.validator).bind(this)),C.forEach(f,u=>{if(s)l.push(u(this.value,this.schema,this.model));else{const b=u(this.value,this.schema,this.model);b&&C.isFunction(b.then)?b.then(g=>{g&&(this.errors=this.errors.concat(g));const E=this.errors.length===0;this.$emit("validated",E,this.errors,this)}):b&&(l=l.concat(b))}})}const m=f=>{let u=[];C.forEach(C.uniq(f),g=>{C.isArray(g)&&g.length>0?u=u.concat(g):C.isString(g)&&u.push(g)}),C.isFunction(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,u,this.schema);const b=u.length===0;return n||this.$emit("validated",b,u,this),this.errors=u,u};return s?Promise.all(l).then(m):m(l)},debouncedValidate(){C.isFunction(this.debouncedValidateFunc)||(this.debouncedValidateFunc=C.debounce(this.validate.bind(this),C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(n,s){let l=!1;C.isFunction(this.schema.set)?(this.schema.set(this.model,n),l=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,n),l=!0),l&&(this.$emit("modelUpdated",n,this.schema.model),C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,n,s,this.schema),C.get(this.formOptions,"validateAfterChanged",!1)===!0&&(C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(n,s){let l=n.replace(/\[(\w+)\]/g,".$1");l=l.replace(/^\./,"");let m=this.model;const f=l.split(".");let u=0;const b=f.length;for(;u<b;){const g=f[u];if(u<b-1)m[g]!==void 0||(m[g]={}),m=m[g];else{m[g]=s;return}++u}},getFieldID(n,s=!1){const l=C.get(this.formOptions,"fieldIdPrefix","");return ro(n,l)+(s?"-"+C.uniqueId():"")},getLabelId(n){return`${this.getFieldID(n)}-label`},getFieldClasses(){return C.get(this.schema,"fieldClasses",[])},formatValueToField(n){return n},formatValueToModel(n){return n}}},Ba=Object.freeze(Object.defineProperty({__proto__:null,default:Y},Symbol.toStringTag,{value:"Module"})),Ta={mixins:[Y]},Ia=["id","autocomplete","disabled","name","required"];function Ma(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("input",{id:n.getFieldID(n.schema),type:"checkbox","onUpdate:modelValue":s[0]||(s[0]=g=>n.value=g),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,class:i.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Ia)),[[i.vModelCheckbox,n.value],[b,"input"]])}const P=(n,s)=>{const l=n.__vccOpts||n;for(const[m,f]of s)l[m]=f;return l},Na=P(Ta,[["render",Ma]]),Aa={class:"wrapper"},Fa=["disabled"],Va=["id","checked","disabled","onChange","name"],$a=["disabled"],Oa={class:"info"},Da=i.createElementVNode("div",{class:"arrow"},null,-1),La={class:"dropList"},Ua=["id","checked","disabled","onChange","name"];function Ra(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",Aa,[n.schema.listBox?(i.openBlock(),i.createElementBlock("div",{key:0,class:"listbox form-control",disabled:n.disabled||null},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[i.createElementVNode("label",null,[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:E=>u.onChanged(E,g),name:u.getInputName(g)},null,40,Va),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)])],2))),256))],8,Fa)):i.createCommentVNode("",!0),n.schema.listBox?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:1,class:"combobox form-control",disabled:n.disabled||null},[i.createElementVNode("div",{class:i.normalizeClass(["mainRow",{expanded:f.comboExpanded}]),onClick:s[0]||(s[0]=(...g)=>u.onExpandCombo&&u.onExpandCombo(...g))},[i.createElementVNode("div",Oa,i.toDisplayString(u.selectedCount)+" selected",1),Da],2),i.createElementVNode("div",La,[f.comboExpanded?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[i.createElementVNode("label",null,[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:E=>u.onChanged(E,g),name:u.getInputName(g)},null,40,Ua),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)])],2))),256)):i.createCommentVNode("",!0)])],8,$a))])),[[b,"wrapper"]])}const xa=P({mixins:[Y],data(){return{comboExpanded:!1}},computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(n){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?io(this.schema.inputName+"_"+this.getItemValue(n)):io(this.getItemValue(n))},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return n[this.schema.checklistOptions.value];if(typeof n.value<"u")return n.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return n[this.schema.checklistOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return n},isItemChecked(n){return this.value&&this.value.indexOf(this.getItemValue(n))!==-1},onChanged(n,s){if((C.isNil(this.value)||!Array.isArray(this.value))&&(this.value=[]),n.target.checked){const l=C.clone(this.value);l.push(this.getItemValue(s)),this.value=l}else{const l=C.clone(this.value);l.splice(this.value.indexOf(this.getItemValue(s)),1),this.value=l}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",Ra]]),Pa={class:"wrapper"},qa=["id","type","value","disabled","accept","alt","autocomplete","checked","dirname","formaction","formenctype","formmethod","formnovalidate","formtarget","height","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","readonly","required","size","src","step","width","files"],za={key:0,class:"helper"};function Ha(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",Pa,[i.withDirectives(i.createElementVNode("input",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),id:n.getFieldID(n.schema),type:u.inputType,value:n.value,onInput:s[0]||(s[0]=(...g)=>u.onInput&&u.onInput(...g)),onBlur:s[1]||(s[1]=(...g)=>u.onBlur&&u.onBlur(...g)),onChange:s[2]||(s[2]=(...g)=>n.schema.onChange&&n.schema.onChange(...g)),disabled:n.disabled||null,accept:n.schema.accept,alt:n.schema.alt,autocomplete:n.schema.autocomplete,checked:n.schema.checked||null,dirname:n.schema.dirname,formaction:n.schema.formaction,formenctype:n.schema.formenctype,formmethod:n.schema.formmethod,formnovalidate:n.schema.formnovalidate,formtarget:n.schema.formtarget,height:n.schema.height,list:n.schema.list,max:n.schema.max,maxlength:n.schema.maxlength,min:n.schema.min,minlength:n.schema.minlength,multiple:n.schema.multiple,name:n.schema.inputName,pattern:n.schema.pattern,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,size:n.schema&&n.schema.size>0?n.schema.size:1,src:n.schema.src,step:n.schema.step,width:n.schema.width,files:n.schema.files},null,42,qa),[[b,"input"]]),n.schema.inputType.toLowerCase()==="color"||n.schema.inputType.toLowerCase()==="range"?(i.openBlock(),i.createElementBlock("span",za,i.toDisplayString(n.value),1)):i.createCommentVNode("",!0)])),[[b,"wrapper"]])}const wo={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},Co=P({mixins:[Y],computed:{inputType(){return this.schema&&this.schema.inputType==="datetime"?"datetime-local":this.schema.inputType}},mounted(){switch(this.schema.inputType.toLowerCase()){case"number":case"range":this.debouncedFormatFunc=C.debounce((n,s)=>{this.formatNumberToModel(n,s)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":this.debouncedFormatFunc=C.debounce((n,s)=>{this.formatDatetimeToModel(n,s)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}},created(){this.schema.inputType.toLowerCase()==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")},methods:{formatValueToModel(n){if(n!=null)switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":case"number":case"range":return(s,l)=>{this.debouncedFormatFunc(n,l)}}return n},formatValueToField(n){switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":return this.formatDatetimeValueToField(n)}return n},formatDatetimeToModel(n,s){const l=wo[this.schema.inputType.toLowerCase()],m=xe.parse(n,l);m!==!1&&(this.schema.format?n=xe.format(m,this.schema.format):n=m.valueOf()),this.updateModelValue(n,s)},formatDatetimeValueToField(n){if(n==null)return null;const s=wo[this.schema.inputType.toLowerCase()];let l=n;return C.isNumber(n)||(l=xe.parse(n,s)),l!==!1?xe.format(l,s):n},formatNumberToModel(n,s){C.isNumber(n)||(n=NaN),this.updateModelValue(n,s)},onInput(n){let s=n.target.value;switch(this.schema.inputType.toLowerCase()){case"number":case"range":C.isNumber(parseFloat(n.target.value))&&(s=parseFloat(n.target.value));break}this.value=s},onBlur(){C.isFunction(this.debouncedFormatFunc)&&this.debouncedFormatFunc.flush()}}},[["render",Ha]]),Wa=["id"];function Ka(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("span",{id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[i.createTextVNode(i.toDisplayString(n.value),1)],10,Wa)),[[b,"label"]])}const Ya=P({mixins:[Y]},[["render",Ka]]),Ga=["disabled"],Za=["id","disabled","name","onClick","value","checked","required"];function Ja(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",{class:"radio-list",disabled:n.disabled||null},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>i.withDirectives((i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(u.getItemCssClasses(g))},[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"radio",disabled:u.isItemDisabled(g)||null,name:u.id,onClick:E=>u.onSelection(g),value:u.getItemValue(g),checked:u.isItemChecked(g)||null,class:i.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Za),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)],2)),[[b,"label"]])),256))],8,Ga)),[[b,"wrapper"]])}const Xa=P({mixins:[Y],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},id(){return this.schema.model}},methods:{getItemValue(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.value<"u")return n[this.schema.radiosOptions.value];if(typeof n.value<"u")return n.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.name<"u")return n[this.schema.radiosOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return n},getItemCssClasses(n){return{"is-checked":this.isItemChecked(n),"is-disabled":this.isItemDisabled(n)}},onSelection(n){this.value=this.getItemValue(n)},isItemChecked(n){return this.getItemValue(n)===this.value},isItemDisabled(n){if(this.disabled)return!0;const s=C.get(n,"disabled",!1);return C.isFunction(s)?s(this.model):s}}},[["render",Ja]]),Qa=["disabled","name","id"],ja=["disabled"],ed=["label"],td=["value"],nd=["value"];function rd(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("select",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":s[0]||(s[0]=g=>n.value=g),disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},[u.selectOptions.hideNoneSelectedText?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null},i.toDisplayString(u.selectOptions.noneSelectedText||"<Nothing selected>"),9,ja)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[g.group?(i.openBlock(),i.createElementBlock("optgroup",{key:0,label:u.getGroupName(g)},[g.ops?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(g.ops,E=>(i.openBlock(),i.createElementBlock("option",{value:u.getItemValue(E)},i.toDisplayString(u.getItemName(E)),9,td))),256)):i.createCommentVNode("",!0)],8,ed)):i.createCommentVNode("",!0),g.group?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",{key:1,value:u.getItemValue(g)},i.toDisplayString(u.getItemName(g)),9,nd))],64))),256))],10,Qa)),[[i.vModelSelect,n.value],[b,"input"]])}const ko=P({mixins:[Y],computed:{selectOptions(){return this.schema.selectOptions||{}},items(){const n=this.schema.values;return typeof n=="function"?this.groupValues(n.apply(this,[this.model,this.schema])):this.groupValues(n)}},methods:{formatValueToField(n){return C.isNil(n)?null:n},groupValues(n){const s=[];let l={};return n.forEach(m=>{l=null,m.group&&C.isObject(m)?(l=C.find(s,f=>f.group===m.group),l?l.ops.push({id:m.id,name:m.name}):(l={group:"",ops:[]},l.group=m.group,l.ops.push({id:m.id,name:m.name}),s.push(l))):s.push(m)}),s},getGroupName(n){if(n&&n.group)return n.group;throw new Error("Group name is missing! https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n}}},[["render",rd]]),id=["id","value","name","disabled"];function od(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("input",{id:n.getFieldID(n.schema),type:"submit",value:n.schema.buttonText,onClick:s[0]||(s[0]=(...b)=>u.onClick&&u.onClick(...b)),name:n.schema.inputName,disabled:n.disabled||null,class:i.normalizeClass(n.schema.fieldClasses)},null,10,id)}const ld=P({mixins:[Y],methods:{onClick(n){if(this.schema.validateBeforeSubmit===!0){n.preventDefault();const s=C.get(this.formOptions,"validateAsync",!1),l=this.vfg.validate(),m=f=>{s&&!C.isEmpty(f)||!s&&!f?C.isFunction(this.schema.onValidationError)&&this.schema.onValidationError(this.model,this.schema,f,n):C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)};l&&C.isFunction(l.then)?l.then(m):m(l)}else C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)}}},[["render",od]]),sd=["id","disabled","maxlength","minlength","placeholder","readonly","required","rows","name"];function ad(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("textarea",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":s[0]||(s[0]=g=>n.value=g),id:n.getFieldID(n.schema),disabled:n.disabled||null,maxlength:n.schema.max,minlength:n.schema.min,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,rows:n.schema.rows||2,name:n.schema.inputName},null,10,sd)),[[i.vModelText,n.value],[b,"input"]])}const Eo=P({mixins:[Y]},[["render",ad]]),dd={class:"wrapper"},cd=["id","name","accept","multiple","placeholder","readonly","required","disabled"];function ud(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",dd,[i.withDirectives(i.createElementVNode("input",{class:"form-control",id:n.getFieldID(n.schema),type:"file",name:n.schema.inputName,onChange:s[0]||(s[0]=(...g)=>u.onChange&&u.onChange(...g)),accept:n.schema.accept,multiple:n.schema.multiple,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,disabled:n.disabled||null},null,40,cd),[[b,"input"]])])),[[b,"wrapper"]])}const fd=P({mixins:[Y],methods:{onChange(n){C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,n,this)}}},[["render",ud]]),hd=["value","autocomplete","disabled","placeholder","readonly","name","id"];function md(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text",value:n.value,autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,hd)}const pd=P({mixins:[Y],data(){return{cleave:null}},mounted(){this.$nextTick(function(){window.Cleave?(this.cleave=new window.Cleave(this.$el,C.defaults(this.schema.cleaveOptions||{},{creditCard:!1,phone:!1,phoneRegionCode:"AU",date:!1,datePattern:["d","m","Y"],numeral:!1,numeralThousandsGroupStyle:"thousand",numeralDecimalScale:2,numeralDecimalMark:".",blocks:[],delimiter:" ",prefix:null,numericOnly:!1,uppercase:!1,lowercase:!1,maxLength:0})),this.cleave.properties&&this.cleave.properties.hasOwnProperty.call("result")?this.$watch("cleave.properties.result",()=>{this.value=this.cleave.properties.result}):this.$el.addEventListener("input",this.inputChange)):console.warn("Cleave is missing. Please download from https://github.com/nosir/cleave.js/ and load the script in the HTML head section!")})},beforeUnmount(){this.cleave&&(this.cleave.destroy(),this.$el.removeEventListener("input",this.inputChange))},methods:{inputChange(){this.value=this.$el.value}}},[["render",md]]),So={formatValueToField(n){if(n!=null){const s=this.schema.format?xe.parse(n,this.schema.format):new Date(n);return xe.format(s,this.getDateFormat())}return n},formatValueToModel(n){if(n!=null){const s=xe.parse(n,this.getDateFormat());this.schema.format?n=xe.format(s,this.schema.format):n=s.valueOf()}return n}},gd={class:"input-group date"},yd=["autocomplete","disabled","placeholder","readonly","name","id"],_d=i.createElementVNode("span",{class:"input-group-addon"},[i.createElementVNode("span",{class:"glyphicon glyphicon-calendar"})],-1);function bd(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("div",gd,[i.withDirectives(i.createElementVNode("input",{class:"form-control",type:"text","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,yd),[[i.vModelText,n.value]]),_d])}const vo="YYYY-MM-DD HH:mm:ss",wd={mixins:[Y],mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.datetimepicker){const n=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(C.defaults(this.schema.dateTimePickerOptions||{},{format:vo})).on("dp.change",()=>{this.value=n.value})}else console.warn("Bootstrap datetimepicker library is missing. Please download from https://eonasdan.github.io/bootstrap-datetimepicker/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.datetimepicker&&$(this.$el).data("DateTimePicker").destroy()},methods:{getDateFormat(){return this.schema.dateTimePickerOptions&&this.schema.dateTimePickerOptions.format?this.schema.dateTimePickerOptions.format:vo},...So}},Cd=P(wd,[["render",bd]]),kd=["autocomplete","disabled","placeholder","readonly","name","id"];function Ed(n,s,l,m,f,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,debounce:"500",onFocus:s[1]||(s[1]=b=>u.geolocate()),id:n.getFieldID(n.schema)},null,40,kd)),[[i.vModelText,n.value]])}const Sd=P({mixins:[Y],data(){return{autocomplete:"",inputs:{street_number:"long_name",route:"long_name",country:"long_name",administrative_area_level_1:"long_name",administrative_area_level_2:"long_name",locality:"long_name",postal_code:"short_name"}}},mounted(){this.$nextTick(()=>{window.google&&window.google.maps&&window.google.maps.places&&window.google.maps.places.Autocomplete?(this.autocomplete=new google.maps.places.Autocomplete(this.$el,{types:["geocode"]}),this.autocomplete.addListener("place_changed",this.pipeAddress)):console.warn("Google Maps API is missing. Please add https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&libraries=places script in the HTML head section!")})},methods:{pipeAddress(){const n=this.autocomplete.getPlace();if(n){this.value=n.formatted_address;const s={};if(n.address_components!==void 0)for(let l=0;l<n.address_components.length;l++){const m=n.address_components[l].types[0];this.inputs[m]&&(s[m]=n.address_components[l][this.inputs[m]])}C.isFunction(this.schema.onPlaceChanged)&&this.schema.onPlaceChanged(this.value,s,n,this.model,this.schema)}},geolocate(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(n=>{const s={lat:n.coords.latitude,lng:n.coords.longitude},l=new window.google.maps.Circle({center:s,radius:n.coords.accuracy});this.autocomplete.setBounds(l.getBounds())})}}},[["render",Ed]]),vd={class:"wrapper"},Bd=["autocomplete","disabled","placeholder","readonly"],Td=["disabled","name"];function Id(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("div",vd,[i.withDirectives(i.createElementVNode("input",{class:"form-control link",type:"text","onUpdate:modelValue":s[0]||(s[0]=b=>u.wrappedValue=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly},null,8,Bd),[[i.vShow,n.schema.hideInput!==!0],[i.vModelText,u.wrappedValue]]),n.schema.browse!==!1?(i.openBlock(),i.createElementBlock("input",{key:0,class:"form-control file",type:"file",disabled:n.disabled||null,onChange:s[1]||(s[1]=(...b)=>u.fileChanged&&u.fileChanged(...b)),name:n.schema.inputName},null,40,Td)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"preview",style:i.normalizeStyle(u.previewStyle)},[i.createElementVNode("div",{class:"remove",title:"Remove image",onClick:s[2]||(s[2]=(...b)=>u.remove&&u.remove(...b))})],4)])}const Md=P({mixins:[Y],computed:{previewStyle(){return this.schema.preview!==!1?{display:"block","background-image":this.value!=null?"url("+this.value+")":"none"}:{display:"none"}},wrappedValue:{get(){return this.value&&this.value.indexOf("data")===0?"<inline base64 image>":this.value},set(n){n&&n.indexOf("http")===0&&(this.value=n)}}},watch:{model:{deep:!0,handler(){const n=this.$el.querySelector("input.file");n&&(n.value="")}}},methods:{remove(){this.value=""},fileChanged(n){const s=new FileReader;s.onload=l=>{this.value=l.target.result},n.target.files&&n.target.files.length>0&&s.readAsDataURL(n.target.files[0])}}},[["render",Id]]),Nd=["autocomplete","disabled","placeholder","readonly","name","id"];function Ad(n,s,l,m,f,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Nd)),[[i.vModelText,n.value]])}const Fd=P({mixins:[Y],mounted(){this.$nextTick(function(){window.$&&window.$.fn.mask?$(this.$el).unmask().mask(this.schema.mask,this.schema.maskOptions):console.warn("JQuery MaskedInput library is missing. Please download from https://github.com/digitalBush/jquery.maskedinput and load the script in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.mask&&$(this.$el).unmask()}},[["render",Ad]]),Vd={mixins:[Y],data(){return{slider:null}},computed:{containPips(){return this.schema.noUiSliderOptions&&typeof this.schema.noUiSliderOptions.pips<"u"},containTooltip(){return this.schema.noUiSliderOptions&&this.schema.noUiSliderOptions.tooltips}},watch:{model:{handler(){window.noUiSlider&&this.slider&&this.slider.noUiSlider&&this.slider.noUiSlider.set(this.value)},deep:!0}},mounted(){this.$nextTick(()=>{window.noUiSlider?(this.slider=this.$el,window.noUiSlider.create(this.slider,C.defaults(this.schema.noUiSliderOptions||{},{start:this.getStartValue(),range:{min:this.schema.min,max:this.schema.max}})),this.slider.noUiSlider.on("change",this.onChange.bind(this))):console.warn("noUiSlider is missing. Please download from https://github.com/leongersen/noUiSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.noUiSlider.off("change")},methods:{onChange(n){C.isArray(n)?this.value=[parseFloat(n[0]),parseFloat(n[1])]:this.value=parseFloat(n)},formatValueToField(n){this.slider!==null&&typeof this.slider.noUiSlider<"u"&&this.slider.noUiSlider.set(n)},formatValueToModel(n){if(typeof this.slider.noUiSlider<"u")return n instanceof Array?[Number(n[0]),Number(n[1])]:Number(n)},getStartValue(){return this.value!=null?this.value:typeof this.schema.noUiSliderOptions<"u"&&this.schema.noUiSliderOptions.double?[this.schema.min,this.schema.min]:this.schema.min}}},$d=["disabled"];function Od(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["slider",{"contain-pips":u.containPips,"contain-tooltip":u.containTooltip}]),disabled:n.disabled||null},null,10,$d)}const Dd=P(Vd,[["render",Od]]),Ld=["autocomplete","disabled","placeholder","readonly","name"];function Ud(n,s,l,m,f,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,Ld)),[[i.vModelText,n.value]])}const Rd="YYYY-MM-DD",xd={mixins:[Y],data(){return{picker:null,options:null}},mounted(){this.initialize(C.get(this.schema,"pikadayOptions",{}))},beforeUnmount(){this.picker&&this.picker.destroy()},methods:{getDateFormat(){return C.get(this.schema,"pikadayOptions.format",Rd)},...So,initialize(n){this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(()=>{window.Pikaday?(this.options=C.defaults({},n,{field:this.$el,onSelect:()=>{this.value=this.picker.toString()}}),this.picker=new window.Pikaday(this.options)):console.warn("Pikaday is missing. Please download from https://github.com/dbushell/Pikaday/ and load the script and CSS in the HTML head section!")})}}},Pd=P(xd,[["render",Ud]]),qd=["autocomplete","data-disable","data-max","data-min","data-step","placeholder","readonly","name"];function zd(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,"data-disable":n.disabled,"data-max":n.schema.max,"data-min":n.schema.min,"data-step":n.schema.step,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,qd)}const Hd=P({mixins:[Y],data(){return{slider:null}},watch:{model:{deep:!0,handler(){if(window.$&&window.$.fn.ionRangeSlider){let n,s;C.isArray(this.value)?[n,s]=this.value:n=this.value,this.slider&&this.slider.update({from:n,to:s})}}}},mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.ionRangeSlider){let n,s;C.isArray(this.value)?[n,s]=this.value:n=this.value;const l=this;$(this.$el).ionRangeSlider(C.defaults(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:n,to:s,onChange(m){l.slider.options.type==="double"?l.value=[m.from,m.to]:l.value=m.from}})),this.slider=$(this.$el).data("ionRangeSlider")}else console.warn("ion.rangeSlider library is missing. Please download from https://github.com/IonDen/ion.rangeSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.destroy()}},[["render",zd]]),Wd=["disabled","multiple","title","name"],Kd=["disabled","selected"],Yd=["value"];function Gd(n,s,l,m,f,u){return i.withDirectives((i.openBlock(),i.createElementBlock("select",{class:"selectpicker","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),disabled:n.disabled||null,multiple:n.schema.multiSelect,title:n.schema.placeholder,"data-width":"100%",name:n.schema.inputName},[n.schema.multiSelect!==!0?(i.openBlock(),i.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null,selected:n.value==null},null,8,Kd)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,b=>(i.openBlock(),i.createElementBlock("option",{value:u.getItemValue(b)},i.toDisplayString(u.getItemName(b)),9,Yd))),256))],8,Wd)),[[i.vModelSelect,n.value]])}const Zd=P({mixins:[Y],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n}},watch:{model:{deep:!0,handler(){$.fn.selectpicker&&$(this.$el).selectpicker("refresh")}}},mounted(){this.$nextTick(function(){$.fn.selectpicker?$(this.$el).selectpicker("destroy").selectpicker(this.schema.selectOptions):console.warn("Bootstrap-select library is missing. Please download from https://silviomoreto.github.io/bootstrap-select/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){$.fn.selectpicker&&$(this.$el).selectpicker("destroy")},methods:{getItemValue(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n}}},[["render",Gd]]),Jd=["autocomplete","disabled","placeholder","readonly","name","id"];function Xd(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Jd)}const Qd=P({mixins:[Y],data(){return{picker:null}},watch:{model:{deep:!0,handler(){window.$&&window.$.fn.spectrum&&this.picker.spectrum("set",this.value)}},disabled(n){n?this.picker.spectrum("disable"):this.picker.spectrum("enable")}},mounted(){this.$nextTick(function(){window.$&&window.$.fn.spectrum?(this.picker=$(this.$el).spectrum("destroy").spectrum(C.defaults(this.schema.colorOptions||{},{showInput:!0,showAlpha:!0,disabled:this.schema.disabled,allowEmpty:!this.schema.required,preferredFormat:"hex",change:n=>{this.value=n?n.toString():null}})),this.picker.spectrum("set",this.value)):console.warn("Spectrum color library is missing. Please download from http://bgrins.github.io/spectrum/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.picker&&this.picker.spectrum("destroy")}},[["render",Xd]]),jd=["src"];function ec(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("img",{src:u.mapLink},null,8,jd)}const tc=P({mixins:[Y],computed:{mapLink(){let n,s,l;if(this.value){const m=C.defaults(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});n=this.value[m.lat],s=this.value[m.lng],l=`http://maps.googleapis.com/maps/api/staticmap?center=${n},${s}&zoom=${m.zoom}&size=${m.sizeX}x${m.sizeY}`;const f=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"];for(const u of f)typeof m[u]<"u"&&(l+=`&${u}=${m[u]}`)}return l}}},[["render",ec]]),nc=["autocomplete","disabled","name","id"],rc=["data-on","data-off","for"],ic=i.createElementVNode("span",{class:"handle"},null,-1);function oc(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("label",null,[i.withDirectives(i.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,nc),[[i.vModelCheckbox,n.value]]),i.createElementVNode("span",{class:"label","data-on":n.schema.textOn||"On","data-off":n.schema.textOff||"Off",for:n.getFieldID(n.schema)},null,8,rc),ic])}const lc=P({mixins:[Y],methods:{formatValueToField(n){return n!=null&&this.schema.valueOn?n===this.schema.valueOn:n},formatValueToModel(n){return n!=null&&this.schema.valueOn?n?this.schema.valueOn:this.schema.valueOff:n}}},[["render",oc]]),sc={mixins:[Y],data(){return{attributes:this.schema?this.schema.attributes:void 0,newKeyType:"string",newKeyName:"",keyTypes:{}}},created(){this.value||(this.value={})},mounted(){if(!this.value)return;const n=Object.keys(this.value),s={};for(let l=0;l<n.length;l++){const m=n[l];s[m]=typeof this.value[m]}this.keyTypes=s},methods:{removeElement(n){const s=this.value;delete s[n],this.value=JSON.parse(JSON.stringify(s));const l=this.keyTypes;delete l[n],this.keyTypes=JSON.parse(JSON.stringify(l))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""}}},ac={key:0},dc={key:1},cc=["id"],uc={key:0},fc=["onUpdate:modelValue"],hc={key:1},mc=["onUpdate:modelValue"],pc={key:2},gc=["onUpdate:modelValue"],yc=["onClick"],_c=[i.createElementVNode("option",{value:"string"}," String ",-1),i.createElementVNode("option",{value:"number"}," Number ",-1),i.createElementVNode("option",{value:"boolean"}," Boolean ",-1)];function bc(n,s,l,m,f,u){const b=i.resolveComponent("vue-form-generator"),g=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",null,[n.schema.schema?(i.openBlock(),i.createElementBlock("div",ac,[i.createVNode(b,{model:n.value,options:n.formOptions,schema:n.schema.schema},null,8,["model","options","schema"])])):(i.openBlock(),i.createElementBlock("div",dc,[i.createElementVNode("table",{id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(E,T)=>(i.openBlock(),i.createElementBlock("tr",{key:T},[i.createElementVNode("td",null,i.toDisplayString(T),1),f.keyTypes[T]==="string"?(i.openBlock(),i.createElementBlock("td",uc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":A=>n.value[T]=A,type:"text"},null,8,fc),[[i.vModelText,n.value[T]]])])):i.createCommentVNode("",!0),f.keyTypes[T]==="boolean"?(i.openBlock(),i.createElementBlock("td",hc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":A=>n.value[T]=A,type:"checkbox"},null,8,mc),[[i.vModelCheckbox,n.value[T]]])])):i.createCommentVNode("",!0),f.keyTypes[T]==="number"?(i.openBlock(),i.createElementBlock("td",pc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":A=>n.value[T]=A,type:"number"},null,8,gc),[[i.vModelText,n.value[T]]])])):i.createCommentVNode("",!0),i.createElementVNode("td",null,[i.createElementVNode("input",{type:"button",value:"x",onClick:A=>u.removeElement(T)},null,8,yc)])]))),128))],10,cc),i.withDirectives(i.createElementVNode("select",{"onUpdate:modelValue":s[0]||(s[0]=E=>f.newKeyType=E)},_c,512),[[i.vModelSelect,f.newKeyType]]),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":s[1]||(s[1]=E=>f.newKeyName=E),type:"text"},null,512),[[i.vModelText,f.newKeyName]]),i.createElementVNode("input",{type:"button",value:"Add key",onClick:s[2]||(s[2]=(...E)=>u.addKey&&u.addKey(...E))})]))])),[[g,f.attributes]])}const Bo=P(sc,[["render",bc]]),wc={mixins:[Y],emits:["model-updated"],data(){return{newKeyName:""}},computed:{subSchema(){return this.schema.schema&&this.schema.schema.fields[0].schema},subFields(){return!this.subSchema&&this.schema.fields},hasObjectKeys(){return this.value&&Object.keys(this.value).length>0},transformedModel(){return this.subSchema&&this.subSchema.fields.length>=1&&this.subSchema.fields[0].type==="array"?new Proxy(this.model[this.schema.model],{get:(n,s)=>({[this.schema.model]:n[s]}),set:(n,s,l)=>n[s]=l[this.schema.model]}):this.model[this.schema.model]}},mounted(){this.value||(this.value={});let n=[];this.subSchema?n=this.subSchema.fields:this.subFields&&(n=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,n,this.schema.model)},methods:{removeElement(n){const s=this.value;delete s[n],this.value={...s}},transformMapModelValuesToObject(n,s,l){const m={};return Object.keys(n).map(f=>{const u=f.indexOf(l+"-");if(u>-1&&Array.isArray(s))if(s.length>0){const g=f.split("-").filter(T=>s.find(A=>A.model===T)),E=f.split(`-${g}`)[0].split(`${l}-`)[1];g.length?m[E]={...m[E],[g]:n[f]}:m[f.substring(u+`${l}-`.length)]=n[f]}else m[f.substring(`${l}-`.length)]=n[f];else{const g=f.split("-").filter(T=>T===this.schema.model),E=f.split(`-${g}`)[0].split(`${l}-`)[1];E&&(m[E]=n[f])}return f}),m},addKey(){const n=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",s=this.subSchema?n?[""]:{}:"";this.value[this.newKeyName]=s,this.newKeyName=""},updateModel(n,s){this.$emit("model-updated",this.model[this.schema.model],s)}}},To=n=>(i.pushScopeId("data-v-22600a29"),n=n(),i.popScopeId(),n),Cc=["id"],kc=["data-testid"],Ec={class:"item-wrapper"},Sc={class:"index-wrapper"},vc=To(()=>i.createElementVNode("hr",{class:"divider"},null,-1)),Bc={key:0},Tc={key:1},Ic=["onUpdate:modelValue","placeholder","onInput"],Mc={key:0,class:"hint"},Nc=To(()=>i.createElementVNode("hr",{class:"wide-divider"},null,-1)),Ac={class:"input-item"},Fc=["placeholder"],Vc={key:0,class:"hint"};function $c(n,s,l,m,f,u){const b=i.resolveComponent("KIcon"),g=i.resolveComponent("KButton"),E=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",{id:n.getFieldID(n.schema),class:i.normalizeClass(["object-advanced-wrapper",n.schema.fieldClasses])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(T,A)=>(i.openBlock(),i.createElementBlock("div",{key:A,"data-testid":`field-object-key-${A}`},[i.createElementVNode("div",null,[i.createElementVNode("div",Ec,[i.createElementVNode("div",Sc,[i.createElementVNode("strong",null,i.toDisplayString(A),1),i.createElementVNode("div",null,[i.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:Q=>u.removeElement(A)},{default:i.withCtx(()=>[i.createVNode(b,{icon:"trash",size:"18"})]),_:2},1032,["onClick"])])]),vc,u.subSchema?(i.openBlock(),i.createElementBlock("div",Bc,[i.createVNode(E,{model:u.transformedModel[A],options:{helpAsHtml:!0},schema:u.subSchema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])):(i.openBlock(),i.createElementBlock("div",Tc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":Q=>n.value[A]=Q,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:"text",onInput:Q=>u.updateModel(n.value[A],n.model[n.schema.model])},null,40,Ic),[[i.vModelText,n.value[A]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(i.openBlock(),i.createElementBlock("p",Mc,i.toDisplayString(n.schema.fields[0].schema.hint),1)):i.createCommentVNode("",!0)])),Nc])])],8,kc))),128)),i.createElementVNode("div",{class:i.normalizeClass(["input-wrapper",{indent:u.hasObjectKeys}])},[i.createElementVNode("div",Ac,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=T=>f.newKeyName=T),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Fc),[[i.vModelText,f.newKeyName]]),i.createVNode(g,{appearance:"tertiary","data-testid":"add-key",disabled:!f.newKeyName,onClick:u.addKey},{default:i.withCtx(()=>[i.createTextVNode(" + Add "+i.toDisplayString(n.schema.buttonLabel||n.schema.label),1)]),_:1},8,["disabled","onClick"])]),n.schema.hintText?(i.openBlock(),i.createElementBlock("p",Vc,i.toDisplayString(n.schema.hintText),1)):i.createCommentVNode("",!0)],2)],10,Cc)}const Io=P(wc,[["render",$c],["__scopeId","data-v-22600a29"]]),Dn="24px",Mo=(n,s)=>{const l=n.__vccOpts||n;for(const[m,f]of s)l[m]=f;return l},Oc=n=>(i.pushScopeId("data-v-89afc35c"),n=n(),i.popScopeId(),n),Dc=["aria-hidden"],Lc={key:0,"data-testid":"kui-icon-svg-title"},Uc=Oc(()=>i.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Rc=i.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const s=String(n).replace(/px/gi,""),l=Number(s);if(l&&!isNaN(l)&&Number.isInteger(l)&&l>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const s=n,l=i.computed(()=>{if(typeof s.size=="number"&&s.size>0)return`${s.size}px`;if(typeof s.size=="string"){const f=String(s.size).replace(/px/gi,""),u=Number(f);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=i.computed(()=>({boxSizing:"border-box",color:s.color,display:s.display,height:l.value,lineHeight:"0",width:l.value}));return(f,u)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:i.normalizeStyle(m.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(i.openBlock(),i.createElementBlock("title",Lc,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),Uc],8,Dc))]),_:1},8,["aria-hidden","style"]))}}),xc=Mo(Rc,[["__scopeId","data-v-89afc35c"]]),Pc=n=>(i.pushScopeId("data-v-d0880e9f"),n=n(),i.popScopeId(),n),qc=["aria-hidden"],zc={key:0,"data-testid":"kui-icon-svg-title"},Hc=Pc(()=>i.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),Wc=i.defineComponent({__name:"TrashIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const s=String(n).replace(/px/gi,""),l=Number(s);if(l&&!isNaN(l)&&Number.isInteger(l)&&l>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const s=n,l=i.computed(()=>{if(typeof s.size=="number"&&s.size>0)return`${s.size}px`;if(typeof s.size=="string"){const f=String(s.size).replace(/px/gi,""),u=Number(f);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=i.computed(()=>({boxSizing:"border-box",color:s.color,display:s.display,height:l.value,lineHeight:"0",width:l.value}));return(f,u)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:i.normalizeStyle(m.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-trash-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(i.openBlock(),i.createElementBlock("title",zc,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),Hc],8,qc))]),_:1},8,["aria-hidden","style"]))}}),Ln=Mo(Wc,[["__scopeId","data-v-d0880e9f"]]),Kc={name:"FieldArrayItem",components:{TrashIcon:Ln},props:{model:{type:String,default:null}},emits:["remove-item"],data(){return{contentVisible:!1}}},Yc={class:"array-item"};function Gc(n,s,l,m,f,u){const b=i.resolveComponent("TrashIcon"),g=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Yc,[i.renderSlot(n.$slots,"default",{},void 0,!0),i.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:s[0]||(s[0]=E=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})])}const No=P(Kc,[["render",Gc],["__scopeId","data-v-d42daeb2"]]),Zc={name:"FieldArrayMultiItem",emits:["remove-item"],data(){return{contentVisible:!1}}},Jc=n=>(i.pushScopeId("data-v-47ff1f9a"),n=n(),i.popScopeId(),n),Xc={class:"multi-item-wrapper"},Qc=Jc(()=>i.createElementVNode("hr",null,null,-1));function jc(n,s,l,m,f,u){const b=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Xc,[i.renderSlot(n.$slots,"default",{},void 0,!0),i.createVNode(b,{appearance:"danger",class:"delete",type:"input",onClick:s[0]||(s[0]=g=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createTextVNode(" - Remove Field ")]),_:1}),Qc])}const Ao=P(Zc,[["render",jc],["__scopeId","data-v-47ff1f9a"]]),eu={name:"FieldMetric",components:{AddIcon:xc,TrashIcon:Ln},mixins:[Y],emits:["remove-item"],data(){return{contentVisible:!1}}},tu={key:0,class:"content"};function nu(n,s,l,m,f,u){const b=i.resolveComponent("AddIcon"),g=i.resolveComponent("TrashIcon"),E=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["field-dropdown",{active:f.contentVisible}])},[i.createElementVNode("div",{class:"title",onClick:s[0]||(s[0]=T=>f.contentVisible=!f.contentVisible)},[i.createTextVNode(i.toDisplayString(n.model.name?n.model.name:"New Item")+" ",1),i.createVNode(b,{class:"metric-add-icon"})]),i.createVNode(i.Transition,{name:"slide-fade"},{default:i.withCtx(()=>[f.contentVisible?(i.openBlock(),i.createElementBlock("div",tu,[i.renderSlot(n.$slots,"default"),i.createVNode(E,{appearance:"tertiary",class:"metric-remove-button",onClick:s[1]||(s[1]=T=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(g)]),_:1})])):i.createCommentVNode("",!0)]),_:3})],2)}const Fo=P(eu,[["render",nu]]),wt="kong-ui-forms-api",ru="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";function iu(n){return n?n.length===36&&new RegExp(`^${ru}$`).test(n):!1}const Fr=50,Ft={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"};function ou(n,s,l){return l?Ft.SET_REFERRAL_VALUE:n&&!s||!n&&s?Ft.UPDATE_ENTITY:n&&s?Ft.CREATE_FROM_ENTITY:Ft.CREATE_NOT_FROM_ENTITY}const lu={mixins:[Y],inject:[wt],emits:["model-updated"],data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return ou(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search}},watch:{idValue:{handler(n,s){n!==s&&this.updateModel(n)}}},async created(){await this.$nextTick();let n,s;switch(this.fieldState){case Ft.UPDATE_ENTITY:if(!this[wt]){console.warn("[@kong-ui-public/forms] No API service provided");break}s=(await this[wt].getOne(this.entity,this.model[this.schema.model])).data,n=this.getItem(this.schema.entityDataKey?s[this.schema.entityDataKey]:s),this.idValue=n.id;break;case Ft.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case Ft.SET_REFERRAL_VALUE:this.idValue=this.value}try{n&&(this.initialItems=[{...n,label:this.getSuggestionLabel(n),value:n.id}]),this.items=this.initialItems}catch(l){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",l)}},methods:{onQueryChange(n){n.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=C.debounce(this.search,500)),this.performSearch(n)},async search(n){if(n.trim().length===0)return;this.loading=!0;const s=[],l=[],m=this.getInputFields(),f=new Set;iu(n)&&m.includes("id")?l.push((async()=>{const u=await this.fetchExact(n);s.push({...u,label:this.getSuggestionLabel(u),value:u.id})})()):l.push(...m.filter(u=>u!=="id").map(async u=>{(await this.fetchSuggestions(n,u)).forEach(g=>{f.has(g.id)||(f.add(g.id),s.push({...g,label:this.getSuggestionLabel(g),value:g.id}))})})),await Promise.all(l),this.items=s,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(n){return n.data?n.data.length>0?n.data[0]:[]:n},async fetchUntilLimit(n){const s=[];let l=null;if(!this[wt])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;s.length<Fr;){const m=await this[wt].getAll(this.entity,{size:Fr,offset:l,...n});if(s.push(...m.data.data),l=m.data.offset,!l)break}return s.slice(0,Fr)},async fetchSuggestions(n,s){return this.fetchUntilLimit({[s]:n})},async fetchExact(n){return this[wt]?(await this[wt].getOne(this.entity,n)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var n,s;return((s=(n=this.schema)==null?void 0:n.inputValues)==null?void 0:s.fields)||[]},getSuggestionLabel(n){const s=this.getInputFields();return s.length&&n?s.map(l=>n[l]).filter(Boolean).join(" - "):""},updateModel(n){this.$emit("model-updated",n!=null&&n.length?n:null,this.schema.model)},onSelected(n){this.idValue=n&&n.id,this.updateModel(this.getReturnValue(n||{}))},getReturnValue(n){var l;const s=(l=this.schema)==null?void 0:l.returnKey;return s?n[s]:n.id}}},su={class:"field-wrap autosuggest"},au=["data-testid","data-testlabel"],du=["data-testid"],cu={class:"autosuggest__results_message"};function uu(n,s,l,m,f,u){const b=i.resolveComponent("KSelect");return i.openBlock(),i.createElementBlock("div",su,[i.createVNode(b,{id:n.schema.model,ref:"suggestion",modelValue:f.idValue,"onUpdate:modelValue":s[0]||(s[0]=g=>f.idValue=g),clearable:"","enable-filtering":"","filter-function":()=>!0,items:f.items,loading:f.loading,placeholder:n.schema.placeholder,width:"100%",onChange:u.onSelected,onQueryChange:u.onQueryChange},{"item-template":i.withCtx(({item:g})=>[i.createElementVNode("span",{class:"first-part","data-testid":g.id&&`${g.id}-0`,"data-testlabel":g.label},i.toDisplayString(u.getSuggestionLabel(g).split(" - ")[0]),9,au),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.getSuggestionLabel(g).split(" - ").slice(1),(E,T)=>(i.openBlock(),i.createElementBlock("span",{key:T,class:"field-span","data-testid":g.id&&`${g.id}-${T+1}`||T+1},i.toDisplayString(E),9,du))),128))]),empty:i.withCtx(()=>[i.createElementVNode("div",cu,[i.createElementVNode("span",null,i.toDisplayString(f.message),1)])]),_:1},8,["id","modelValue","items","loading","placeholder","onChange","onQueryChange"])])}const Vo=P(lu,[["render",uu],["__scopeId","data-v-62760c9d"]]),fu={name:"FieldArrayCardContainer",components:{TrashIcon:Ln},props:{model:{type:Object,default:null},schema:{type:Object,default:null}},emits:["remove-item"]},hu={class:"array-card-container"};function mu(n,s,l,m,f,u){const b=i.resolveComponent("KCard"),g=i.resolveComponent("TrashIcon"),E=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",hu,[i.createVNode(b,{class:"card"},{default:i.withCtx(()=>[i.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3}),i.createVNode(E,{appearance:"tertiary",class:"array-card-remove-button",onClick:s[0]||(s[0]=T=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(g)]),_:1})])}const $o=P(fu,[["render",mu],["__scopeId","data-v-68702965"]]),pu={mixins:[Y],emits:["model-updated"],methods:{updateModel(n){this.$emit("model-updated",n,this.schema.model)},checkOption(n){return this.model[this.schema.model]?n.value.toString()===this.model[this.schema.model].toString():n.checked},onChange(n){let s=n.target.value.split(",");this.schema.array||(s=s.toString()),this.updateModel(s)}}},gu={class:"selection-group"},yu={class:"form-group"},_u=["id","checked","name","value"];function bu(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("div",gu,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.schema.values,(b,g)=>(i.openBlock(),i.createElementBlock("div",{key:g,class:"option-group"},[i.createElementVNode("div",yu,[i.createElementVNode("label",{class:i.normalizeClass(["k-label",b.name])},[i.createElementVNode("input",{id:n.schema.name+"-"+g,checked:u.checkOption(b),class:"k-input",name:n.schema.name,type:"radio",value:b.value,onChange:s[0]||(s[0]=(...E)=>u.onChange&&u.onChange(...E))},null,40,_u),i.createTextVNode(" "+i.toDisplayString(b.name),1)],2)])]))),128))])}const Oo=P(pu,[["render",bu],["__scopeId","data-v-7e49acd6"]]),wu={name:"FieldArray",components:{FieldArrayItem:No,FieldArrayMultiItem:Ao,FieldSelect:ko,FieldMetric:Fo,FieldObject:Bo,FieldObjectAdvanced:Io,FieldAutoSuggest:Vo,FieldRadio:Oo,FieldArrayCardContainer:$o,FieldTextArea:Eo,FieldInput:Co},mixins:[Y],props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},methods:{generateSchema(n,s,l){var f,u,b;let m;return s&&(m=JSON.parse(JSON.stringify(s)),(b=(u=(f=m.schema)==null?void 0:f.fields)==null?void 0:u.map)==null||b.call(u,g=>(g.id=`${g.id||g.model}-${l}`,g))),{...m,set(g,E){n[l]=E},get(){return n[l]}}},newElement(){let n=this.value,s;(!n||!n.push)&&(n=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?s=this.schema.items.default():s=this.schema.items.default),n.push(s),this.value=[...n]},removeElement(n){this.value.splice(n,1)},getFieldType(n){return"field-"+n.type},modelUpdated(){}}},Cu=["id"],ku={key:1},Eu=["onUpdate:modelValue","aria-labelledby","type"],Su=["value","onClick"],vu=["onUpdate:modelValue","aria-labelledby"],Bu=["value","onClick"];function Tu(n,s,l,m,f,u){const b=i.resolveComponent("FieldTextArea"),g=i.resolveComponent("KButton");return n.schema?(i.openBlock(),i.createElementBlock("div",{key:0,id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(E,T)=>(i.openBlock(),i.createElementBlock("div",{key:T,class:i.normalizeClass(n.schema.fieldItemsClasses)},[n.schema.items&&n.schema.itemContainerComponent?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.schema.itemContainerComponent),{key:0,model:E,schema:u.generateSchema(n.value,n.schema.items,T),onRemoveItem:A=>u.removeElement(T)},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:E,schema:u.generateSchema(n.value,n.schema.items,T),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["model","schema","onRemoveItem"])):n.schema.items?(i.openBlock(),i.createElementBlock("span",ku,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:E,schema:u.generateSchema(n.value,n.schema.items,T),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):n.schema.itemContainerComponent?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.schema.itemContainerComponent),{key:2,"data-testid":`${n.getFieldID(n.schema)}-item-${T}`,model:E,schema:u.generateSchema(n.value,n.schema.items,T),onRemoveItem:A=>u.removeElement(T)},{default:i.withCtx(()=>{var A,Q;return[((A=n.schema.inputAttributes)==null?void 0:A.type)==="textarea"?(i.openBlock(),i.createBlock(b,{key:0,"aria-labelledby":n.getLabelId(n.schema),class:"k-input","form-options":n.formOptions,model:E,schema:u.generateSchema(n.value,n.schema.items,T),onModelUpdated:u.modelUpdated},null,8,["aria-labelledby","form-options","model","schema","onModelUpdated"])):i.withDirectives((i.openBlock(),i.createElementBlock("input",i.mergeProps({key:1,"onUpdate:modelValue":J=>n.value[T]=J,"aria-labelledby":n.getLabelId(n.schema)},n.schema.inputAttributes,{type:((Q=n.schema.inputAttributes)==null?void 0:Q.type)||"text"}),null,16,Eu)),[[i.vModelDynamic,n.value[T]]]),n.schema.showRemoveButton?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:2},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||l.removeElementButtonLabel,onClick:J=>u.removeElement(T)}),null,16,Su)):i.createCommentVNode("",!0)]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):i.withDirectives((i.openBlock(),i.createElementBlock("input",i.mergeProps({key:3},n.schema.inputAttributes,{"onUpdate:modelValue":A=>n.value[T]=A,"aria-labelledby":n.getLabelId(n.schema),type:"text"}),null,16,vu)),[[i.vModelText,n.value[T]]]),n.schema.showRemoveButton?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:4},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||l.removeElementButtonLabel,onClick:A=>u.removeElement(T)}),null,16,Bu)):i.createCommentVNode("",!0)],2))),128)),i.createVNode(g,{appearance:"tertiary",class:i.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`add-${n.getFieldID(n.schema)}`,type:"button",onClick:u.newElement},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.schema.newElementButtonLabel||l.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Cu)):i.createCommentVNode("",!0)}const Iu=P(wu,[["render",Tu],["__scopeId","data-v-1c5fa392"]]),Mu={mixins:[Y],emits:["model-updated"],data(){return{isOpen:!1}},computed:{openClass(){return this.isOpen?"open":"closed"},fieldCount(){return this.schema.fields.length},titleText(){return`${this.isOpen?"Hide":"View"} ${this.fieldCount} Advanced Fields`}},methods:{handleOpen(){this.isOpen=!this.isOpen},updateModel(n,s){this.$emit("model-updated",n,s)}}},Nu={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},Au={class:"material-icons"};function Fu(n,s,l,m,f,u){const b=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",Nu,[i.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:s[0]||(s[0]=(...g)=>u.handleOpen&&u.handleOpen(...g))},[i.createElementVNode("i",Au,i.toDisplayString(f.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),i.createElementVNode("span",null,i.toDisplayString(u.titleText),1)]),i.createElementVNode("div",{class:i.normalizeClass(["advanced-field-dropdown",u.openClass])},[i.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])],2)])}const Vu=P(Mu,[["render",Fu],["__scopeId","data-v-2d8e71e1"]]),$u={mixins:[Y],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},fieldSchema:[]}},watch:{checkedGroup:{handler(n,s){if(s===null){this.fieldModel={...this.model};return}const l=this.schema.fields[n].fields,m=this.schema.fields[s].fields;m&&m.forEach(f=>this.updateModel("",f.model)),l&&l.forEach(f=>this.updateModel(this.fieldModel[f.model],f.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((n,s)=>{n.fields&&n.fields.forEach(l=>{this.model[l.model]&&(this.checkedGroup=s,this.fieldSchema.push(l.model))})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(n,s){this.$emit("model-updated",n,s)}}},Ou={class:"selection-group"},Du={class:"form-group"},Lu=["value"],Uu={class:"control-help"},Ru={class:"option-field"},xu={class:"option-field-container"};function Pu(n,s,l,m,f,u){const b=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",Ou,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.schema.fields,(g,E)=>(i.openBlock(),i.createElementBlock("div",{key:E,class:"option-group"},[i.createElementVNode("div",Du,[i.createElementVNode("label",{class:i.normalizeClass(["k-label",`${g.label}-check`])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=T=>f.checkedGroup=T),class:"k-input",type:"radio",value:E},null,8,Lu),[[i.vModelRadio,f.checkedGroup]]),i.createTextVNode(" "+i.toDisplayString(g.label)+" ",1),i.createElementVNode("div",Uu,i.toDisplayString(g.description),1)],2)]),i.withDirectives(i.createElementVNode("div",Ru,[i.createElementVNode("div",xu,[i.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:{fields:g.fields},onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[i.vShow,g.fields&&f.checkedGroup===E]])]))),128))])}const qu=P($u,[["render",Pu],["__scopeId","data-v-25fe24da"]]),zu={mixins:[Y],emits:["model-updated"],methods:{onUpdate(n){this.$emit("model-updated",n,this.schema.model)}}};function Hu(n,s,l,m,f,u){const b=i.resolveComponent("KMultiselect");return i.openBlock(),i.createBlock(b,{"aria-labelledby":n.getLabelId(n.schema),"data-testid":"field-multiselect",items:n.schema.values,"label-attributes":{info:n.schema.help},"model-value":n.value,placeholder:n.schema.placeholder,required:n.schema.required||void 0,width:"100%","onUpdate:modelValue":u.onUpdate},null,8,["aria-labelledby","items","label-attributes","model-value","placeholder","required","onUpdate:modelValue"])}const Wu=P(zu,[["render",Hu]]),Ku={name:"FieldKeyValuePairs",components:{TrashIcon:Ln},mixins:[Y],data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var s,l;this.value||(this.value={});const n=((l=this.model)==null?void 0:l[(s=this.schema)==null?void 0:s.model])??{};Object.keys(n).forEach(m=>{this.pairs.push({key:m,value:n[m]})})},methods:{onInput(n,s,l){this.pairs[s][l]=n.target.value},updateValue(){this.value=this.pairs.reduce((n,{key:s,value:l})=>({...n,...s&&l?{[s]:l}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(n){this.pairs.splice(n,1)}}},Yu={class:"key-value-pairs-editor"},Gu=["data-testid","placeholder","value","onInput"],Zu=["data-testid","placeholder","value","onInput"];function Ju(n,s,l,m,f,u){const b=i.resolveComponent("TrashIcon"),g=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Yu,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(f.pairs,(E,T)=>(i.openBlock(),i.createElementBlock("div",{key:T,class:"pair-item"},[i.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-key-${T}`,placeholder:n.schema.keyInputPlaceholder??"Key",type:"text",value:E.key,onInput:A=>{u.onInput(A,T,"key")}},null,40,Gu),i.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-value-${T}`,placeholder:n.schema.valueInputPlaceholder??"Value",type:"text",value:E.value,onInput:A=>{u.onInput(A,T,"value")}},null,40,Zu),i.createVNode(g,{appearance:"tertiary","data-testid":`${n.getFieldID(n.schema)}-remove-pair-${T}`,onClick:()=>{u.removePair(T)}},{default:i.withCtx(()=>[i.createVNode(b)]),_:2},1032,["data-testid","onClick"])]))),128)),i.createVNode(g,{appearance:"tertiary",class:i.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`${n.getFieldID(n.schema)}-add-pair`,type:"button",onClick:u.addPair},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Xu={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:Vu,FieldArray:Iu,FieldArrayCardContainer:$o,FieldArrayItem:No,FieldArrayMultiItem:Ao,FieldAutoSuggest:Vo,FieldCheckbox:Na,FieldChecklist:xa,FieldCleave:pd,FieldDateTimePicker:Cd,FieldGoogleAddress:Sd,FieldImage:Md,FieldInput:Co,FieldKeyValuePairs:P(Ku,[["render",Ju],["__scopeId","data-v-29d15375"]]),FieldLabel:Ya,FieldMasked:Fd,FieldMetric:Fo,FieldMultiselect:Wu,FieldNoUiSlider:Dd,FieldObject:Bo,FieldObjectAdvanced:Io,FieldPikaday:Pd,FieldRadio:Oo,FieldRadios:Xa,FieldRangeSlider:Hd,FieldSelect:ko,FieldSelectEx:Zd,FieldSelectionGroup:qu,FieldSpectrum:Qd,FieldStaticMap:tc,FieldSubmit:ld,FieldTextArea:Eo,FieldUpload:fd,fieldSwitch:lc},Symbol.toStringTag,{value:"Module"})),mixins:[no],props:{vfg:{type:Object,required:!0},model:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},field:{type:Object,required:!0},errors:{type:Array,default(){return[]}}},emits:["validated","modelUpdated"],data(){return{child:i.ref()}},methods:{fieldTypeHasLabel(n){if(C.isNil(n.label))return!1;let s="";switch(n.type==="input"?s=n.inputType:s=n.type,s){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(n){const s=C.get(this.options,"fieldIdPrefix","");return ro(n,s)},getTooltipId(n){return`${this.getFieldID(n)}-tooltip`},getFieldType(n){return"field-"+n.type},getButtonType(n){return C.get(n,"type","button")},onFieldValidated(n,s,l){this.$emit("validated",n,s,l)},buttonVisibility(n){return n.buttons&&n.buttons.length>0},buttonClickHandler(n,s,l){return n.onclick.call(this,this.model,s,l,this)},fieldHint(n){return C.isFunction(n.hint)?n.hint.call(this,this.model,n,this):n.hint},fieldErrors(n){return this.errors.filter(s=>s.field.fieldName===n.fieldName).map(s=>s.error)},onModelUpdated(n,s){this.$emit("modelUpdated",n,s)},validate(n){return this.$refs.child.validate(n)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(n){return n?n.replace(/^[cC]onfig\./,""):""}}},Do=n=>(i.pushScopeId("data-v-60b9a75a"),n=n(),i.popScopeId(),n),Qu=["aria-describedby","for"],ju={class:"icon-wrapper"},ef=["innerHTML"],tf=Do(()=>i.createElementVNode("div",{class:"help",role:"button",tabindex:"0"},[i.createElementVNode("i",{class:"icon"})],-1)),nf=["innerHTML"],rf={key:0,class:"link-wrapper"},of=Do(()=>i.createElementVNode("span",{class:"section-header"},"More info",-1)),lf={class:"field-wrap"},sf={key:0,class:"buttons"},af=["type","onClick","textContent"],df=["innerHTML"],cf={key:2,class:"errors help-block"},uf=["innerHTML"];function ff(n,s,l,m,f,u){const b=i.resolveComponent("KTooltip"),g=i.resolveComponent("KExternalLink");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["form-group",n.getFieldRowClasses(l.field)])},[u.fieldTypeHasLabel(l.field)?(i.openBlock(),i.createElementBlock("label",{key:0,"aria-describedby":l.field.help?u.getTooltipId(l.field):void 0,class:i.normalizeClass(["form-group-label",l.field.labelClasses]),for:u.getFieldID(l.field)},[i.createElementVNode("div",ju,[i.createElementVNode("span",{innerHTML:u.formattedLabel(l.field.label)},null,8,ef),l.field.help?(i.openBlock(),i.createBlock(b,{key:0,"max-width":"300",placement:"top","position-fixed":!0,"tooltip-id":u.getTooltipId(l.field)},{content:i.withCtx(()=>[l.options.helpAsHtml?(i.openBlock(),i.createElementBlock("div",{key:0,innerHTML:l.field.help},null,8,nf)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(l.field.help),1)],64))]),default:i.withCtx(()=>[tf]),_:1},8,["tooltip-id"])):i.createCommentVNode("",!0)]),l.field.link?(i.openBlock(),i.createElementBlock("div",rf,[i.createVNode(g,{href:l.field.link},{default:i.withCtx(()=>[of]),_:1},8,["href"])])):i.createCommentVNode("",!0)],10,Qu)):i.createCommentVNode("",!0),i.createElementVNode("div",lf,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(l.field)),i.mergeProps(n.$attrs,{ref:"child",disabled:n.fieldDisabled(l.field)||null,"form-options":l.options,model:l.model,schema:l.field,vfg:l.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated}),null,16,["disabled","form-options","model","schema","vfg","onModelUpdated","onValidated"])),u.buttonVisibility(l.field)?(i.openBlock(),i.createElementBlock("div",sf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.field.buttons,(E,T)=>(i.openBlock(),i.createElementBlock("button",{key:T,class:i.normalizeClass(E.classes),type:u.getButtonType(E),onClick:A=>u.buttonClickHandler(E,l.field,A),textContent:i.toDisplayString(E.label)},null,10,af))),128))])):i.createCommentVNode("",!0)]),l.field.hint?(i.openBlock(),i.createElementBlock("div",{key:1,class:"hint",innerHTML:u.fieldHint(l.field)},null,8,df)):i.createCommentVNode("",!0),u.fieldErrors(l.field).length>0?(i.openBlock(),i.createElementBlock("div",cf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.fieldErrors(l.field),(E,T)=>(i.openBlock(),i.createElementBlock("span",{key:T,innerHTML:E},null,8,uf))),128))])):i.createCommentVNode("",!0)],2)}const hf={name:"FormGenerator",components:{formGroup:P(Xu,[["render",ff],["__scopeId","data-v-60b9a75a"]])},mixins:[no],props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:i.ref([]),fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:"",helpAsHtml:!1}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(n){return n.length>0}}},emits:["validated","modelUpdated"],data(){return{vfg:this,errors:[],children:i.ref([]),collapseStates:{}}},computed:{fields(){const n=[];return this.schema&&this.schema.fields&&C.forEach(this.schema.fields,s=>{(!this.multiple||s.multi===!0)&&n.push(s)}),n},groups(){const n=[];return this.schema&&this.schema.groups&&C.forEach(this.schema.groups.slice(0),s=>{n.push(s)}),n}},watch:{model:{deep:!0,handler(n,s){s!==n&&n!=null&&this.$nextTick(()=>{this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors()})}}},mounted(){this.$nextTick(()=>{this.model&&(this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors())})},methods:{fieldVisible(n){return C.isFunction(n.visible)?n.visible.call(this,this.model,n,this):C.isNil(n.visible)?!0:n.visible},onFieldValidated(n,s,l){this.errors=this.errors.filter(f=>f.field.fieldName!==l.schema.fieldName),!n&&s&&s.length>0&&C.forEach(s,f=>{this.errors.push({field:l.schema,error:f})});const m=this.errors.length===0;this.$emit("validated",m,this.errors,this)},onModelUpdated(n,s){this.$emit("modelUpdated",n,s)},validate(n=null){n===null&&(n=C.get(this.options,"validateAsync",!1)),this.clearValidationErrors();const s=[],l=[];C.forEach(this.$refs.children,f=>{C.isFunction(f.validate)&&(s.push(f.$refs.child),l.push(f.$refs.child.validate(!0)))});const m=f=>{const u=[];C.forEach(f,(g,E)=>{C.isArray(g)&&g.length>0&&C.forEach(g,T=>{u.push({field:s[E].schema,error:T})})}),this.errors=u;const b=u.length===0;return this.$emit("validated",b,u,this),n?u:b};return n?Promise.all(l).then(m):m(l)},clearValidationErrors(){this.errors.splice(0),C.forEach(this.$refs.children,n=>{n.clearValidationErrors()})}}},mf={key:0,class:"vue-form-generator"},pf={key:0};function gf(n,s,l,m,f,u){const b=i.resolveComponent("form-group"),g=i.resolveComponent("KCollapse");return l.schema!=null?(i.openBlock(),i.createElementBlock("div",mf,[l.schema.fields?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.tag),{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.fields,E=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:E.model},[u.fieldVisible(E)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",errors:f.errors,field:E,model:l.model,options:l.options,vfg:f.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):i.createCommentVNode("",!0)],64))),128))]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.groups,(E,T)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:`group-${T}`},[E.collapsible!==void 0&&E.collapsible!==!1?(i.openBlock(),i.createBlock(g,{key:0,class:"root-level-collapse","model-value":!1,title:E.collapsible.title},i.createSlots({default:i.withCtx(()=>{var A,Q,J,me;return[(A=E.slots)!=null&&A.beforeContent?i.renderSlot(n.$slots,(Q=E.slots)==null?void 0:Q.beforeContent,{key:0}):i.createCommentVNode("",!0),E.fields.length===0&&((J=E.slots)!=null&&J.emptyState)?i.renderSlot(n.$slots,(me=E.slots)==null?void 0:me.emptyState,{key:1}):(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.tag),{key:2,class:i.normalizeClass(n.getFieldRowClasses(E))},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.fields,de=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:de.model},[u.fieldVisible(de)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",errors:f.errors,field:de,model:l.model,options:l.options,vfg:f.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):i.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),E.collapsible!==!0&&E.collapsible.nestedCollapsible&&E.collapsible.nestedCollapsible.fields.length>0?(i.openBlock(),i.createBlock(g,{key:3,class:"nested-collapse","model-value":f.collapseStates[`group-${T}-nested`]??!0,"trigger-alignment":"leading","trigger-label":f.collapseStates[`group-${T}-nested`]??!0?E.collapsible.nestedCollapsible.triggerLabel.expand:E.collapsible.nestedCollapsible.triggerLabel.collapse,"onUpdate:modelValue":de=>f.collapseStates[`group-${T}-nested`]=de},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.tag),{class:i.normalizeClass(n.getFieldRowClasses(E))},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.collapsible.nestedCollapsible.fields,de=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:de.model},[u.fieldVisible(de)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",errors:f.errors,field:de,model:l.model,options:l.options,vfg:f.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):i.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))]),_:2},1032,["model-value","trigger-label","onUpdate:modelValue"])):i.createCommentVNode("",!0)]}),_:2},[E.collapsible.description?{name:"visible-content",fn:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(E.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.tag),{key:1,class:i.normalizeClass(n.getFieldRowClasses(E))},{default:i.withCtx(()=>[E.legend?(i.openBlock(),i.createElementBlock("legend",pf,i.toDisplayString(E.legend),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.fields,A=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:A.model},[u.fieldVisible(A)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",errors:f.errors,field:A,model:l.model,options:l.options,vfg:f.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):i.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))],64))),128))])):i.createCommentVNode("",!0)}const Ce=P(hf,[["render",gf]]),yf={fields:[{inputType:"text",label:"Config.Client Id",model:"config-client_id",type:"input"},{inputType:"text",label:"Config.Client Secret",model:"config-client_secret",type:"input"},{inputType:"text",label:"Config.Issuer",model:"config-issuer",required:!0,type:"input"},{inputType:"text",label:"Config.Auth Methods",model:"config-auth_methods",type:"input"}]},_f={fields:[{inputType:"text",label:"Config.Scopes Claim",model:"config-scopes_claim",type:"input"},{inputType:"text",label:"Config.Scopes Required",model:"config-scopes_required",type:"input"},{inputType:"text",label:"Config.Audience Claim",model:"config-audience_claim",type:"input"},{inputType:"text",label:"Config.Audience Required",model:"config-audience_required",type:"input"},{inputType:"text",label:"Config.Roles Claim",model:"config-roles_claim",type:"input"},{inputType:"text",label:"Config.Roles Required",model:"config-roles_required",type:"input"},{inputType:"text",label:"Config.Groups Claim",model:"config-groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Groups Required",model:"config-groups_required",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Authenticated Groups Claim",model:"config-authenticated_groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"}]},bf={fields:[{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Client JWK",items:{type:"object",schema:{fields:[{model:"kid",label:"kid",type:"input",inputType:"string"},{model:"issuer",label:"issuer",type:"input",inputType:"string"},{model:"kty",label:"kty",type:"input",inputType:"string"},{model:"use",label:"use",type:"input",inputType:"string"},{model:"key_ops",label:"key_ops",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"alg",label:"alg",type:"input",inputType:"string"},{model:"x5u",label:"x5u",type:"input",inputType:"string"},{model:"x5c",label:"x5c",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"x5t",label:"x5t",type:"input",inputType:"string"},{model:"x5t#S256",label:"x5t#S256",type:"input",inputType:"string"},{model:"k",label:"k",type:"input",inputType:"string"},{model:"x",label:"x",type:"input",inputType:"string"},{model:"y",label:"y",type:"input",inputType:"string"},{model:"crv",label:"crv",type:"input",inputType:"string"},{model:"n",label:"n",type:"input",inputType:"string"},{model:"e",label:"e",type:"input",inputType:"string"},{model:"d",label:"d",type:"input",inputType:"string"},{model:"p",label:"p",type:"input",inputType:"string"},{model:"q",label:"q",type:"input",inputType:"string"},{model:"dp",label:"dp",type:"input",inputType:"string"},{model:"dq",label:"dq",type:"input",inputType:"string"},{model:"qi",label:"qi",type:"input",inputType:"string"},{model:"oth",label:"oth",type:"input",inputType:"string"},{model:"r",label:"r",type:"input",inputType:"string"},{model:"t",label:"t",type:"input",inputType:"string"}]}},model:"config-client_jwk",label:"Config.Client Jwk",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#jwk-record"},{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Cluster Node",items:{type:"object",schema:{fields:[{label:"IP",model:"ip",type:"input",inputType:"text"},{label:"Port",model:"port",type:"input",inputType:"number"}]}},model:"config-session_redis_cluster_nodes",label:"Config.Session Redis Cluster Nodes",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#host-record"}]},wf={name:"OIDCForm",components:{VueFormGenerator:Ce},props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},data(){return{init:!1,authMethods:[],sessionManagement:!1,globalFields:null,commonFieldsSchema:null,authFieldsSchema:null,advancedFieldsSchema:{fields:[]},advancedFields:null,tabs:[{hash:"#common",title:"Common"},{hash:"#authorization",title:"Authorization"},{hash:"#advanced",title:"Advanced"}]}},computed:{displayForm(){return this.formModel.id&&this.isEditing||!this.isEditing}},watch:{formModel:{handler:function(){this.oidcSetup()}}},mounted(){this.oidcSetup()},methods:{oidcSetup(){var s;this.init||(this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(l=>!l.model.startsWith("config")&&l.model!=="tags")},this.commonFieldsSchema={...yf},this.authFieldsSchema={..._f},this.advancedFieldsSchema.fields=this.formSchema.fields.filter(l=>l.model.startsWith("config")&&!this.commonFieldsSchema.fields.filter(m=>m.model===l.model).length&&!this.authFieldsSchema.fields.filter(m=>m.model===l.model).length||l.model==="tags"),this.advancedFieldsSchema.fields=this.advancedFieldsSchema.fields.map(l=>{const m=bf.fields.find(f=>f.model===l.model);return m||l}),this.commonFieldsSchema.fields=this.commonFieldsSchema.fields.filter(l=>l.model!=="config-auth_methods"),this.sessionManagement=this.isEditing?this.formModel["config-auth_methods"].includes("session"):!1,this.authMethods=[{label:"Authorization Code Flow",value:"authorization_code",hint:"authorization code flow",prop:this.isEditing?this.formModel["config-auth_methods"].includes("authorization_code"):!1},{label:"Bearer Access Token",value:"bearer",hint:"JWT access token verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("bearer"):!1},{label:"Client Credentials Grant",value:"client_credentials",hint:"OAuth client credentials grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("client_credentials"):!1},{label:"Passwords Grant",value:"password",hint:"OAuth legacy password grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("password"):!1},{label:"Introspection",value:"introspection",hint:"OAuth introspection",prop:this.isEditing?this.formModel["config-auth_methods"].includes("introspection"):!1},{label:"UserInfo",value:"userinfo",hint:"OpenID Connect user info endpoint authentication",prop:this.isEditing?this.formModel["config-auth_methods"].includes("userinfo"):!1},{label:"Kong OAuth",value:"kong_oauth2",hint:"Kong OAuth plugin issued tokens verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("kong_oauth2"):!1},{label:"Refresh Token",value:"refresh_token",hint:"OAuth refresh token grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("refresh_token"):!1}]);const n={};for(const l of this.formSchema.fields)n[l.model]=l;for(const l of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const m of l.fields){const f=(s=n[m.model])==null?void 0:s.help;m.help===void 0&&typeof f=="string"&&(m.help=f)}},getAuthMethodsValue(n,s){const l=[];for(let m=0;m<this.authMethods.length;m++)this.authMethods[m].prop&&this.authMethods[m].value!==n&&l.push(this.authMethods[m].value);return this.sessionManagement&&n&&l.push("session"),s&&(n?l.push(n):l.push("session")),l},handleUpdate(n,s){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(s,n),this.onModelUpdated()}}},Ht=n=>(i.pushScopeId("data-v-e7395ff0"),n=n(),i.popScopeId(),n),Cf={class:"general-settings"},kf={class:"link-wrapper"},Ef=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)),Sf=Ht(()=>i.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),vf={class:"auth-method-container"},Bf={class:"general-settings"},Tf={class:"link-wrapper"},If=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)),Mf=Ht(()=>i.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),Nf={class:"general-settings"},Af={class:"link-wrapper"},Ff=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)),Vf=Ht(()=>i.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1));function $f(n,s,l,m,f,u){const b=i.resolveComponent("VueFormGenerator"),g=i.resolveComponent("KExternalLink"),E=i.resolveComponent("KLabel"),T=i.resolveComponent("KCheckbox"),A=i.resolveComponent("KInputSwitch"),Q=i.resolveComponent("KTabs");return i.openBlock(),i.createElementBlock("div",null,[l.formModel.id&&l.isEditing||!l.isEditing?(i.openBlock(),i.createBlock(b,{key:0,class:"global-fields",model:l.formModel,options:l.formOptions,schema:f.globalFields,onModelUpdated:l.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(Q,{tabs:f.tabs},{common:i.withCtx(()=>[i.createElementVNode("div",Cf,[i.createElementVNode("div",kf,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#important-configuration-parameters"},{default:i.withCtx(()=>[Ef]),_:1})]),Sf,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:l.formModel,options:l.formOptions,schema:f.commonFieldsSchema,onModelUpdated:l.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(E,null,{default:i.withCtx(()=>[i.createTextVNode("Auth Methods")]),_:1}),i.createElementVNode("div",vf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(f.authMethods,J=>(i.openBlock(),i.createElementBlock("div",{key:J.value,class:"auth-method"},[i.createVNode(T,{modelValue:J.prop,"onUpdate:modelValue":me=>J.prop=me,onChange:me=>u.handleUpdate(me,J.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(J.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),i.createVNode(A,{modelValue:f.sessionManagement,"onUpdate:modelValue":s[0]||(s[0]=J=>f.sessionManagement=J),label:"Enable Session Management",onChange:u.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:i.withCtx(()=>[i.createElementVNode("div",Bf,[i.createElementVNode("div",Tf,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#authorization"},{default:i.withCtx(()=>[If]),_:1})]),Mf,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:l.formModel,options:l.formOptions,schema:f.authFieldsSchema,onModelUpdated:l.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),advanced:i.withCtx(()=>[i.createElementVNode("div",Nf,[i.createElementVNode("div",Af,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/"},{default:i.withCtx(()=>[Ff]),_:1})]),Vf,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:l.formModel,options:l.formOptions,schema:f.advancedFieldsSchema,onModelUpdated:l.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),_:1},8,["tabs"])])}const Of=P(wf,[["render",$f],["__scopeId","data-v-e7395ff0"]]),Lo={general:{packageName:"forms"},"post-function":{tags:{hint:"e.g. tag1, tag2, tag3",newElementButtonLabel:"+ Add"},enabled:{newElementButtonLabel:"+ Add"},selectionGroup:{newElementButtonLabel:"+ Add"},instance_name:{newElementButtonLabel:"+ Add"},name:{newElementButtonLabel:"+ Add"},"config-certificate":{help:"Array of stringified Lua code to be cached and run in sequence during the certificate phase.",newElementButtonLabel:"+ Add"},"config-access":{help:"Array of stringified Lua code to be cached and run in sequence during the access phase.",newElementButtonLabel:"+ Add"},"config-body_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the body_filter phase.",newElementButtonLabel:"+ Add"},"config-header_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the header_filter phase.",newElementButtonLabel:"+ Add"},"config-functions":{newElementButtonLabel:"+ Add"},"config-log":{newElementButtonLabel:"+ Add"},"config-rewrite":{newElementButtonLabel:"+ Add"},"config-ws_client_frame":{newElementButtonLabel:"+ Add"},"config-ws_close":{newElementButtonLabel:"+ Add"},"config-ws_handshake":{newElementButtonLabel:"+ Add"},"config-ws_upstream_frame":{newElementButtonLabel:"+ Add"}},"exit-transformer":{"config-functions":{newElementButtonLabel:"+ Add"}}},Df=P(i.defineComponent({__name:"PostFunction",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const{t:s,te:l}=to.createI18n("en-us",Lo),m=n,f=i.computed(()=>m.formModel.id&&m.isEditing||!m.isEditing),u=i.computed(()=>{const b=m.formSchema;return b.fields.map(g=>{const E=`post-function.${g.model}`;return g.hint=l(`${E}.hint`)&&s(`${E}.hint`)||g.hint,g.help=l(`${E}.help`)&&s(`${E}.help`)||g.help,g.newElementButtonLabel=l(`${E}.newElementButtonLabel`)&&s(`${E}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="post-function-array-item-container",g.fieldItemsClasses="post-function-array-item",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>f.value?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)}}),[["__scopeId","data-v-6706c68b"]]),Lf=P(i.defineComponent({__name:"ExitTransformer",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const{t:s,te:l}=to.createI18n("en-us",Lo),m=n,f=i.computed(()=>m.formModel.id&&m.isEditing||!m.isEditing),u=i.computed(()=>{const b=m.formSchema;return b.fields.map(g=>{const E=`exit-transformer.${g.model}`;return g.hint=l(`${E}.hint`)&&s(`${E}.hint`)||g.hint,g.help=l(`${E}.help`)&&s(`${E}.help`)||g.help,g.newElementButtonLabel=l(`${E}.newElementButtonLabel`)&&s(`${E}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="exit-transformer-array-item-container",g.fieldItemsClasses="exit-transformer-array-item",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>f.value?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)}}),[["__scopeId","data-v-0fc8ef29"]]),Uf={fields:[{inputType:"text",label:"Config.Account Email",model:"config-account_email",required:!0,type:"input"},{inputType:"text",label:"Config.Account Key.Key Id",model:"config-account_key-key_id",required:!0,type:"input"},{type:"input",inputType:"text",valueType:"string",label:"Config.Account Key.Key Set",model:"config-account_key-key_set",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",label:"Config.Allow Any Domain",model:"config-allow_any_domain",order:0,disabled:!1}]},Rf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",model:"config-tos_accepted",label:"Config.Tos Accepted",order:0,disabled:!1}]},xf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_hmac_key",label:"Config.Eab Hmac Key",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_kid",label:"Config.Eab Kid",order:0,disabled:!1}]},Vt=n=>(i.pushScopeId("data-v-5b189366"),n=n(),i.popScopeId(),n),Pf={class:"general-settings"},qf=Vt(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),zf=Vt(()=>i.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),Hf=Vt(()=>i.createElementVNode("hr",null,null,-1)),Wf={class:"sub-form"},Kf={class:"general-settings"},Yf=Vt(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),Gf=Vt(()=>i.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),Zf={class:"sub-form"},Jf={class:"general-settings"},Xf=Vt(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),Qf=Vt(()=>i.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),jf=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:P(i.defineComponent({__name:"ACMEForm",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const s=n,l=i.ref("zeroSsl"),m=i.ref("shm"),f=i.computed(()=>{var L;const F={};if((L=s.formSchema)!=null&&L.fields)for(const G of s.formSchema.fields)F[G.model]=G;return F}),u=i.computed(()=>{var L;const F=C.cloneDeep(Uf);for(const G of F.fields){const ue=(L=f.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ue=="string"&&(G.help=ue)}return F}),b=i.computed(()=>{var L;const F=C.cloneDeep(Rf);for(const G of F.fields){const ue=(L=f.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ue=="string"&&(G.help=ue)}return F}),g=i.computed(()=>{var L;const F=C.cloneDeep(xf);for(const G of F.fields){const ue=(L=f.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ue=="string"&&(G.help=ue)}return F}),E=i.computed(()=>({fields:s.formSchema.fields.filter(F=>!F.model.startsWith("config")&&F.model!=="tags")})),T=i.computed(()=>({fields:u.value.fields.filter(L=>!b.value.fields.some(G=>G.model===L.model)&&!g.value.fields.some(G=>G.model===L.model))})),A=i.computed(()=>({fields:s.formSchema.fields.filter(L=>L.model.startsWith("config-storage")&&!L.model.startsWith("config-storage_config-consul")&&!L.model.startsWith("config-storage_config-redis")&&!L.model.startsWith("config-storage_config-shm")&&!L.model.startsWith("config-storage_config-vault"))})),Q=i.computed(()=>({fields:s.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-consul"))})),J=i.computed(()=>({fields:s.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-redis"))})),me=i.computed(()=>({fields:s.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-shm"))})),de=i.computed(()=>({fields:s.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-vault"))})),lt=i.computed(()=>({fields:s.formSchema.fields.filter(F=>F.model.startsWith("config")&&!T.value.fields.filter(L=>L.model===F.model).length&&!A.value.fields.filter(L=>L.model===F.model).length||F.model==="tags")})),ce=i.computed(()=>s.formModel.id&&s.isEditing||!s.isEditing),Te=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],st=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];i.onMounted(()=>{l.value==="zeroSsl"&&(s.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const Ie=F=>{l.value=F.value,(F.value==="zeroSsl"||F.value==="other")&&(F.value==="zeroSsl"?s.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":s.formModel["config-api_uri"]="https://acme.example.com/",s.formModel["config-tos_accepted"]=!1),F.value==="letsEncrypt"&&(s.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",s.formModel["config-eab_hmac_key"]="",s.formModel["config-eab_kid"]=""),s.onModelUpdated()},Me=(F,L)=>{L==="config-storage"&&(m.value=F),s.onModelUpdated()};return(F,L)=>{const G=i.resolveComponent("KSelect"),ue=i.resolveComponent("KTabs");return i.openBlock(),i.createElementBlock("div",null,[n.formModel.id&&n.isEditing||!n.isEditing?(i.openBlock(),i.createBlock(Ce,{key:0,class:"global-fields",model:n.formModel,options:n.formOptions,schema:E.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(ue,{tabs:Te},{general:i.withCtx(()=>[i.createElementVNode("div",Pf,[qf,zf,ce.value?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:T.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),Hf,i.createVNode(G,{class:"issuer-select",items:st,label:"Issuer",onChange:Ie}),i.createElementVNode("div",Wf,[l.value==="letsEncrypt"?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:b.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),l.value==="zeroSsl"||l.value==="other"?(i.openBlock(),i.createBlock(Ce,{key:1,model:n.formModel,options:n.formOptions,schema:g.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])])]),storage:i.withCtx(()=>[i.createElementVNode("div",Kf,[Yf,Gf,ce.value?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:A.value,onModelUpdated:Me},null,8,["model","options","schema"])):i.createCommentVNode("",!0),i.createElementVNode("div",Zf,[m.value==="consul"?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:Q.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="redis"?(i.openBlock(),i.createBlock(Ce,{key:1,model:n.formModel,options:n.formOptions,schema:J.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="shm"?(i.openBlock(),i.createBlock(Ce,{key:2,model:n.formModel,options:n.formOptions,schema:me.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="vault"?(i.openBlock(),i.createBlock(Ce,{key:3,model:n.formModel,options:n.formOptions,schema:de.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])])]),advanced:i.withCtx(()=>[i.createElementVNode("div",Jf,[Xf,Qf,ce.value?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:lt.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-5b189366"]]),ExitTransformer:Lf,OIDCForm:Of,PostFunction:Df},Symbol.toStringTag,{value:"Module"})),eh=["array","metric","advanced","selectionGroup","object-advanced"],th={install:n=>{n.component("VueFormGenerator",Ce)}},nh=(n,s=!1)=>({...s&&{acme:"ACMEForm"},"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer"})[n];ve.FORMS_API_KEY=wt,ve.VueFormGenerator=Ce,ve.abstractField=Ba,ve.customFields=eh,ve.default=th,ve.getSharedFormName=nh,ve.sharedForms=jf,Object.defineProperties(ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
27
|
+
}`;var q=ha(function(){return Z(c,N+"return "+B).apply(l,h)});if(q.source=B,Hi(q))throw q;return q}function o1(e){return X(e).toLowerCase()}function l1(e){return X(e).toUpperCase()}function s1(e,t,r){if(e=X(e),e&&(r||t===l))return kl(e);if(!e||!(t=De(t)))return e;var o=Qe(e),a=Qe(t),c=El(o,a),h=Sl(o,a)+1;return Mt(o,c,h).join("")}function a1(e,t,r){if(e=X(e),e&&(r||t===l))return e.slice(0,Bl(e)+1);if(!e||!(t=De(t)))return e;var o=Qe(e),a=Sl(o,Qe(t))+1;return Mt(o,0,a).join("")}function d1(e,t,r){if(e=X(e),e&&(r||t===l))return e.replace(Hr,"");if(!e||!(t=De(t)))return e;var o=Qe(e),a=El(o,Qe(t));return Mt(o,a).join("")}function c1(e,t){var r=rh,o=ih;if(oe(t)){var a="separator"in t?t.separator:a;r="length"in t?x(t.length):r,o="omission"in t?De(t.omission):o}e=X(e);var c=e.length;if(Zt(e)){var h=Qe(e);c=h.length}if(r>=c)return e;var p=r-Jt(o);if(p<1)return o;var _=h?Mt(h,0,p).join(""):e.slice(0,p);if(a===l)return _+o;if(h&&(p+=_.length-p),Wi(a)){if(e.slice(p).search(a)){var S,v=_;for(a.global||(a=si(a.source,X(Ho.exec(a))+"g")),a.lastIndex=0;S=a.exec(v);)var B=S.index;_=_.slice(0,B===l?p:B)}}else if(e.indexOf(De(a),p)!=p){var I=_.lastIndexOf(a);I>-1&&(_=_.slice(0,I))}return _+o}function u1(e){return e=X(e),e&&kh.test(e)?e.replace(Po,xm):e}var f1=rn(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Gi=ms("toUpperCase");function fa(e,t,r){return e=X(e),t=r?l:t,t===l?Om(e)?zm(e):Bm(e):e.match(t)||[]}var ha=z(function(e,t){try{return $e(e,l,t)}catch(r){return Hi(r)?r:new U(r)}}),h1=ht(function(e,t){return ze(t,function(r){r=ot(r),ut(e,r,qi(e[r],e))}),e});function m1(e){var t=e==null?0:e.length,r=V();return e=t?re(e,function(o){if(typeof o[1]!="function")throw new He(b);return[r(o[0]),o[1]]}):[],z(function(o){for(var a=-1;++a<t;){var c=e[a];if($e(c[0],this,o))return $e(c[1],this,o)}})}function p1(e){return xp(Ke(e,Q))}function Zi(e){return function(){return e}}function g1(e,t){return e==null||e!==e?t:e}var y1=gs(),_1=gs(!0);function Ve(e){return e}function Ji(e){return Kl(typeof e=="function"?e:Ke(e,Q))}function b1(e){return Gl(Ke(e,Q))}function w1(e,t){return Zl(e,Ke(t,Q))}var C1=z(function(e,t){return function(r){return Bn(r,e,t)}}),k1=z(function(e,t){return function(r){return Bn(e,r,t)}});function Xi(e,t,r){var o=pe(t),a=ur(t,o);r==null&&!(oe(t)&&(a.length||!o.length))&&(r=t,t=e,e=this,a=ur(t,pe(t)));var c=!(oe(r)&&"chain"in r)||!!r.chain,h=pt(e);return ze(a,function(p){var _=t[p];e[p]=_,h&&(e.prototype[p]=function(){var S=this.__chain__;if(c||S){var v=e(this.__wrapped__),B=v.__actions__=Ne(this.__actions__);return B.push({func:_,args:arguments,thisArg:e}),v.__chain__=S,v}return _.apply(e,Et([this.value()],arguments))})}),e}function E1(){return ge._===this&&(ge._=Zm),this}function Qi(){}function S1(e){return e=x(e),z(function(t){return Jl(t,e)})}var v1=Mi(re),B1=Mi(yl),T1=Mi(ei);function ma(e){return Di(e)?ti(ot(e)):rg(e)}function I1(e){return function(t){return e==null?l:xt(e,t)}}var M1=_s(),N1=_s(!0);function ji(){return[]}function eo(){return!1}function A1(){return{}}function F1(){return""}function V1(){return!0}function $1(e,t){if(e=x(e),e<1||e>Ct)return[];var r=nt,o=be(e,nt);t=V(t),e-=nt;for(var a=ii(o,t);++r<e;)t(r);return a}function O1(e){return R(e)?re(e,ot):Le(e)?[e]:Ne($s(X(e)))}function D1(e){var t=++Ym;return X(e)+t}var L1=yr(function(e,t){return e+t},0),U1=Ni("ceil"),R1=yr(function(e,t){return e/t},1),x1=Ni("floor");function P1(e){return e&&e.length?cr(e,Ve,pi):l}function q1(e,t){return e&&e.length?cr(e,V(t,2),pi):l}function z1(e){return wl(e,Ve)}function H1(e,t){return wl(e,V(t,2))}function W1(e){return e&&e.length?cr(e,Ve,bi):l}function K1(e,t){return e&&e.length?cr(e,V(t,2),bi):l}var Y1=yr(function(e,t){return e*t},1),G1=Ni("round"),Z1=yr(function(e,t){return e-t},0);function J1(e){return e&&e.length?ri(e,Ve):0}function X1(e,t){return e&&e.length?ri(e,V(t,2)):0}return d.after=b_,d.ary=Ws,d.assign=l0,d.assignIn=oa,d.assignInWith=Nr,d.assignWith=s0,d.at=a0,d.before=Ks,d.bind=qi,d.bindAll=h1,d.bindKey=Ys,d.castArray=A_,d.chain=qs,d.chunk=xg,d.compact=Pg,d.concat=qg,d.cond=m1,d.conforms=p1,d.constant=Zi,d.countBy=Jy,d.create=d0,d.curry=Gs,d.curryRight=Zs,d.debounce=Js,d.defaults=c0,d.defaultsDeep=u0,d.defer=w_,d.delay=C_,d.difference=zg,d.differenceBy=Hg,d.differenceWith=Wg,d.drop=Kg,d.dropRight=Yg,d.dropRightWhile=Gg,d.dropWhile=Zg,d.fill=Jg,d.filter=Qy,d.flatMap=t_,d.flatMapDeep=n_,d.flatMapDepth=r_,d.flatten=Us,d.flattenDeep=Xg,d.flattenDepth=Qg,d.flip=k_,d.flow=y1,d.flowRight=_1,d.fromPairs=jg,d.functions=_0,d.functionsIn=b0,d.groupBy=i_,d.initial=ty,d.intersection=ny,d.intersectionBy=ry,d.intersectionWith=iy,d.invert=C0,d.invertBy=k0,d.invokeMap=l_,d.iteratee=Ji,d.keyBy=s_,d.keys=pe,d.keysIn=Fe,d.map=Sr,d.mapKeys=S0,d.mapValues=v0,d.matches=b1,d.matchesProperty=w1,d.memoize=Br,d.merge=B0,d.mergeWith=la,d.method=C1,d.methodOf=k1,d.mixin=Xi,d.negate=Tr,d.nthArg=S1,d.omit=T0,d.omitBy=I0,d.once=E_,d.orderBy=a_,d.over=v1,d.overArgs=S_,d.overEvery=B1,d.overSome=T1,d.partial=zi,d.partialRight=Xs,d.partition=d_,d.pick=M0,d.pickBy=sa,d.property=ma,d.propertyOf=I1,d.pull=ay,d.pullAll=xs,d.pullAllBy=dy,d.pullAllWith=cy,d.pullAt=uy,d.range=M1,d.rangeRight=N1,d.rearg=v_,d.reject=f_,d.remove=fy,d.rest=B_,d.reverse=xi,d.sampleSize=m_,d.set=A0,d.setWith=F0,d.shuffle=p_,d.slice=hy,d.sortBy=__,d.sortedUniq=wy,d.sortedUniqBy=Cy,d.split=t1,d.spread=T_,d.tail=ky,d.take=Ey,d.takeRight=Sy,d.takeRightWhile=vy,d.takeWhile=By,d.tap=Py,d.throttle=I_,d.thru=Er,d.toArray=na,d.toPairs=aa,d.toPairsIn=da,d.toPath=O1,d.toPlainObject=ia,d.transform=V0,d.unary=M_,d.union=Ty,d.unionBy=Iy,d.unionWith=My,d.uniq=Ny,d.uniqBy=Ay,d.uniqWith=Fy,d.unset=$0,d.unzip=Pi,d.unzipWith=Ps,d.update=O0,d.updateWith=D0,d.values=sn,d.valuesIn=L0,d.without=Vy,d.words=fa,d.wrap=N_,d.xor=$y,d.xorBy=Oy,d.xorWith=Dy,d.zip=Ly,d.zipObject=Uy,d.zipObjectDeep=Ry,d.zipWith=xy,d.entries=aa,d.entriesIn=da,d.extend=oa,d.extendWith=Nr,Xi(d,d),d.add=L1,d.attempt=ha,d.camelCase=P0,d.capitalize=ca,d.ceil=U1,d.clamp=U0,d.clone=F_,d.cloneDeep=$_,d.cloneDeepWith=O_,d.cloneWith=V_,d.conformsTo=D_,d.deburr=ua,d.defaultTo=g1,d.divide=R1,d.endsWith=q0,d.eq=et,d.escape=z0,d.escapeRegExp=H0,d.every=Xy,d.find=jy,d.findIndex=Ds,d.findKey=f0,d.findLast=e_,d.findLastIndex=Ls,d.findLastKey=h0,d.floor=x1,d.forEach=zs,d.forEachRight=Hs,d.forIn=m0,d.forInRight=p0,d.forOwn=g0,d.forOwnRight=y0,d.get=Ki,d.gt=L_,d.gte=U_,d.has=w0,d.hasIn=Yi,d.head=Rs,d.identity=Ve,d.includes=o_,d.indexOf=ey,d.inRange=R0,d.invoke=E0,d.isArguments=zt,d.isArray=R,d.isArrayBuffer=R_,d.isArrayLike=Ae,d.isArrayLikeObject=se,d.isBoolean=x_,d.isBuffer=Nt,d.isDate=P_,d.isElement=q_,d.isEmpty=z_,d.isEqual=H_,d.isEqualWith=W_,d.isError=Hi,d.isFinite=K_,d.isFunction=pt,d.isInteger=Qs,d.isLength=Ir,d.isMap=js,d.isMatch=Y_,d.isMatchWith=G_,d.isNaN=Z_,d.isNative=J_,d.isNil=Q_,d.isNull=X_,d.isNumber=ea,d.isObject=oe,d.isObjectLike=le,d.isPlainObject=Fn,d.isRegExp=Wi,d.isSafeInteger=j_,d.isSet=ta,d.isString=Mr,d.isSymbol=Le,d.isTypedArray=ln,d.isUndefined=e0,d.isWeakMap=t0,d.isWeakSet=n0,d.join=oy,d.kebabCase=W0,d.last=Ge,d.lastIndexOf=ly,d.lowerCase=K0,d.lowerFirst=Y0,d.lt=r0,d.lte=i0,d.max=P1,d.maxBy=q1,d.mean=z1,d.meanBy=H1,d.min=W1,d.minBy=K1,d.stubArray=ji,d.stubFalse=eo,d.stubObject=A1,d.stubString=F1,d.stubTrue=V1,d.multiply=Y1,d.nth=sy,d.noConflict=E1,d.noop=Qi,d.now=vr,d.pad=G0,d.padEnd=Z0,d.padStart=J0,d.parseInt=X0,d.random=x0,d.reduce=c_,d.reduceRight=u_,d.repeat=Q0,d.replace=j0,d.result=N0,d.round=G1,d.runInContext=y,d.sample=h_,d.size=g_,d.snakeCase=e1,d.some=y_,d.sortedIndex=my,d.sortedIndexBy=py,d.sortedIndexOf=gy,d.sortedLastIndex=yy,d.sortedLastIndexBy=_y,d.sortedLastIndexOf=by,d.startCase=n1,d.startsWith=r1,d.subtract=Z1,d.sum=J1,d.sumBy=X1,d.template=i1,d.times=$1,d.toFinite=gt,d.toInteger=x,d.toLength=ra,d.toLower=o1,d.toNumber=Ze,d.toSafeInteger=o0,d.toString=X,d.toUpper=l1,d.trim=s1,d.trimEnd=a1,d.trimStart=d1,d.truncate=c1,d.unescape=u1,d.uniqueId=D1,d.upperCase=f1,d.upperFirst=Gi,d.each=zs,d.eachRight=Hs,d.first=Rs,Xi(d,function(){var e={};return rt(d,function(t,r){j.call(d.prototype,r)||(e[r]=t)}),e}(),{chain:!1}),d.VERSION=m,ze(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){d[e].placeholder=d}),ze(["drop","take"],function(e,t){W.prototype[e]=function(r){r=r===l?1:he(x(r),0);var o=this.__filtered__&&!t?new W(this):this.clone();return o.__filtered__?o.__takeCount__=be(r,o.__takeCount__):o.__views__.push({size:be(r,nt),type:e+(o.__dir__<0?"Right":"")}),o},W.prototype[e+"Right"]=function(r){return this.reverse()[e](r).reverse()}}),ze(["filter","map","takeWhile"],function(e,t){var r=t+1,o=r==Uo||r==ah;W.prototype[e]=function(a){var c=this.clone();return c.__iteratees__.push({iteratee:V(a,3),type:r}),c.__filtered__=c.__filtered__||o,c}}),ze(["head","last"],function(e,t){var r="take"+(t?"Right":"");W.prototype[e]=function(){return this[r](1).value()[0]}}),ze(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");W.prototype[e]=function(){return this.__filtered__?new W(this):this[r](1)}}),W.prototype.compact=function(){return this.filter(Ve)},W.prototype.find=function(e){return this.filter(e).head()},W.prototype.findLast=function(e){return this.reverse().find(e)},W.prototype.invokeMap=z(function(e,t){return typeof e=="function"?new W(this):this.map(function(r){return Bn(r,e,t)})}),W.prototype.reject=function(e){return this.filter(Tr(V(e)))},W.prototype.slice=function(e,t){e=x(e);var r=this;return r.__filtered__&&(e>0||t<0)?new W(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==l&&(t=x(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},W.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},W.prototype.toArray=function(){return this.take(nt)},rt(W.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),a=d[o?"take"+(t=="last"?"Right":""):t],c=o||/^find/.test(t);a&&(d.prototype[t]=function(){var h=this.__wrapped__,p=o?[1]:arguments,_=h instanceof W,S=p[0],v=_||R(h),B=function(H){var K=a.apply(d,Et([H],p));return o&&I?K[0]:K};v&&r&&typeof S=="function"&&S.length!=1&&(_=v=!1);var I=this.__chain__,N=!!this.__actions__.length,O=c&&!I,q=_&&!N;if(!c&&v){h=q?h:new W(this);var D=e.apply(h,p);return D.__actions__.push({func:Er,args:[B],thisArg:l}),new We(D,I)}return O&&q?e.apply(this,p):(D=this.thru(B),O?o?D.value()[0]:D.value():D)})}),ze(["pop","push","shift","sort","splice","unshift"],function(e){var t=Zn[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);d.prototype[e]=function(){var a=arguments;if(o&&!this.__chain__){var c=this.value();return t.apply(R(c)?c:[],a)}return this[r](function(h){return t.apply(R(h)?h:[],a)})}}),rt(W.prototype,function(e,t){var r=d[t];if(r){var o=r.name+"";j.call(en,o)||(en[o]=[]),en[o].push({name:t,func:r})}}),en[gr(l,Te).name]=[{name:"wrapper",func:l}],W.prototype.clone=up,W.prototype.reverse=fp,W.prototype.value=hp,d.prototype.at=qy,d.prototype.chain=zy,d.prototype.commit=Hy,d.prototype.next=Wy,d.prototype.plant=Yy,d.prototype.reverse=Gy,d.prototype.toJSON=d.prototype.valueOf=d.prototype.value=Zy,d.prototype.first=d.prototype.head,bn&&(d.prototype[bn]=Ky),d},Xt=Hm();Ot?((Ot.exports=Xt)._=Xt,Jr._=Xt):ge._=Xt}).call(an)}(Vn,Vn.exports);var C=Vn.exports;const no={methods:{getFieldRowClasses(n){const s=this.fieldErrors(n).length>0,l={[C.get(this.options,"validationErrorClass","error")]:s,[C.get(this.options,"validationSuccessClass","valid")]:!s,disabled:this.fieldDisabled(n),readonly:this.fieldReadonly(n),featured:this.fieldFeatured(n),required:this.fieldRequired(n)};return C.isArray(n.styleClasses)?C.forEach(n.styleClasses,m=>l[m]=!0):C.isString(n.styleClasses)&&(l[n.styleClasses]=!0),C.isNil(n.type)||(l["field-"+n.type]=!0),l},fieldErrors(n){return this.errors.filter(l=>l.field.fieldName===n.fieldName).map(l=>l.error)},fieldDisabled(n){return C.isFunction(n.disabled)?n.disabled.call(this,this.model,n,this):C.isNil(n.disabled)?!1:n.disabled},fieldReadonly(n){return C.isFunction(n.readonly)?n.readonly.call(this,this.model,n,this):C.isNil(n.readonly)?!1:n.readonly},fieldFeatured(n){return C.isFunction(n.featured)?n.featured.call(this,this.model,n,this):C.isNil(n.featured)?!1:n.featured},fieldRequired(n){return C.isFunction(n.required)?n.required.call(this,this.model,n,this):C.isNil(n.required)?!1:n.required}}},ro=(n,s="")=>typeof n.id<"u"?s+n.id:s+(n.inputName||n.label||n.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),io=(n="")=>n.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var oo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,_t="\\d\\d?",bt="\\d\\d",ga="\\d{3}",ya="\\d{4}",dn="[^\\s]+",lo=/\[([^]*?)\]/gm;function so(n,s){for(var l=[],m=0,f=n.length;m<f;m++)l.push(n[m].substr(0,s));return l}var ao=function(n){return function(s,l){var m=l[n].map(function(u){return u.toLowerCase()}),f=m.indexOf(s.toLowerCase());return f>-1?f:null}};function At(n){for(var s=[],l=1;l<arguments.length;l++)s[l-1]=arguments[l];for(var m=0,f=s;m<f.length;m++){var u=f[m];for(var b in u)n[b]=u[b]}return n}var co=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],uo=["January","February","March","April","May","June","July","August","September","October","November","December"],_a=so(uo,3),ba=so(co,3),fo={dayNamesShort:ba,dayNames:co,monthNamesShort:_a,monthNames:uo,amPm:["am","pm"],DoFn:function(n){return n+["th","st","nd","rd"][n%10>3?0:(n-n%10!==10?1:0)*n%10]}},$n=At({},fo),wa=function(n){return $n=At($n,n)},ho=function(n){return n.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Be=function(n,s){for(s===void 0&&(s=2),n=String(n);n.length<s;)n="0"+n;return n},Ca={D:function(n){return String(n.getDate())},DD:function(n){return Be(n.getDate())},Do:function(n,s){return s.DoFn(n.getDate())},d:function(n){return String(n.getDay())},dd:function(n){return Be(n.getDay())},ddd:function(n,s){return s.dayNamesShort[n.getDay()]},dddd:function(n,s){return s.dayNames[n.getDay()]},M:function(n){return String(n.getMonth()+1)},MM:function(n){return Be(n.getMonth()+1)},MMM:function(n,s){return s.monthNamesShort[n.getMonth()]},MMMM:function(n,s){return s.monthNames[n.getMonth()]},YY:function(n){return Be(String(n.getFullYear()),4).substr(2)},YYYY:function(n){return Be(n.getFullYear(),4)},h:function(n){return String(n.getHours()%12||12)},hh:function(n){return Be(n.getHours()%12||12)},H:function(n){return String(n.getHours())},HH:function(n){return Be(n.getHours())},m:function(n){return String(n.getMinutes())},mm:function(n){return Be(n.getMinutes())},s:function(n){return String(n.getSeconds())},ss:function(n){return Be(n.getSeconds())},S:function(n){return String(Math.round(n.getMilliseconds()/100))},SS:function(n){return Be(Math.round(n.getMilliseconds()/10),2)},SSS:function(n){return Be(n.getMilliseconds(),3)},a:function(n,s){return n.getHours()<12?s.amPm[0]:s.amPm[1]},A:function(n,s){return n.getHours()<12?s.amPm[0].toUpperCase():s.amPm[1].toUpperCase()},ZZ:function(n){var s=n.getTimezoneOffset();return(s>0?"-":"+")+Be(Math.floor(Math.abs(s)/60)*100+Math.abs(s)%60,4)},Z:function(n){var s=n.getTimezoneOffset();return(s>0?"-":"+")+Be(Math.floor(Math.abs(s)/60),2)+":"+Be(Math.abs(s)%60,2)}},mo=function(n){return+n-1},po=[null,_t],go=[null,dn],yo=["isPm",dn,function(n,s){var l=n.toLowerCase();return l===s.amPm[0]?0:l===s.amPm[1]?1:null}],_o=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(n){var s=(n+"").match(/([+-]|\d\d)/gi);if(s){var l=+s[1]*60+parseInt(s[2],10);return s[0]==="+"?l:-l}return 0}],ka={D:["day",_t],DD:["day",bt],Do:["day",_t+dn,function(n){return parseInt(n,10)}],M:["month",_t,mo],MM:["month",bt,mo],YY:["year",bt,function(n){var s=new Date,l=+(""+s.getFullYear()).substr(0,2);return+(""+(+n>68?l-1:l)+n)}],h:["hour",_t,void 0,"isPm"],hh:["hour",bt,void 0,"isPm"],H:["hour",_t],HH:["hour",bt],m:["minute",_t],mm:["minute",bt],s:["second",_t],ss:["second",bt],YYYY:["year",ya],S:["millisecond","\\d",function(n){return+n*100}],SS:["millisecond",bt,function(n){return+n*10}],SSS:["millisecond",ga],d:po,dd:po,ddd:go,dddd:go,MMM:["month",dn,ao("monthNamesShort")],MMMM:["month",dn,ao("monthNames")],a:yo,A:yo,ZZ:_o,Z:_o},On={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Ea=function(n){return At(On,n)},Sa=function(n,s,l){if(s===void 0&&(s=On.default),l===void 0&&(l={}),typeof n=="number"&&(n=new Date(n)),Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))throw new Error("Invalid Date pass to format");s=On[s]||s;var m=[];s=s.replace(lo,function(u,b){return m.push(b),"@@@"});var f=At(At({},$n),l);return s=s.replace(oo,function(u){return Ca[u](n,f)}),s.replace(/@@@/g,function(){return m.shift()})};function va(n,s,l){if(l===void 0&&(l={}),typeof s!="string")throw new Error("Invalid format in fecha parse");if(s=On[s]||s,n.length>1e3)return null;var m=new Date,f={year:m.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},u=[],b=[],g=s.replace(lo,function(Me,F){return b.push(ho(F)),"@@@"}),E={},T={};g=ho(g).replace(oo,function(Me){var F=ka[Me],L=F[0],G=F[1],ue=F[3];if(E[L])throw new Error("Invalid format. "+L+" specified twice in format");return E[L]=!0,ue&&(T[ue]=!0),u.push(F),"("+G+")"}),Object.keys(T).forEach(function(Me){if(!E[Me])throw new Error("Invalid format. "+Me+" is required in specified format")}),g=g.replace(/@@@/g,function(){return b.shift()});var A=n.match(new RegExp(g,"i"));if(!A)return null;for(var Q=At(At({},$n),l),J=1;J<A.length;J++){var me=u[J-1],de=me[0],lt=me[2],ce=lt?lt(A[J],Q):+A[J];if(ce==null)return null;f[de]=ce}f.isPm===1&&f.hour!=null&&+f.hour!=12?f.hour=+f.hour+12:f.isPm===0&&+f.hour==12&&(f.hour=0);var Te;if(f.timezoneOffset==null){Te=new Date(f.year,f.month,f.day,f.hour,f.minute,f.second,f.millisecond);for(var st=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],J=0,Ie=st.length;J<Ie;J++)if(E[st[J][0]]&&f[st[J][0]]!==Te[st[J][1]]())return null}else if(Te=new Date(Date.UTC(f.year,f.month,f.day,f.hour,f.minute-f.timezoneOffset,f.second,f.millisecond)),f.month>11||f.month<0||f.day>31||f.day<1||f.hour>23||f.hour<0||f.minute>59||f.minute<0||f.second>59||f.second<0)return null;return Te}var xe={format:Sa,parse:va,defaultI18n:fo,setGlobalDateI18n:wa,setGlobalDateMasks:Ea};const _e={fieldIsRequired:"This field is required!",invalidFormat:"Invalid format!",numberTooSmall:"The number is too small! Minimum: {0}",numberTooBig:"The number is too big! Maximum: {0}",invalidNumber:"Invalid number",invalidInteger:"The value is not an integer",textTooSmall:"The length of text is too small! Current: {0}, Minimum: {1}",textTooBig:"The length of text is too big! Current: {0}, Maximum: {1}",thisNotText:"This is not a text!",thisNotArray:"This is not an array!",selectMinItems:"Select minimum {0} items!",selectMaxItems:"Select maximum {0} items!",invalidDate:"Invalid date!",dateIsEarly:"The date is too early! Current: {0}, Minimum: {1}",dateIsLate:"The date is too late! Current: {0}, Maximum: {1}",invalidEmail:"Invalid e-mail address!",invalidURL:"Invalid URL!",invalidCard:"Invalid card format!",invalidCardNumber:"Invalid card number!",invalidTextContainNumber:"Invalid text! Cannot contains numbers or special characters",invalidTextContainSpec:"Invalid text! Cannot contains special characters"};function Pe(n,s,l=_e){return C.isNil(n)||n===""?s?[ie(l.fieldIsRequired)]:[]:null}function ie(n,...s){if(n!=null&&s.length>0)for(let l=0;l<s.length;l++)n=n.replace("{"+(l-1)+"}",s[l]);return n}const cn={resources:_e,required(n,s,l,m=_e){return Pe(n,s.required,m)},number(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;const u=[];return C.isFinite(n)?(!C.isNil(s.min)&&n<s.min&&u.push(ie(m.numberTooSmall,s.min)),!C.isNil(s.max)&&n>s.max&&u.push(ie(m.numberTooBig,s.max))):u.push(ie(m.invalidNumber)),u},integer(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;const u=cn.number(n,s,l,m);return C.isInteger(n)||u.push(ie(m.invalidInteger)),u},double(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!C.isNumber(n)||isNaN(n))return[ie(m.invalidNumber)]},string(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;const u=[];return C.isString(n)?(!C.isNil(s.min)&&n.length<s.min&&u.push(ie(m.textTooSmall,n.length,s.min)),!C.isNil(s.max)&&n.length>s.max&&u.push(ie(m.textTooBig,n.length,s.max))):u.push(ie(m.thisNotText)),u},array(n,s,l,m=_e){if(s.required){if(!C.isArray(n))return[ie(m.thisNotArray)];if(n.length===0)return[ie(m.fieldIsRequired)]}if(!C.isNil(n)){if(!C.isNil(s.min)&&n.length<s.min)return[ie(m.selectMinItems,s.min)];if(!C.isNil(s.max)&&n.length>s.max)return[ie(m.selectMaxItems,s.max)]}},date(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;const u=new Date(n);if(isNaN(u.getDate()))return[ie(m.invalidDate)];const b=[];if(!C.isNil(s.min)){const g=new Date(s.min);u.valueOf()<g.valueOf()&&b.push(ie(m.dateIsEarly,xe.format(u),xe.format(g)))}if(!C.isNil(s.max)){const g=new Date(s.max);u.valueOf()>g.valueOf()&&b.push(ie(m.dateIsLate,xe.format(u),xe.format(g)))}return b},regexp(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!C.isNil(s.pattern)&&!new RegExp(s.pattern).test(n))return[ie(m.invalidFormat)]},email(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n))return[ie(m.invalidEmail)]},url(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(n))return[ie(m.invalidURL)]},creditCard(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;const u=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,b=n.replace(/[^0-9]+/g,"");if(!u.test(b))return[ie(m.invalidCard)];let g=0,E,T,A;for(let Q=b.length-1;Q>=0;Q--)E=b.substring(Q,Q+1),T=parseInt(E,10),A?(T*=2,T>=10?g+=T%10+1:g+=T):g+=T,A=!A;if(!(g%10===0&&b))return[ie(m.invalidCardNumber)]},alpha(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!/^[a-zA-Z]*$/.test(n))return[ie(m.invalidTextContainNumber)]},alphaNumeric(n,s,l,m=_e){const f=Pe(n,s.required,m);if(f!=null)return f;if(!/^[a-zA-Z0-9]*$/.test(n))return[ie(m.invalidTextContainSpec)]}};Object.keys(cn).forEach(n=>{const s=cn[n];C.isFunction(s)&&(s.locale=l=>(m,f,u)=>s(m,f,u,C.defaults(l,_e)))});function bo(n){return C.isString(n)?cn[n]!=null?cn[n]:(console.warn(`'${n}' is not a validator function!`),null):n}function Ar(n,s,l){let m=C.get(l.context,"schema.attributes",{});const f=s.value||"input";C.isString(f)&&(m=C.get(m,f)||m),C.forEach(m,(u,b)=>{n.setAttribute(b,u)})}const Y={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:Ar,updated:Ar,componentUpdated:Ar}},computed:{value:{cache:!1,get(){let n;return C.isFunction(C.get(this.schema,"get"))?n=this.schema.get(this.model):n=C.get(this.model,this.schema.model),this.formatValueToField(n)},set(n){const s=this.value;n=this.formatValueToModel(n),C.isFunction(n)?n(n,s):this.updateModelValue(n,s)}}},methods:{validate(n){this.clearValidationErrors();const s=C.get(this.formOptions,"validateAsync",!1);let l=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const f=[];C.isArray(this.schema.validator)?C.forEach(this.schema.validator,u=>{f.push(bo(u).bind(this))}):f.push(bo(this.schema.validator).bind(this)),C.forEach(f,u=>{if(s)l.push(u(this.value,this.schema,this.model));else{const b=u(this.value,this.schema,this.model);b&&C.isFunction(b.then)?b.then(g=>{g&&(this.errors=this.errors.concat(g));const E=this.errors.length===0;this.$emit("validated",E,this.errors,this)}):b&&(l=l.concat(b))}})}const m=f=>{let u=[];C.forEach(C.uniq(f),g=>{C.isArray(g)&&g.length>0?u=u.concat(g):C.isString(g)&&u.push(g)}),C.isFunction(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,u,this.schema);const b=u.length===0;return n||this.$emit("validated",b,u,this),this.errors=u,u};return s?Promise.all(l).then(m):m(l)},debouncedValidate(){C.isFunction(this.debouncedValidateFunc)||(this.debouncedValidateFunc=C.debounce(this.validate.bind(this),C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(n,s){let l=!1;C.isFunction(this.schema.set)?(this.schema.set(this.model,n),l=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,n),l=!0),l&&(this.$emit("modelUpdated",n,this.schema.model),C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,n,s,this.schema),C.get(this.formOptions,"validateAfterChanged",!1)===!0&&(C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(n,s){let l=n.replace(/\[(\w+)\]/g,".$1");l=l.replace(/^\./,"");let m=this.model;const f=l.split(".");let u=0;const b=f.length;for(;u<b;){const g=f[u];if(u<b-1)m[g]!==void 0||(m[g]={}),m=m[g];else{m[g]=s;return}++u}},getFieldID(n,s=!1){const l=C.get(this.formOptions,"fieldIdPrefix","");return ro(n,l)+(s?"-"+C.uniqueId():"")},getLabelId(n){return`${this.getFieldID(n)}-label`},getFieldClasses(){return C.get(this.schema,"fieldClasses",[])},formatValueToField(n){return n},formatValueToModel(n){return n}}},Ba=Object.freeze(Object.defineProperty({__proto__:null,default:Y},Symbol.toStringTag,{value:"Module"})),Ta={mixins:[Y]},Ia=["id","autocomplete","disabled","name","required"];function Ma(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("input",{id:n.getFieldID(n.schema),type:"checkbox","onUpdate:modelValue":s[0]||(s[0]=g=>n.value=g),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,class:i.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Ia)),[[i.vModelCheckbox,n.value],[b,"input"]])}const P=(n,s)=>{const l=n.__vccOpts||n;for(const[m,f]of s)l[m]=f;return l},Na=P(Ta,[["render",Ma]]),Aa={class:"wrapper"},Fa=["disabled"],Va=["id","checked","disabled","onChange","name"],$a=["disabled"],Oa={class:"info"},Da=i.createElementVNode("div",{class:"arrow"},null,-1),La={class:"dropList"},Ua=["id","checked","disabled","onChange","name"];function Ra(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",Aa,[n.schema.listBox?(i.openBlock(),i.createElementBlock("div",{key:0,class:"listbox form-control",disabled:n.disabled||null},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[i.createElementVNode("label",null,[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:E=>u.onChanged(E,g),name:u.getInputName(g)},null,40,Va),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)])],2))),256))],8,Fa)):i.createCommentVNode("",!0),n.schema.listBox?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:1,class:"combobox form-control",disabled:n.disabled||null},[i.createElementVNode("div",{class:i.normalizeClass(["mainRow",{expanded:f.comboExpanded}]),onClick:s[0]||(s[0]=(...g)=>u.onExpandCombo&&u.onExpandCombo(...g))},[i.createElementVNode("div",Oa,i.toDisplayString(u.selectedCount)+" selected",1),Da],2),i.createElementVNode("div",La,[f.comboExpanded?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[i.createElementVNode("label",null,[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:E=>u.onChanged(E,g),name:u.getInputName(g)},null,40,Ua),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)])],2))),256)):i.createCommentVNode("",!0)])],8,$a))])),[[b,"wrapper"]])}const xa=P({mixins:[Y],data(){return{comboExpanded:!1}},computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(n){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?io(this.schema.inputName+"_"+this.getItemValue(n)):io(this.getItemValue(n))},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return n[this.schema.checklistOptions.value];if(typeof n.value<"u")return n.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return n[this.schema.checklistOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return n},isItemChecked(n){return this.value&&this.value.indexOf(this.getItemValue(n))!==-1},onChanged(n,s){if((C.isNil(this.value)||!Array.isArray(this.value))&&(this.value=[]),n.target.checked){const l=C.clone(this.value);l.push(this.getItemValue(s)),this.value=l}else{const l=C.clone(this.value);l.splice(this.value.indexOf(this.getItemValue(s)),1),this.value=l}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",Ra]]),Pa={class:"wrapper"},qa=["id","type","value","disabled","accept","alt","autocomplete","checked","dirname","formaction","formenctype","formmethod","formnovalidate","formtarget","height","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","readonly","required","size","src","step","width","files"],za={key:0,class:"helper"};function Ha(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",Pa,[i.withDirectives(i.createElementVNode("input",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),id:n.getFieldID(n.schema),type:u.inputType,value:n.value,onInput:s[0]||(s[0]=(...g)=>u.onInput&&u.onInput(...g)),onBlur:s[1]||(s[1]=(...g)=>u.onBlur&&u.onBlur(...g)),onChange:s[2]||(s[2]=(...g)=>n.schema.onChange&&n.schema.onChange(...g)),disabled:n.disabled||null,accept:n.schema.accept,alt:n.schema.alt,autocomplete:n.schema.autocomplete,checked:n.schema.checked||null,dirname:n.schema.dirname,formaction:n.schema.formaction,formenctype:n.schema.formenctype,formmethod:n.schema.formmethod,formnovalidate:n.schema.formnovalidate,formtarget:n.schema.formtarget,height:n.schema.height,list:n.schema.list,max:n.schema.max,maxlength:n.schema.maxlength,min:n.schema.min,minlength:n.schema.minlength,multiple:n.schema.multiple,name:n.schema.inputName,pattern:n.schema.pattern,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,size:n.schema&&n.schema.size>0?n.schema.size:1,src:n.schema.src,step:n.schema.step,width:n.schema.width,files:n.schema.files},null,42,qa),[[b,"input"]]),n.schema.inputType.toLowerCase()==="color"||n.schema.inputType.toLowerCase()==="range"?(i.openBlock(),i.createElementBlock("span",za,i.toDisplayString(n.value),1)):i.createCommentVNode("",!0)])),[[b,"wrapper"]])}const wo={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},Co=P({mixins:[Y],computed:{inputType(){return this.schema&&this.schema.inputType==="datetime"?"datetime-local":this.schema.inputType}},mounted(){switch(this.schema.inputType.toLowerCase()){case"number":case"range":this.debouncedFormatFunc=C.debounce((n,s)=>{this.formatNumberToModel(n,s)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":this.debouncedFormatFunc=C.debounce((n,s)=>{this.formatDatetimeToModel(n,s)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}},created(){this.schema.inputType.toLowerCase()==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")},methods:{formatValueToModel(n){if(n!=null)switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":case"number":case"range":return(s,l)=>{this.debouncedFormatFunc(n,l)}}return n},formatValueToField(n){switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":return this.formatDatetimeValueToField(n)}return n},formatDatetimeToModel(n,s){const l=wo[this.schema.inputType.toLowerCase()],m=xe.parse(n,l);m!==!1&&(this.schema.format?n=xe.format(m,this.schema.format):n=m.valueOf()),this.updateModelValue(n,s)},formatDatetimeValueToField(n){if(n==null)return null;const s=wo[this.schema.inputType.toLowerCase()];let l=n;return C.isNumber(n)||(l=xe.parse(n,s)),l!==!1?xe.format(l,s):n},formatNumberToModel(n,s){C.isNumber(n)||(n=NaN),this.updateModelValue(n,s)},onInput(n){let s=n.target.value;switch(this.schema.inputType.toLowerCase()){case"number":case"range":C.isNumber(parseFloat(n.target.value))&&(s=parseFloat(n.target.value));break}this.value=s},onBlur(){C.isFunction(this.debouncedFormatFunc)&&this.debouncedFormatFunc.flush()}}},[["render",Ha]]),Wa=["id"];function Ka(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("span",{id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[i.createTextVNode(i.toDisplayString(n.value),1)],10,Wa)),[[b,"label"]])}const Ya=P({mixins:[Y]},[["render",Ka]]),Ga=["disabled"],Za=["id","disabled","name","onClick","value","checked","required"];function Ja(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",{class:"radio-list",disabled:n.disabled||null},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>i.withDirectives((i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(u.getItemCssClasses(g))},[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"radio",disabled:u.isItemDisabled(g)||null,name:u.id,onClick:E=>u.onSelection(g),value:u.getItemValue(g),checked:u.isItemChecked(g)||null,class:i.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Za),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)],2)),[[b,"label"]])),256))],8,Ga)),[[b,"wrapper"]])}const Xa=P({mixins:[Y],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},id(){return this.schema.model}},methods:{getItemValue(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.value<"u")return n[this.schema.radiosOptions.value];if(typeof n.value<"u")return n.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.name<"u")return n[this.schema.radiosOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return n},getItemCssClasses(n){return{"is-checked":this.isItemChecked(n),"is-disabled":this.isItemDisabled(n)}},onSelection(n){this.value=this.getItemValue(n)},isItemChecked(n){return this.getItemValue(n)===this.value},isItemDisabled(n){if(this.disabled)return!0;const s=C.get(n,"disabled",!1);return C.isFunction(s)?s(this.model):s}}},[["render",Ja]]),Qa=["disabled","name","id"],ja=["disabled"],ed=["label"],td=["value"],nd=["value"];function rd(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("select",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":s[0]||(s[0]=g=>n.value=g),disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},[u.selectOptions.hideNoneSelectedText?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null},i.toDisplayString(u.selectOptions.noneSelectedText||"<Nothing selected>"),9,ja)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[g.group?(i.openBlock(),i.createElementBlock("optgroup",{key:0,label:u.getGroupName(g)},[g.ops?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(g.ops,E=>(i.openBlock(),i.createElementBlock("option",{value:u.getItemValue(E)},i.toDisplayString(u.getItemName(E)),9,td))),256)):i.createCommentVNode("",!0)],8,ed)):i.createCommentVNode("",!0),g.group?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",{key:1,value:u.getItemValue(g)},i.toDisplayString(u.getItemName(g)),9,nd))],64))),256))],10,Qa)),[[i.vModelSelect,n.value],[b,"input"]])}const ko=P({mixins:[Y],computed:{selectOptions(){return this.schema.selectOptions||{}},items(){const n=this.schema.values;return typeof n=="function"?this.groupValues(n.apply(this,[this.model,this.schema])):this.groupValues(n)}},methods:{formatValueToField(n){return C.isNil(n)?null:n},groupValues(n){const s=[];let l={};return n.forEach(m=>{l=null,m.group&&C.isObject(m)?(l=C.find(s,f=>f.group===m.group),l?l.ops.push({id:m.id,name:m.name}):(l={group:"",ops:[]},l.group=m.group,l.ops.push({id:m.id,name:m.name}),s.push(l))):s.push(m)}),s},getGroupName(n){if(n&&n.group)return n.group;throw new Error("Group name is missing! https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n}}},[["render",rd]]),id=["id","value","name","disabled"];function od(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("input",{id:n.getFieldID(n.schema),type:"submit",value:n.schema.buttonText,onClick:s[0]||(s[0]=(...b)=>u.onClick&&u.onClick(...b)),name:n.schema.inputName,disabled:n.disabled||null,class:i.normalizeClass(n.schema.fieldClasses)},null,10,id)}const ld=P({mixins:[Y],methods:{onClick(n){if(this.schema.validateBeforeSubmit===!0){n.preventDefault();const s=C.get(this.formOptions,"validateAsync",!1),l=this.vfg.validate(),m=f=>{s&&!C.isEmpty(f)||!s&&!f?C.isFunction(this.schema.onValidationError)&&this.schema.onValidationError(this.model,this.schema,f,n):C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)};l&&C.isFunction(l.then)?l.then(m):m(l)}else C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)}}},[["render",od]]),sd=["id","disabled","maxlength","minlength","placeholder","readonly","required","rows","name"];function ad(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("textarea",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":s[0]||(s[0]=g=>n.value=g),id:n.getFieldID(n.schema),disabled:n.disabled||null,maxlength:n.schema.max,minlength:n.schema.min,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,rows:n.schema.rows||2,name:n.schema.inputName},null,10,sd)),[[i.vModelText,n.value],[b,"input"]])}const Eo=P({mixins:[Y]},[["render",ad]]),dd={class:"wrapper"},cd=["id","name","accept","multiple","placeholder","readonly","required","disabled"];function ud(n,s,l,m,f,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",dd,[i.withDirectives(i.createElementVNode("input",{class:"form-control",id:n.getFieldID(n.schema),type:"file",name:n.schema.inputName,onChange:s[0]||(s[0]=(...g)=>u.onChange&&u.onChange(...g)),accept:n.schema.accept,multiple:n.schema.multiple,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,disabled:n.disabled||null},null,40,cd),[[b,"input"]])])),[[b,"wrapper"]])}const fd=P({mixins:[Y],methods:{onChange(n){C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,n,this)}}},[["render",ud]]),hd=["value","autocomplete","disabled","placeholder","readonly","name","id"];function md(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text",value:n.value,autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,hd)}const pd=P({mixins:[Y],data(){return{cleave:null}},mounted(){this.$nextTick(function(){window.Cleave?(this.cleave=new window.Cleave(this.$el,C.defaults(this.schema.cleaveOptions||{},{creditCard:!1,phone:!1,phoneRegionCode:"AU",date:!1,datePattern:["d","m","Y"],numeral:!1,numeralThousandsGroupStyle:"thousand",numeralDecimalScale:2,numeralDecimalMark:".",blocks:[],delimiter:" ",prefix:null,numericOnly:!1,uppercase:!1,lowercase:!1,maxLength:0})),this.cleave.properties&&this.cleave.properties.hasOwnProperty.call("result")?this.$watch("cleave.properties.result",()=>{this.value=this.cleave.properties.result}):this.$el.addEventListener("input",this.inputChange)):console.warn("Cleave is missing. Please download from https://github.com/nosir/cleave.js/ and load the script in the HTML head section!")})},beforeUnmount(){this.cleave&&(this.cleave.destroy(),this.$el.removeEventListener("input",this.inputChange))},methods:{inputChange(){this.value=this.$el.value}}},[["render",md]]),So={formatValueToField(n){if(n!=null){const s=this.schema.format?xe.parse(n,this.schema.format):new Date(n);return xe.format(s,this.getDateFormat())}return n},formatValueToModel(n){if(n!=null){const s=xe.parse(n,this.getDateFormat());this.schema.format?n=xe.format(s,this.schema.format):n=s.valueOf()}return n}},gd={class:"input-group date"},yd=["autocomplete","disabled","placeholder","readonly","name","id"],_d=i.createElementVNode("span",{class:"input-group-addon"},[i.createElementVNode("span",{class:"glyphicon glyphicon-calendar"})],-1);function bd(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("div",gd,[i.withDirectives(i.createElementVNode("input",{class:"form-control",type:"text","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,yd),[[i.vModelText,n.value]]),_d])}const vo="YYYY-MM-DD HH:mm:ss",wd={mixins:[Y],mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.datetimepicker){const n=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(C.defaults(this.schema.dateTimePickerOptions||{},{format:vo})).on("dp.change",()=>{this.value=n.value})}else console.warn("Bootstrap datetimepicker library is missing. Please download from https://eonasdan.github.io/bootstrap-datetimepicker/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.datetimepicker&&$(this.$el).data("DateTimePicker").destroy()},methods:{getDateFormat(){return this.schema.dateTimePickerOptions&&this.schema.dateTimePickerOptions.format?this.schema.dateTimePickerOptions.format:vo},...So}},Cd=P(wd,[["render",bd]]),kd=["autocomplete","disabled","placeholder","readonly","name","id"];function Ed(n,s,l,m,f,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,debounce:"500",onFocus:s[1]||(s[1]=b=>u.geolocate()),id:n.getFieldID(n.schema)},null,40,kd)),[[i.vModelText,n.value]])}const Sd=P({mixins:[Y],data(){return{autocomplete:"",inputs:{street_number:"long_name",route:"long_name",country:"long_name",administrative_area_level_1:"long_name",administrative_area_level_2:"long_name",locality:"long_name",postal_code:"short_name"}}},mounted(){this.$nextTick(()=>{window.google&&window.google.maps&&window.google.maps.places&&window.google.maps.places.Autocomplete?(this.autocomplete=new google.maps.places.Autocomplete(this.$el,{types:["geocode"]}),this.autocomplete.addListener("place_changed",this.pipeAddress)):console.warn("Google Maps API is missing. Please add https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&libraries=places script in the HTML head section!")})},methods:{pipeAddress(){const n=this.autocomplete.getPlace();if(n){this.value=n.formatted_address;const s={};if(n.address_components!==void 0)for(let l=0;l<n.address_components.length;l++){const m=n.address_components[l].types[0];this.inputs[m]&&(s[m]=n.address_components[l][this.inputs[m]])}C.isFunction(this.schema.onPlaceChanged)&&this.schema.onPlaceChanged(this.value,s,n,this.model,this.schema)}},geolocate(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(n=>{const s={lat:n.coords.latitude,lng:n.coords.longitude},l=new window.google.maps.Circle({center:s,radius:n.coords.accuracy});this.autocomplete.setBounds(l.getBounds())})}}},[["render",Ed]]),vd={class:"wrapper"},Bd=["autocomplete","disabled","placeholder","readonly"],Td=["disabled","name"];function Id(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("div",vd,[i.withDirectives(i.createElementVNode("input",{class:"form-control link",type:"text","onUpdate:modelValue":s[0]||(s[0]=b=>u.wrappedValue=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly},null,8,Bd),[[i.vShow,n.schema.hideInput!==!0],[i.vModelText,u.wrappedValue]]),n.schema.browse!==!1?(i.openBlock(),i.createElementBlock("input",{key:0,class:"form-control file",type:"file",disabled:n.disabled||null,onChange:s[1]||(s[1]=(...b)=>u.fileChanged&&u.fileChanged(...b)),name:n.schema.inputName},null,40,Td)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"preview",style:i.normalizeStyle(u.previewStyle)},[i.createElementVNode("div",{class:"remove",title:"Remove image",onClick:s[2]||(s[2]=(...b)=>u.remove&&u.remove(...b))})],4)])}const Md=P({mixins:[Y],computed:{previewStyle(){return this.schema.preview!==!1?{display:"block","background-image":this.value!=null?"url("+this.value+")":"none"}:{display:"none"}},wrappedValue:{get(){return this.value&&this.value.indexOf("data")===0?"<inline base64 image>":this.value},set(n){n&&n.indexOf("http")===0&&(this.value=n)}}},watch:{model:{deep:!0,handler(){const n=this.$el.querySelector("input.file");n&&(n.value="")}}},methods:{remove(){this.value=""},fileChanged(n){const s=new FileReader;s.onload=l=>{this.value=l.target.result},n.target.files&&n.target.files.length>0&&s.readAsDataURL(n.target.files[0])}}},[["render",Id]]),Nd=["autocomplete","disabled","placeholder","readonly","name","id"];function Ad(n,s,l,m,f,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Nd)),[[i.vModelText,n.value]])}const Fd=P({mixins:[Y],mounted(){this.$nextTick(function(){window.$&&window.$.fn.mask?$(this.$el).unmask().mask(this.schema.mask,this.schema.maskOptions):console.warn("JQuery MaskedInput library is missing. Please download from https://github.com/digitalBush/jquery.maskedinput and load the script in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.mask&&$(this.$el).unmask()}},[["render",Ad]]),Vd={mixins:[Y],data(){return{slider:null}},computed:{containPips(){return this.schema.noUiSliderOptions&&typeof this.schema.noUiSliderOptions.pips<"u"},containTooltip(){return this.schema.noUiSliderOptions&&this.schema.noUiSliderOptions.tooltips}},watch:{model:{handler(){window.noUiSlider&&this.slider&&this.slider.noUiSlider&&this.slider.noUiSlider.set(this.value)},deep:!0}},mounted(){this.$nextTick(()=>{window.noUiSlider?(this.slider=this.$el,window.noUiSlider.create(this.slider,C.defaults(this.schema.noUiSliderOptions||{},{start:this.getStartValue(),range:{min:this.schema.min,max:this.schema.max}})),this.slider.noUiSlider.on("change",this.onChange.bind(this))):console.warn("noUiSlider is missing. Please download from https://github.com/leongersen/noUiSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.noUiSlider.off("change")},methods:{onChange(n){C.isArray(n)?this.value=[parseFloat(n[0]),parseFloat(n[1])]:this.value=parseFloat(n)},formatValueToField(n){this.slider!==null&&typeof this.slider.noUiSlider<"u"&&this.slider.noUiSlider.set(n)},formatValueToModel(n){if(typeof this.slider.noUiSlider<"u")return n instanceof Array?[Number(n[0]),Number(n[1])]:Number(n)},getStartValue(){return this.value!=null?this.value:typeof this.schema.noUiSliderOptions<"u"&&this.schema.noUiSliderOptions.double?[this.schema.min,this.schema.min]:this.schema.min}}},$d=["disabled"];function Od(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["slider",{"contain-pips":u.containPips,"contain-tooltip":u.containTooltip}]),disabled:n.disabled||null},null,10,$d)}const Dd=P(Vd,[["render",Od]]),Ld=["autocomplete","disabled","placeholder","readonly","name"];function Ud(n,s,l,m,f,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,Ld)),[[i.vModelText,n.value]])}const Rd="YYYY-MM-DD",xd={mixins:[Y],data(){return{picker:null,options:null}},mounted(){this.initialize(C.get(this.schema,"pikadayOptions",{}))},beforeUnmount(){this.picker&&this.picker.destroy()},methods:{getDateFormat(){return C.get(this.schema,"pikadayOptions.format",Rd)},...So,initialize(n){this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(()=>{window.Pikaday?(this.options=C.defaults({},n,{field:this.$el,onSelect:()=>{this.value=this.picker.toString()}}),this.picker=new window.Pikaday(this.options)):console.warn("Pikaday is missing. Please download from https://github.com/dbushell/Pikaday/ and load the script and CSS in the HTML head section!")})}}},Pd=P(xd,[["render",Ud]]),qd=["autocomplete","data-disable","data-max","data-min","data-step","placeholder","readonly","name"];function zd(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,"data-disable":n.disabled,"data-max":n.schema.max,"data-min":n.schema.min,"data-step":n.schema.step,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,qd)}const Hd=P({mixins:[Y],data(){return{slider:null}},watch:{model:{deep:!0,handler(){if(window.$&&window.$.fn.ionRangeSlider){let n,s;C.isArray(this.value)?[n,s]=this.value:n=this.value,this.slider&&this.slider.update({from:n,to:s})}}}},mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.ionRangeSlider){let n,s;C.isArray(this.value)?[n,s]=this.value:n=this.value;const l=this;$(this.$el).ionRangeSlider(C.defaults(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:n,to:s,onChange(m){l.slider.options.type==="double"?l.value=[m.from,m.to]:l.value=m.from}})),this.slider=$(this.$el).data("ionRangeSlider")}else console.warn("ion.rangeSlider library is missing. Please download from https://github.com/IonDen/ion.rangeSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.destroy()}},[["render",zd]]),Wd=["disabled","multiple","title","name"],Kd=["disabled","selected"],Yd=["value"];function Gd(n,s,l,m,f,u){return i.withDirectives((i.openBlock(),i.createElementBlock("select",{class:"selectpicker","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),disabled:n.disabled||null,multiple:n.schema.multiSelect,title:n.schema.placeholder,"data-width":"100%",name:n.schema.inputName},[n.schema.multiSelect!==!0?(i.openBlock(),i.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null,selected:n.value==null},null,8,Kd)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,b=>(i.openBlock(),i.createElementBlock("option",{value:u.getItemValue(b)},i.toDisplayString(u.getItemName(b)),9,Yd))),256))],8,Wd)),[[i.vModelSelect,n.value]])}const Zd=P({mixins:[Y],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n}},watch:{model:{deep:!0,handler(){$.fn.selectpicker&&$(this.$el).selectpicker("refresh")}}},mounted(){this.$nextTick(function(){$.fn.selectpicker?$(this.$el).selectpicker("destroy").selectpicker(this.schema.selectOptions):console.warn("Bootstrap-select library is missing. Please download from https://silviomoreto.github.io/bootstrap-select/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){$.fn.selectpicker&&$(this.$el).selectpicker("destroy")},methods:{getItemValue(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n}}},[["render",Gd]]),Jd=["autocomplete","disabled","placeholder","readonly","name","id"];function Xd(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Jd)}const Qd=P({mixins:[Y],data(){return{picker:null}},watch:{model:{deep:!0,handler(){window.$&&window.$.fn.spectrum&&this.picker.spectrum("set",this.value)}},disabled(n){n?this.picker.spectrum("disable"):this.picker.spectrum("enable")}},mounted(){this.$nextTick(function(){window.$&&window.$.fn.spectrum?(this.picker=$(this.$el).spectrum("destroy").spectrum(C.defaults(this.schema.colorOptions||{},{showInput:!0,showAlpha:!0,disabled:this.schema.disabled,allowEmpty:!this.schema.required,preferredFormat:"hex",change:n=>{this.value=n?n.toString():null}})),this.picker.spectrum("set",this.value)):console.warn("Spectrum color library is missing. Please download from http://bgrins.github.io/spectrum/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.picker&&this.picker.spectrum("destroy")}},[["render",Xd]]),jd=["src"];function ec(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("img",{src:u.mapLink},null,8,jd)}const tc=P({mixins:[Y],computed:{mapLink(){let n,s,l;if(this.value){const m=C.defaults(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});n=this.value[m.lat],s=this.value[m.lng],l=`http://maps.googleapis.com/maps/api/staticmap?center=${n},${s}&zoom=${m.zoom}&size=${m.sizeX}x${m.sizeY}`;const f=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"];for(const u of f)typeof m[u]<"u"&&(l+=`&${u}=${m[u]}`)}return l}}},[["render",ec]]),nc=["autocomplete","disabled","name","id"],rc=["data-on","data-off","for"],ic=i.createElementVNode("span",{class:"handle"},null,-1);function oc(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("label",null,[i.withDirectives(i.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":s[0]||(s[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,nc),[[i.vModelCheckbox,n.value]]),i.createElementVNode("span",{class:"label","data-on":n.schema.textOn||"On","data-off":n.schema.textOff||"Off",for:n.getFieldID(n.schema)},null,8,rc),ic])}const lc=P({mixins:[Y],methods:{formatValueToField(n){return n!=null&&this.schema.valueOn?n===this.schema.valueOn:n},formatValueToModel(n){return n!=null&&this.schema.valueOn?n?this.schema.valueOn:this.schema.valueOff:n}}},[["render",oc]]),sc={mixins:[Y],data(){return{attributes:this.schema?this.schema.attributes:void 0,newKeyType:"string",newKeyName:"",keyTypes:{}}},created(){this.value||(this.value={})},mounted(){if(!this.value)return;const n=Object.keys(this.value),s={};for(let l=0;l<n.length;l++){const m=n[l];s[m]=typeof this.value[m]}this.keyTypes=s},methods:{removeElement(n){const s=this.value;delete s[n],this.value=JSON.parse(JSON.stringify(s));const l=this.keyTypes;delete l[n],this.keyTypes=JSON.parse(JSON.stringify(l))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""}}},ac={key:0},dc={key:1},cc=["id"],uc={key:0},fc=["onUpdate:modelValue"],hc={key:1},mc=["onUpdate:modelValue"],pc={key:2},gc=["onUpdate:modelValue"],yc=["onClick"],_c=[i.createElementVNode("option",{value:"string"}," String ",-1),i.createElementVNode("option",{value:"number"}," Number ",-1),i.createElementVNode("option",{value:"boolean"}," Boolean ",-1)];function bc(n,s,l,m,f,u){const b=i.resolveComponent("vue-form-generator"),g=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",null,[n.schema.schema?(i.openBlock(),i.createElementBlock("div",ac,[i.createVNode(b,{model:n.value,options:n.formOptions,schema:n.schema.schema},null,8,["model","options","schema"])])):(i.openBlock(),i.createElementBlock("div",dc,[i.createElementVNode("table",{id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(E,T)=>(i.openBlock(),i.createElementBlock("tr",{key:T},[i.createElementVNode("td",null,i.toDisplayString(T),1),f.keyTypes[T]==="string"?(i.openBlock(),i.createElementBlock("td",uc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":A=>n.value[T]=A,type:"text"},null,8,fc),[[i.vModelText,n.value[T]]])])):i.createCommentVNode("",!0),f.keyTypes[T]==="boolean"?(i.openBlock(),i.createElementBlock("td",hc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":A=>n.value[T]=A,type:"checkbox"},null,8,mc),[[i.vModelCheckbox,n.value[T]]])])):i.createCommentVNode("",!0),f.keyTypes[T]==="number"?(i.openBlock(),i.createElementBlock("td",pc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":A=>n.value[T]=A,type:"number"},null,8,gc),[[i.vModelText,n.value[T]]])])):i.createCommentVNode("",!0),i.createElementVNode("td",null,[i.createElementVNode("input",{type:"button",value:"x",onClick:A=>u.removeElement(T)},null,8,yc)])]))),128))],10,cc),i.withDirectives(i.createElementVNode("select",{"onUpdate:modelValue":s[0]||(s[0]=E=>f.newKeyType=E)},_c,512),[[i.vModelSelect,f.newKeyType]]),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":s[1]||(s[1]=E=>f.newKeyName=E),type:"text"},null,512),[[i.vModelText,f.newKeyName]]),i.createElementVNode("input",{type:"button",value:"Add key",onClick:s[2]||(s[2]=(...E)=>u.addKey&&u.addKey(...E))})]))])),[[g,f.attributes]])}const Bo=P(sc,[["render",bc]]),wc={mixins:[Y],emits:["model-updated"],data(){return{newKeyName:""}},computed:{subSchema(){return this.schema.schema&&this.schema.schema.fields[0].schema},subFields(){return!this.subSchema&&this.schema.fields},hasObjectKeys(){return this.value&&Object.keys(this.value).length>0},transformedModel(){return this.subSchema&&this.subSchema.fields.length>=1&&this.subSchema.fields[0].type==="array"?new Proxy(this.model[this.schema.model],{get:(n,s)=>({[this.schema.model]:n[s]}),set:(n,s,l)=>n[s]=l[this.schema.model]}):this.model[this.schema.model]}},mounted(){this.value||(this.value={});let n=[];this.subSchema?n=this.subSchema.fields:this.subFields&&(n=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,n,this.schema.model)},methods:{removeElement(n){const s=this.value;delete s[n],this.value={...s}},transformMapModelValuesToObject(n,s,l){const m={};return Object.keys(n).map(f=>{const u=f.indexOf(l+"-");if(u>-1&&Array.isArray(s))if(s.length>0){const g=f.split("-").filter(T=>s.find(A=>A.model===T)),E=f.split(`-${g}`)[0].split(`${l}-`)[1];g.length?m[E]={...m[E],[g]:n[f]}:m[f.substring(u+`${l}-`.length)]=n[f]}else m[f.substring(`${l}-`.length)]=n[f];else{const g=f.split("-").filter(T=>T===this.schema.model),E=f.split(`-${g}`)[0].split(`${l}-`)[1];E&&(m[E]=n[f])}return f}),m},addKey(){const n=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",s=this.subSchema?n?[""]:{}:"";this.value[this.newKeyName]=s,this.newKeyName=""},updateModel(n,s){this.$emit("model-updated",this.model[this.schema.model],s)}}},To=n=>(i.pushScopeId("data-v-22600a29"),n=n(),i.popScopeId(),n),Cc=["id"],kc=["data-testid"],Ec={class:"item-wrapper"},Sc={class:"index-wrapper"},vc=To(()=>i.createElementVNode("hr",{class:"divider"},null,-1)),Bc={key:0},Tc={key:1},Ic=["onUpdate:modelValue","placeholder","onInput"],Mc={key:0,class:"hint"},Nc=To(()=>i.createElementVNode("hr",{class:"wide-divider"},null,-1)),Ac={class:"input-item"},Fc=["placeholder"],Vc={key:0,class:"hint"};function $c(n,s,l,m,f,u){const b=i.resolveComponent("KIcon"),g=i.resolveComponent("KButton"),E=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",{id:n.getFieldID(n.schema),class:i.normalizeClass(["object-advanced-wrapper",n.schema.fieldClasses])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(T,A)=>(i.openBlock(),i.createElementBlock("div",{key:A,"data-testid":`field-object-key-${A}`},[i.createElementVNode("div",null,[i.createElementVNode("div",Ec,[i.createElementVNode("div",Sc,[i.createElementVNode("strong",null,i.toDisplayString(A),1),i.createElementVNode("div",null,[i.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:Q=>u.removeElement(A)},{default:i.withCtx(()=>[i.createVNode(b,{icon:"trash",size:"18"})]),_:2},1032,["onClick"])])]),vc,u.subSchema?(i.openBlock(),i.createElementBlock("div",Bc,[i.createVNode(E,{model:u.transformedModel[A],options:{helpAsHtml:!0},schema:u.subSchema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])):(i.openBlock(),i.createElementBlock("div",Tc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":Q=>n.value[A]=Q,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:"text",onInput:Q=>u.updateModel(n.value[A],n.model[n.schema.model])},null,40,Ic),[[i.vModelText,n.value[A]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(i.openBlock(),i.createElementBlock("p",Mc,i.toDisplayString(n.schema.fields[0].schema.hint),1)):i.createCommentVNode("",!0)])),Nc])])],8,kc))),128)),i.createElementVNode("div",{class:i.normalizeClass(["input-wrapper",{indent:u.hasObjectKeys}])},[i.createElementVNode("div",Ac,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=T=>f.newKeyName=T),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Fc),[[i.vModelText,f.newKeyName]]),i.createVNode(g,{appearance:"tertiary","data-testid":"add-key",disabled:!f.newKeyName,onClick:u.addKey},{default:i.withCtx(()=>[i.createTextVNode(" + Add "+i.toDisplayString(n.schema.buttonLabel||n.schema.label),1)]),_:1},8,["disabled","onClick"])]),n.schema.hintText?(i.openBlock(),i.createElementBlock("p",Vc,i.toDisplayString(n.schema.hintText),1)):i.createCommentVNode("",!0)],2)],10,Cc)}const Io=P(wc,[["render",$c],["__scopeId","data-v-22600a29"]]),Dn="24px",Mo=(n,s)=>{const l=n.__vccOpts||n;for(const[m,f]of s)l[m]=f;return l},Oc=n=>(i.pushScopeId("data-v-a81be499"),n=n(),i.popScopeId(),n),Dc=["aria-hidden"],Lc={key:0,"data-testid":"kui-icon-svg-title"},Uc=Oc(()=>i.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Rc=i.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const s=String(n).replace(/px/gi,""),l=Number(s);if(l&&!isNaN(l)&&Number.isInteger(l)&&l>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const s=n,l=i.computed(()=>{if(typeof s.size=="number"&&s.size>0)return`${s.size}px`;if(typeof s.size=="string"){const f=String(s.size).replace(/px/gi,""),u=Number(f);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=i.computed(()=>({boxSizing:"border-box",color:s.color,display:s.display,height:l.value,lineHeight:"0",width:l.value}));return(f,u)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:i.normalizeStyle(m.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(i.openBlock(),i.createElementBlock("title",Lc,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),Uc],8,Dc))]),_:1},8,["aria-hidden","style"]))}}),xc=Mo(Rc,[["__scopeId","data-v-a81be499"]]),Pc=n=>(i.pushScopeId("data-v-2674553b"),n=n(),i.popScopeId(),n),qc=["aria-hidden"],zc={key:0,"data-testid":"kui-icon-svg-title"},Hc=Pc(()=>i.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),Wc=i.defineComponent({__name:"TrashIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const s=String(n).replace(/px/gi,""),l=Number(s);if(l&&!isNaN(l)&&Number.isInteger(l)&&l>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const s=n,l=i.computed(()=>{if(typeof s.size=="number"&&s.size>0)return`${s.size}px`;if(typeof s.size=="string"){const f=String(s.size).replace(/px/gi,""),u=Number(f);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=i.computed(()=>({boxSizing:"border-box",color:s.color,display:s.display,height:l.value,lineHeight:"0",width:l.value}));return(f,u)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:i.normalizeStyle(m.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-trash-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(i.openBlock(),i.createElementBlock("title",zc,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),Hc],8,qc))]),_:1},8,["aria-hidden","style"]))}}),Ln=Mo(Wc,[["__scopeId","data-v-2674553b"]]),Kc={name:"FieldArrayItem",components:{TrashIcon:Ln},props:{model:{type:String,default:null}},emits:["remove-item"],data(){return{contentVisible:!1}}},Yc={class:"array-item"};function Gc(n,s,l,m,f,u){const b=i.resolveComponent("TrashIcon"),g=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Yc,[i.renderSlot(n.$slots,"default",{},void 0,!0),i.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:s[0]||(s[0]=E=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})])}const No=P(Kc,[["render",Gc],["__scopeId","data-v-d42daeb2"]]),Zc={name:"FieldArrayMultiItem",emits:["remove-item"],data(){return{contentVisible:!1}}},Jc=n=>(i.pushScopeId("data-v-47ff1f9a"),n=n(),i.popScopeId(),n),Xc={class:"multi-item-wrapper"},Qc=Jc(()=>i.createElementVNode("hr",null,null,-1));function jc(n,s,l,m,f,u){const b=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Xc,[i.renderSlot(n.$slots,"default",{},void 0,!0),i.createVNode(b,{appearance:"danger",class:"delete",type:"input",onClick:s[0]||(s[0]=g=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createTextVNode(" - Remove Field ")]),_:1}),Qc])}const Ao=P(Zc,[["render",jc],["__scopeId","data-v-47ff1f9a"]]),eu={name:"FieldMetric",components:{AddIcon:xc,TrashIcon:Ln},mixins:[Y],emits:["remove-item"],data(){return{contentVisible:!1}}},tu={key:0,class:"content"};function nu(n,s,l,m,f,u){const b=i.resolveComponent("AddIcon"),g=i.resolveComponent("TrashIcon"),E=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["field-dropdown",{active:f.contentVisible}])},[i.createElementVNode("div",{class:"title",onClick:s[0]||(s[0]=T=>f.contentVisible=!f.contentVisible)},[i.createTextVNode(i.toDisplayString(n.model.name?n.model.name:"New Item")+" ",1),i.createVNode(b,{class:"metric-add-icon"})]),i.createVNode(i.Transition,{name:"slide-fade"},{default:i.withCtx(()=>[f.contentVisible?(i.openBlock(),i.createElementBlock("div",tu,[i.renderSlot(n.$slots,"default"),i.createVNode(E,{appearance:"tertiary",class:"metric-remove-button",onClick:s[1]||(s[1]=T=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(g)]),_:1})])):i.createCommentVNode("",!0)]),_:3})],2)}const Fo=P(eu,[["render",nu]]),wt="kong-ui-forms-api",ru="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";function iu(n){return n?n.length===36&&new RegExp(`^${ru}$`).test(n):!1}const Fr=50,Ft={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"};function ou(n,s,l){return l?Ft.SET_REFERRAL_VALUE:n&&!s||!n&&s?Ft.UPDATE_ENTITY:n&&s?Ft.CREATE_FROM_ENTITY:Ft.CREATE_NOT_FROM_ENTITY}const lu={mixins:[Y],inject:[wt],emits:["model-updated"],data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return ou(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search}},watch:{idValue:{handler(n,s){n!==s&&this.updateModel(n)}}},async created(){await this.$nextTick();let n,s;switch(this.fieldState){case Ft.UPDATE_ENTITY:if(!this[wt]){console.warn("[@kong-ui-public/forms] No API service provided");break}s=(await this[wt].getOne(this.entity,this.model[this.schema.model])).data,n=this.getItem(this.schema.entityDataKey?s[this.schema.entityDataKey]:s),this.idValue=n.id;break;case Ft.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case Ft.SET_REFERRAL_VALUE:this.idValue=this.value}try{n&&(this.initialItems=[{...n,label:this.getSuggestionLabel(n),value:n.id}]),this.items=this.initialItems}catch(l){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",l)}},methods:{onQueryChange(n){n.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=C.debounce(this.search,500)),this.performSearch(n)},async search(n){if(n.trim().length===0)return;this.loading=!0;const s=[],l=[],m=this.getInputFields(),f=new Set;iu(n)&&m.includes("id")?l.push((async()=>{const u=await this.fetchExact(n);s.push({...u,label:this.getSuggestionLabel(u),value:u.id})})()):l.push(...m.filter(u=>u!=="id").map(async u=>{(await this.fetchSuggestions(n,u)).forEach(g=>{f.has(g.id)||(f.add(g.id),s.push({...g,label:this.getSuggestionLabel(g),value:g.id}))})})),await Promise.all(l),this.items=s,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(n){return n.data?n.data.length>0?n.data[0]:[]:n},async fetchUntilLimit(n){const s=[];let l=null;if(!this[wt])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;s.length<Fr;){const m=await this[wt].getAll(this.entity,{size:Fr,offset:l,...n});if(s.push(...m.data.data),l=m.data.offset,!l)break}return s.slice(0,Fr)},async fetchSuggestions(n,s){return this.fetchUntilLimit({[s]:n})},async fetchExact(n){return this[wt]?(await this[wt].getOne(this.entity,n)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var n,s;return((s=(n=this.schema)==null?void 0:n.inputValues)==null?void 0:s.fields)||[]},getSuggestionLabel(n){const s=this.getInputFields();return s.length&&n?s.map(l=>n[l]).filter(Boolean).join(" - "):""},updateModel(n){this.$emit("model-updated",n!=null&&n.length?n:null,this.schema.model)},onSelected(n){this.idValue=n&&n.id,this.updateModel(this.getReturnValue(n||{}))},getReturnValue(n){var l;const s=(l=this.schema)==null?void 0:l.returnKey;return s?n[s]:n.id}}},su={class:"field-wrap autosuggest"},au=["data-testid","data-testlabel"],du=["data-testid"],cu={class:"autosuggest__results_message"};function uu(n,s,l,m,f,u){const b=i.resolveComponent("KSelect");return i.openBlock(),i.createElementBlock("div",su,[i.createVNode(b,{id:n.schema.model,ref:"suggestion",modelValue:f.idValue,"onUpdate:modelValue":s[0]||(s[0]=g=>f.idValue=g),clearable:"","enable-filtering":"","filter-function":()=>!0,items:f.items,loading:f.loading,placeholder:n.schema.placeholder,width:"100%",onChange:u.onSelected,onQueryChange:u.onQueryChange},{"item-template":i.withCtx(({item:g})=>[i.createElementVNode("span",{class:"first-part","data-testid":g.id&&`${g.id}-0`,"data-testlabel":g.label},i.toDisplayString(u.getSuggestionLabel(g).split(" - ")[0]),9,au),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.getSuggestionLabel(g).split(" - ").slice(1),(E,T)=>(i.openBlock(),i.createElementBlock("span",{key:T,class:"field-span","data-testid":g.id&&`${g.id}-${T+1}`||T+1},i.toDisplayString(E),9,du))),128))]),empty:i.withCtx(()=>[i.createElementVNode("div",cu,[i.createElementVNode("span",null,i.toDisplayString(f.message),1)])]),_:1},8,["id","modelValue","items","loading","placeholder","onChange","onQueryChange"])])}const Vo=P(lu,[["render",uu],["__scopeId","data-v-62760c9d"]]),fu={name:"FieldArrayCardContainer",components:{TrashIcon:Ln},props:{model:{type:Object,default:null},schema:{type:Object,default:null}},emits:["remove-item"]},hu={class:"array-card-container"};function mu(n,s,l,m,f,u){const b=i.resolveComponent("KCard"),g=i.resolveComponent("TrashIcon"),E=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",hu,[i.createVNode(b,{class:"card"},{default:i.withCtx(()=>[i.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3}),i.createVNode(E,{appearance:"tertiary",class:"array-card-remove-button",onClick:s[0]||(s[0]=T=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(g)]),_:1})])}const $o=P(fu,[["render",mu],["__scopeId","data-v-68702965"]]),pu={mixins:[Y],emits:["model-updated"],methods:{updateModel(n){this.$emit("model-updated",n,this.schema.model)},checkOption(n){return this.model[this.schema.model]?n.value.toString()===this.model[this.schema.model].toString():n.checked},onChange(n){let s=n.target.value.split(",");this.schema.array||(s=s.toString()),this.updateModel(s)}}},gu={class:"selection-group"},yu={class:"form-group"},_u=["id","checked","name","value"];function bu(n,s,l,m,f,u){return i.openBlock(),i.createElementBlock("div",gu,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.schema.values,(b,g)=>(i.openBlock(),i.createElementBlock("div",{key:g,class:"option-group"},[i.createElementVNode("div",yu,[i.createElementVNode("label",{class:i.normalizeClass(["k-label",b.name])},[i.createElementVNode("input",{id:n.schema.name+"-"+g,checked:u.checkOption(b),class:"k-input",name:n.schema.name,type:"radio",value:b.value,onChange:s[0]||(s[0]=(...E)=>u.onChange&&u.onChange(...E))},null,40,_u),i.createTextVNode(" "+i.toDisplayString(b.name),1)],2)])]))),128))])}const Oo=P(pu,[["render",bu],["__scopeId","data-v-7e49acd6"]]),wu={name:"FieldArray",components:{FieldArrayItem:No,FieldArrayMultiItem:Ao,FieldSelect:ko,FieldMetric:Fo,FieldObject:Bo,FieldObjectAdvanced:Io,FieldAutoSuggest:Vo,FieldRadio:Oo,FieldArrayCardContainer:$o,FieldTextArea:Eo,FieldInput:Co},mixins:[Y],props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},methods:{generateSchema(n,s,l){var f,u,b;let m;return s&&(m=JSON.parse(JSON.stringify(s)),(b=(u=(f=m.schema)==null?void 0:f.fields)==null?void 0:u.map)==null||b.call(u,g=>(g.id=`${g.id||g.model}-${l}`,g))),{...m,set(g,E){n[l]=E},get(){return n[l]}}},newElement(){let n=this.value,s;(!n||!n.push)&&(n=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?s=this.schema.items.default():s=this.schema.items.default),n.push(s),this.value=[...n]},removeElement(n){this.value.splice(n,1)},getFieldType(n){return"field-"+n.type},modelUpdated(){}}},Cu=["id"],ku={key:1},Eu=["onUpdate:modelValue","aria-labelledby","type"],Su=["value","onClick"],vu=["onUpdate:modelValue","aria-labelledby"],Bu=["value","onClick"];function Tu(n,s,l,m,f,u){const b=i.resolveComponent("FieldTextArea"),g=i.resolveComponent("KButton");return n.schema?(i.openBlock(),i.createElementBlock("div",{key:0,id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(E,T)=>(i.openBlock(),i.createElementBlock("div",{key:T,class:i.normalizeClass(n.schema.fieldItemsClasses)},[n.schema.items&&n.schema.itemContainerComponent?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.schema.itemContainerComponent),{key:0,model:E,schema:u.generateSchema(n.value,n.schema.items,T),onRemoveItem:A=>u.removeElement(T)},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:E,schema:u.generateSchema(n.value,n.schema.items,T),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["model","schema","onRemoveItem"])):n.schema.items?(i.openBlock(),i.createElementBlock("span",ku,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:E,schema:u.generateSchema(n.value,n.schema.items,T),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):n.schema.itemContainerComponent?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.schema.itemContainerComponent),{key:2,"data-testid":`${n.getFieldID(n.schema)}-item-${T}`,model:E,schema:u.generateSchema(n.value,n.schema.items,T),onRemoveItem:A=>u.removeElement(T)},{default:i.withCtx(()=>{var A,Q;return[((A=n.schema.inputAttributes)==null?void 0:A.type)==="textarea"?(i.openBlock(),i.createBlock(b,{key:0,"aria-labelledby":n.getLabelId(n.schema),class:"k-input","form-options":n.formOptions,model:E,schema:u.generateSchema(n.value,n.schema.items,T),onModelUpdated:u.modelUpdated},null,8,["aria-labelledby","form-options","model","schema","onModelUpdated"])):i.withDirectives((i.openBlock(),i.createElementBlock("input",i.mergeProps({key:1,"onUpdate:modelValue":J=>n.value[T]=J,"aria-labelledby":n.getLabelId(n.schema)},n.schema.inputAttributes,{type:((Q=n.schema.inputAttributes)==null?void 0:Q.type)||"text"}),null,16,Eu)),[[i.vModelDynamic,n.value[T]]]),n.schema.showRemoveButton?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:2},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||l.removeElementButtonLabel,onClick:J=>u.removeElement(T)}),null,16,Su)):i.createCommentVNode("",!0)]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):i.withDirectives((i.openBlock(),i.createElementBlock("input",i.mergeProps({key:3},n.schema.inputAttributes,{"onUpdate:modelValue":A=>n.value[T]=A,"aria-labelledby":n.getLabelId(n.schema),type:"text"}),null,16,vu)),[[i.vModelText,n.value[T]]]),n.schema.showRemoveButton?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:4},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||l.removeElementButtonLabel,onClick:A=>u.removeElement(T)}),null,16,Bu)):i.createCommentVNode("",!0)],2))),128)),i.createVNode(g,{appearance:"tertiary",class:i.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`add-${n.getFieldID(n.schema)}`,type:"button",onClick:u.newElement},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.schema.newElementButtonLabel||l.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Cu)):i.createCommentVNode("",!0)}const Iu=P(wu,[["render",Tu],["__scopeId","data-v-1c5fa392"]]),Mu={mixins:[Y],emits:["model-updated"],data(){return{isOpen:!1}},computed:{openClass(){return this.isOpen?"open":"closed"},fieldCount(){return this.schema.fields.length},titleText(){return`${this.isOpen?"Hide":"View"} ${this.fieldCount} Advanced Fields`}},methods:{handleOpen(){this.isOpen=!this.isOpen},updateModel(n,s){this.$emit("model-updated",n,s)}}},Nu={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},Au={class:"material-icons"};function Fu(n,s,l,m,f,u){const b=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",Nu,[i.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:s[0]||(s[0]=(...g)=>u.handleOpen&&u.handleOpen(...g))},[i.createElementVNode("i",Au,i.toDisplayString(f.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),i.createElementVNode("span",null,i.toDisplayString(u.titleText),1)]),i.createElementVNode("div",{class:i.normalizeClass(["advanced-field-dropdown",u.openClass])},[i.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])],2)])}const Vu=P(Mu,[["render",Fu],["__scopeId","data-v-2d8e71e1"]]),$u={mixins:[Y],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},fieldSchema:[]}},watch:{checkedGroup:{handler(n,s){if(s===null){this.fieldModel={...this.model};return}const l=this.schema.fields[n].fields,m=this.schema.fields[s].fields;m&&m.forEach(f=>this.updateModel("",f.model)),l&&l.forEach(f=>this.updateModel(this.fieldModel[f.model],f.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((n,s)=>{n.fields&&n.fields.forEach(l=>{this.model[l.model]&&(this.checkedGroup=s,this.fieldSchema.push(l.model))})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(n,s){this.$emit("model-updated",n,s)}}},Ou={class:"selection-group"},Du={class:"form-group"},Lu=["value"],Uu={class:"control-help"},Ru={class:"option-field"},xu={class:"option-field-container"};function Pu(n,s,l,m,f,u){const b=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",Ou,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.schema.fields,(g,E)=>(i.openBlock(),i.createElementBlock("div",{key:E,class:"option-group"},[i.createElementVNode("div",Du,[i.createElementVNode("label",{class:i.normalizeClass(["k-label",`${g.label}-check`])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=T=>f.checkedGroup=T),class:"k-input",type:"radio",value:E},null,8,Lu),[[i.vModelRadio,f.checkedGroup]]),i.createTextVNode(" "+i.toDisplayString(g.label)+" ",1),i.createElementVNode("div",Uu,i.toDisplayString(g.description),1)],2)]),i.withDirectives(i.createElementVNode("div",Ru,[i.createElementVNode("div",xu,[i.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:{fields:g.fields},onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[i.vShow,g.fields&&f.checkedGroup===E]])]))),128))])}const qu=P($u,[["render",Pu],["__scopeId","data-v-25fe24da"]]),zu={mixins:[Y],emits:["model-updated"],methods:{onUpdate(n){this.$emit("model-updated",n,this.schema.model)}}};function Hu(n,s,l,m,f,u){const b=i.resolveComponent("KMultiselect");return i.openBlock(),i.createBlock(b,{"aria-labelledby":n.getLabelId(n.schema),"data-testid":"field-multiselect",items:n.schema.values,"label-attributes":{info:n.schema.help},"model-value":n.value,placeholder:n.schema.placeholder,required:n.schema.required||void 0,width:"100%","onUpdate:modelValue":u.onUpdate},null,8,["aria-labelledby","items","label-attributes","model-value","placeholder","required","onUpdate:modelValue"])}const Wu=P(zu,[["render",Hu]]),Ku={name:"FieldKeyValuePairs",components:{TrashIcon:Ln},mixins:[Y],data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var s,l;this.value||(this.value={});const n=((l=this.model)==null?void 0:l[(s=this.schema)==null?void 0:s.model])??{};Object.keys(n).forEach(m=>{this.pairs.push({key:m,value:n[m]})})},methods:{onInput(n,s,l){this.pairs[s][l]=n.target.value},updateValue(){this.value=this.pairs.reduce((n,{key:s,value:l})=>({...n,...s&&l?{[s]:l}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(n){this.pairs.splice(n,1)}}},Yu={class:"key-value-pairs-editor"},Gu=["data-testid","placeholder","value","onInput"],Zu=["data-testid","placeholder","value","onInput"];function Ju(n,s,l,m,f,u){const b=i.resolveComponent("TrashIcon"),g=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Yu,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(f.pairs,(E,T)=>(i.openBlock(),i.createElementBlock("div",{key:T,class:"pair-item"},[i.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-key-${T}`,placeholder:n.schema.keyInputPlaceholder??"Key",type:"text",value:E.key,onInput:A=>{u.onInput(A,T,"key")}},null,40,Gu),i.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-value-${T}`,placeholder:n.schema.valueInputPlaceholder??"Value",type:"text",value:E.value,onInput:A=>{u.onInput(A,T,"value")}},null,40,Zu),i.createVNode(g,{appearance:"tertiary","data-testid":`${n.getFieldID(n.schema)}-remove-pair-${T}`,onClick:()=>{u.removePair(T)}},{default:i.withCtx(()=>[i.createVNode(b)]),_:2},1032,["data-testid","onClick"])]))),128)),i.createVNode(g,{appearance:"tertiary",class:i.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`${n.getFieldID(n.schema)}-add-pair`,type:"button",onClick:u.addPair},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Xu={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:Vu,FieldArray:Iu,FieldArrayCardContainer:$o,FieldArrayItem:No,FieldArrayMultiItem:Ao,FieldAutoSuggest:Vo,FieldCheckbox:Na,FieldChecklist:xa,FieldCleave:pd,FieldDateTimePicker:Cd,FieldGoogleAddress:Sd,FieldImage:Md,FieldInput:Co,FieldKeyValuePairs:P(Ku,[["render",Ju],["__scopeId","data-v-29d15375"]]),FieldLabel:Ya,FieldMasked:Fd,FieldMetric:Fo,FieldMultiselect:Wu,FieldNoUiSlider:Dd,FieldObject:Bo,FieldObjectAdvanced:Io,FieldPikaday:Pd,FieldRadio:Oo,FieldRadios:Xa,FieldRangeSlider:Hd,FieldSelect:ko,FieldSelectEx:Zd,FieldSelectionGroup:qu,FieldSpectrum:Qd,FieldStaticMap:tc,FieldSubmit:ld,FieldTextArea:Eo,FieldUpload:fd,fieldSwitch:lc},Symbol.toStringTag,{value:"Module"})),mixins:[no],props:{vfg:{type:Object,required:!0},model:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},field:{type:Object,required:!0},errors:{type:Array,default(){return[]}}},emits:["validated","modelUpdated"],data(){return{child:i.ref()}},methods:{fieldTypeHasLabel(n){if(C.isNil(n.label))return!1;let s="";switch(n.type==="input"?s=n.inputType:s=n.type,s){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(n){const s=C.get(this.options,"fieldIdPrefix","");return ro(n,s)},getTooltipId(n){return`${this.getFieldID(n)}-tooltip`},getFieldType(n){return"field-"+n.type},getButtonType(n){return C.get(n,"type","button")},onFieldValidated(n,s,l){this.$emit("validated",n,s,l)},buttonVisibility(n){return n.buttons&&n.buttons.length>0},buttonClickHandler(n,s,l){return n.onclick.call(this,this.model,s,l,this)},fieldHint(n){return C.isFunction(n.hint)?n.hint.call(this,this.model,n,this):n.hint},fieldErrors(n){return this.errors.filter(s=>s.field.fieldName===n.fieldName).map(s=>s.error)},onModelUpdated(n,s){this.$emit("modelUpdated",n,s)},validate(n){return this.$refs.child.validate(n)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(n){return n?n.replace(/^[cC]onfig\./,""):""}}},Do=n=>(i.pushScopeId("data-v-60b9a75a"),n=n(),i.popScopeId(),n),Qu=["aria-describedby","for"],ju={class:"icon-wrapper"},ef=["innerHTML"],tf=Do(()=>i.createElementVNode("div",{class:"help",role:"button",tabindex:"0"},[i.createElementVNode("i",{class:"icon"})],-1)),nf=["innerHTML"],rf={key:0,class:"link-wrapper"},of=Do(()=>i.createElementVNode("span",{class:"section-header"},"More info",-1)),lf={class:"field-wrap"},sf={key:0,class:"buttons"},af=["type","onClick","textContent"],df=["innerHTML"],cf={key:2,class:"errors help-block"},uf=["innerHTML"];function ff(n,s,l,m,f,u){const b=i.resolveComponent("KTooltip"),g=i.resolveComponent("KExternalLink");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["form-group",n.getFieldRowClasses(l.field)])},[u.fieldTypeHasLabel(l.field)?(i.openBlock(),i.createElementBlock("label",{key:0,"aria-describedby":l.field.help?u.getTooltipId(l.field):void 0,class:i.normalizeClass(["form-group-label",l.field.labelClasses]),for:u.getFieldID(l.field)},[i.createElementVNode("div",ju,[i.createElementVNode("span",{innerHTML:u.formattedLabel(l.field.label)},null,8,ef),l.field.help?(i.openBlock(),i.createBlock(b,{key:0,"max-width":"300",placement:"top","position-fixed":!0,"tooltip-id":u.getTooltipId(l.field)},{content:i.withCtx(()=>[l.options.helpAsHtml?(i.openBlock(),i.createElementBlock("div",{key:0,innerHTML:l.field.help},null,8,nf)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(l.field.help),1)],64))]),default:i.withCtx(()=>[tf]),_:1},8,["tooltip-id"])):i.createCommentVNode("",!0)]),l.field.link?(i.openBlock(),i.createElementBlock("div",rf,[i.createVNode(g,{href:l.field.link},{default:i.withCtx(()=>[of]),_:1},8,["href"])])):i.createCommentVNode("",!0)],10,Qu)):i.createCommentVNode("",!0),i.createElementVNode("div",lf,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(l.field)),i.mergeProps(n.$attrs,{ref:"child",disabled:n.fieldDisabled(l.field)||null,"form-options":l.options,model:l.model,schema:l.field,vfg:l.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated}),null,16,["disabled","form-options","model","schema","vfg","onModelUpdated","onValidated"])),u.buttonVisibility(l.field)?(i.openBlock(),i.createElementBlock("div",sf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.field.buttons,(E,T)=>(i.openBlock(),i.createElementBlock("button",{key:T,class:i.normalizeClass(E.classes),type:u.getButtonType(E),onClick:A=>u.buttonClickHandler(E,l.field,A),textContent:i.toDisplayString(E.label)},null,10,af))),128))])):i.createCommentVNode("",!0)]),l.field.hint?(i.openBlock(),i.createElementBlock("div",{key:1,class:"hint",innerHTML:u.fieldHint(l.field)},null,8,df)):i.createCommentVNode("",!0),u.fieldErrors(l.field).length>0?(i.openBlock(),i.createElementBlock("div",cf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.fieldErrors(l.field),(E,T)=>(i.openBlock(),i.createElementBlock("span",{key:T,innerHTML:E},null,8,uf))),128))])):i.createCommentVNode("",!0)],2)}const hf={name:"FormGenerator",components:{formGroup:P(Xu,[["render",ff],["__scopeId","data-v-60b9a75a"]])},mixins:[no],props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:i.ref([]),fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:"",helpAsHtml:!1}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(n){return n.length>0}}},emits:["validated","modelUpdated"],data(){return{vfg:this,errors:[],children:i.ref([]),collapseStates:{}}},computed:{fields(){const n=[];return this.schema&&this.schema.fields&&C.forEach(this.schema.fields,s=>{(!this.multiple||s.multi===!0)&&n.push(s)}),n},groups(){const n=[];return this.schema&&this.schema.groups&&C.forEach(this.schema.groups.slice(0),s=>{n.push(s)}),n}},watch:{model:{deep:!0,handler(n,s){s!==n&&n!=null&&this.$nextTick(()=>{this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors()})}}},mounted(){this.$nextTick(()=>{this.model&&(this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors())})},methods:{fieldVisible(n){return C.isFunction(n.visible)?n.visible.call(this,this.model,n,this):C.isNil(n.visible)?!0:n.visible},onFieldValidated(n,s,l){this.errors=this.errors.filter(f=>f.field.fieldName!==l.schema.fieldName),!n&&s&&s.length>0&&C.forEach(s,f=>{this.errors.push({field:l.schema,error:f})});const m=this.errors.length===0;this.$emit("validated",m,this.errors,this)},onModelUpdated(n,s){this.$emit("modelUpdated",n,s)},validate(n=null){n===null&&(n=C.get(this.options,"validateAsync",!1)),this.clearValidationErrors();const s=[],l=[];C.forEach(this.$refs.children,f=>{C.isFunction(f.validate)&&(s.push(f.$refs.child),l.push(f.$refs.child.validate(!0)))});const m=f=>{const u=[];C.forEach(f,(g,E)=>{C.isArray(g)&&g.length>0&&C.forEach(g,T=>{u.push({field:s[E].schema,error:T})})}),this.errors=u;const b=u.length===0;return this.$emit("validated",b,u,this),n?u:b};return n?Promise.all(l).then(m):m(l)},clearValidationErrors(){this.errors.splice(0),C.forEach(this.$refs.children,n=>{n.clearValidationErrors()})}}},mf={key:0,class:"vue-form-generator"},pf={key:0};function gf(n,s,l,m,f,u){const b=i.resolveComponent("form-group"),g=i.resolveComponent("KCollapse");return l.schema!=null?(i.openBlock(),i.createElementBlock("div",mf,[l.schema.fields?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.tag),{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.fields,E=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:E.model},[u.fieldVisible(E)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",errors:f.errors,field:E,model:l.model,options:l.options,vfg:f.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):i.createCommentVNode("",!0)],64))),128))]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.groups,(E,T)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:`group-${T}`},[E.collapsible!==void 0&&E.collapsible!==!1?(i.openBlock(),i.createBlock(g,{key:0,class:"root-level-collapse","model-value":!1,title:E.collapsible.title},i.createSlots({default:i.withCtx(()=>{var A,Q,J,me;return[(A=E.slots)!=null&&A.beforeContent?i.renderSlot(n.$slots,(Q=E.slots)==null?void 0:Q.beforeContent,{key:0}):i.createCommentVNode("",!0),E.fields.length===0&&((J=E.slots)!=null&&J.emptyState)?i.renderSlot(n.$slots,(me=E.slots)==null?void 0:me.emptyState,{key:1}):(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.tag),{key:2,class:i.normalizeClass(n.getFieldRowClasses(E))},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.fields,de=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:de.model},[u.fieldVisible(de)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",errors:f.errors,field:de,model:l.model,options:l.options,vfg:f.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):i.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),E.collapsible!==!0&&E.collapsible.nestedCollapsible&&E.collapsible.nestedCollapsible.fields.length>0?(i.openBlock(),i.createBlock(g,{key:3,class:"nested-collapse","model-value":f.collapseStates[`group-${T}-nested`]??!0,"trigger-alignment":"leading","trigger-label":f.collapseStates[`group-${T}-nested`]??!0?E.collapsible.nestedCollapsible.triggerLabel.expand:E.collapsible.nestedCollapsible.triggerLabel.collapse,"onUpdate:modelValue":de=>f.collapseStates[`group-${T}-nested`]=de},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.tag),{class:i.normalizeClass(n.getFieldRowClasses(E))},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.collapsible.nestedCollapsible.fields,de=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:de.model},[u.fieldVisible(de)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",errors:f.errors,field:de,model:l.model,options:l.options,vfg:f.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):i.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))]),_:2},1032,["model-value","trigger-label","onUpdate:modelValue"])):i.createCommentVNode("",!0)]}),_:2},[E.collapsible.description?{name:"visible-content",fn:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(E.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.tag),{key:1,class:i.normalizeClass(n.getFieldRowClasses(E))},{default:i.withCtx(()=>[E.legend?(i.openBlock(),i.createElementBlock("legend",pf,i.toDisplayString(E.legend),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.fields,A=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:A.model},[u.fieldVisible(A)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",errors:f.errors,field:A,model:l.model,options:l.options,vfg:f.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onValidated"])):i.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))],64))),128))])):i.createCommentVNode("",!0)}const Ce=P(hf,[["render",gf]]),yf={fields:[{inputType:"text",label:"Config.Client Id",model:"config-client_id",type:"input"},{inputType:"text",label:"Config.Client Secret",model:"config-client_secret",type:"input"},{inputType:"text",label:"Config.Issuer",model:"config-issuer",required:!0,type:"input"},{inputType:"text",label:"Config.Auth Methods",model:"config-auth_methods",type:"input"}]},_f={fields:[{inputType:"text",label:"Config.Scopes Claim",model:"config-scopes_claim",type:"input"},{inputType:"text",label:"Config.Scopes Required",model:"config-scopes_required",type:"input"},{inputType:"text",label:"Config.Audience Claim",model:"config-audience_claim",type:"input"},{inputType:"text",label:"Config.Audience Required",model:"config-audience_required",type:"input"},{inputType:"text",label:"Config.Roles Claim",model:"config-roles_claim",type:"input"},{inputType:"text",label:"Config.Roles Required",model:"config-roles_required",type:"input"},{inputType:"text",label:"Config.Groups Claim",model:"config-groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Groups Required",model:"config-groups_required",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Authenticated Groups Claim",model:"config-authenticated_groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"}]},bf={fields:[{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Client JWK",items:{type:"object",schema:{fields:[{model:"kid",label:"kid",type:"input",inputType:"string"},{model:"issuer",label:"issuer",type:"input",inputType:"string"},{model:"kty",label:"kty",type:"input",inputType:"string"},{model:"use",label:"use",type:"input",inputType:"string"},{model:"key_ops",label:"key_ops",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"alg",label:"alg",type:"input",inputType:"string"},{model:"x5u",label:"x5u",type:"input",inputType:"string"},{model:"x5c",label:"x5c",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"x5t",label:"x5t",type:"input",inputType:"string"},{model:"x5t#S256",label:"x5t#S256",type:"input",inputType:"string"},{model:"k",label:"k",type:"input",inputType:"string"},{model:"x",label:"x",type:"input",inputType:"string"},{model:"y",label:"y",type:"input",inputType:"string"},{model:"crv",label:"crv",type:"input",inputType:"string"},{model:"n",label:"n",type:"input",inputType:"string"},{model:"e",label:"e",type:"input",inputType:"string"},{model:"d",label:"d",type:"input",inputType:"string"},{model:"p",label:"p",type:"input",inputType:"string"},{model:"q",label:"q",type:"input",inputType:"string"},{model:"dp",label:"dp",type:"input",inputType:"string"},{model:"dq",label:"dq",type:"input",inputType:"string"},{model:"qi",label:"qi",type:"input",inputType:"string"},{model:"oth",label:"oth",type:"input",inputType:"string"},{model:"r",label:"r",type:"input",inputType:"string"},{model:"t",label:"t",type:"input",inputType:"string"}]}},model:"config-client_jwk",label:"Config.Client Jwk",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#jwk-record"},{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Cluster Node",items:{type:"object",schema:{fields:[{label:"IP",model:"ip",type:"input",inputType:"text"},{label:"Port",model:"port",type:"input",inputType:"number"}]}},model:"config-session_redis_cluster_nodes",label:"Config.Session Redis Cluster Nodes",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#host-record"}]},wf={name:"OIDCForm",components:{VueFormGenerator:Ce},props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},data(){return{init:!1,authMethods:[],sessionManagement:!1,globalFields:null,commonFieldsSchema:null,authFieldsSchema:null,advancedFieldsSchema:{fields:[]},advancedFields:null,tabs:[{hash:"#common",title:"Common"},{hash:"#authorization",title:"Authorization"},{hash:"#advanced",title:"Advanced"}]}},computed:{displayForm(){return this.formModel.id&&this.isEditing||!this.isEditing}},watch:{formModel:{handler:function(){this.oidcSetup()}}},mounted(){this.oidcSetup()},methods:{oidcSetup(){var s;this.init||(this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(l=>!l.model.startsWith("config")&&l.model!=="tags")},this.commonFieldsSchema={...yf},this.authFieldsSchema={..._f},this.advancedFieldsSchema.fields=this.formSchema.fields.filter(l=>l.model.startsWith("config")&&!this.commonFieldsSchema.fields.filter(m=>m.model===l.model).length&&!this.authFieldsSchema.fields.filter(m=>m.model===l.model).length||l.model==="tags"),this.advancedFieldsSchema.fields=this.advancedFieldsSchema.fields.map(l=>{const m=bf.fields.find(f=>f.model===l.model);return m||l}),this.commonFieldsSchema.fields=this.commonFieldsSchema.fields.filter(l=>l.model!=="config-auth_methods"),this.sessionManagement=this.isEditing?this.formModel["config-auth_methods"].includes("session"):!1,this.authMethods=[{label:"Authorization Code Flow",value:"authorization_code",hint:"authorization code flow",prop:this.isEditing?this.formModel["config-auth_methods"].includes("authorization_code"):!1},{label:"Bearer Access Token",value:"bearer",hint:"JWT access token verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("bearer"):!1},{label:"Client Credentials Grant",value:"client_credentials",hint:"OAuth client credentials grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("client_credentials"):!1},{label:"Passwords Grant",value:"password",hint:"OAuth legacy password grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("password"):!1},{label:"Introspection",value:"introspection",hint:"OAuth introspection",prop:this.isEditing?this.formModel["config-auth_methods"].includes("introspection"):!1},{label:"UserInfo",value:"userinfo",hint:"OpenID Connect user info endpoint authentication",prop:this.isEditing?this.formModel["config-auth_methods"].includes("userinfo"):!1},{label:"Kong OAuth",value:"kong_oauth2",hint:"Kong OAuth plugin issued tokens verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("kong_oauth2"):!1},{label:"Refresh Token",value:"refresh_token",hint:"OAuth refresh token grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("refresh_token"):!1}]);const n={};for(const l of this.formSchema.fields)n[l.model]=l;for(const l of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const m of l.fields){const f=(s=n[m.model])==null?void 0:s.help;m.help===void 0&&typeof f=="string"&&(m.help=f)}},getAuthMethodsValue(n,s){const l=[];for(let m=0;m<this.authMethods.length;m++)this.authMethods[m].prop&&this.authMethods[m].value!==n&&l.push(this.authMethods[m].value);return this.sessionManagement&&n&&l.push("session"),s&&(n?l.push(n):l.push("session")),l},handleUpdate(n,s){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(s,n),this.onModelUpdated()}}},Ht=n=>(i.pushScopeId("data-v-e7395ff0"),n=n(),i.popScopeId(),n),Cf={class:"general-settings"},kf={class:"link-wrapper"},Ef=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)),Sf=Ht(()=>i.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),vf={class:"auth-method-container"},Bf={class:"general-settings"},Tf={class:"link-wrapper"},If=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)),Mf=Ht(()=>i.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),Nf={class:"general-settings"},Af={class:"link-wrapper"},Ff=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)),Vf=Ht(()=>i.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1));function $f(n,s,l,m,f,u){const b=i.resolveComponent("VueFormGenerator"),g=i.resolveComponent("KExternalLink"),E=i.resolveComponent("KLabel"),T=i.resolveComponent("KCheckbox"),A=i.resolveComponent("KInputSwitch"),Q=i.resolveComponent("KTabs");return i.openBlock(),i.createElementBlock("div",null,[l.formModel.id&&l.isEditing||!l.isEditing?(i.openBlock(),i.createBlock(b,{key:0,class:"global-fields",model:l.formModel,options:l.formOptions,schema:f.globalFields,onModelUpdated:l.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(Q,{tabs:f.tabs},{common:i.withCtx(()=>[i.createElementVNode("div",Cf,[i.createElementVNode("div",kf,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#important-configuration-parameters"},{default:i.withCtx(()=>[Ef]),_:1})]),Sf,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:l.formModel,options:l.formOptions,schema:f.commonFieldsSchema,onModelUpdated:l.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(E,null,{default:i.withCtx(()=>[i.createTextVNode("Auth Methods")]),_:1}),i.createElementVNode("div",vf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(f.authMethods,J=>(i.openBlock(),i.createElementBlock("div",{key:J.value,class:"auth-method"},[i.createVNode(T,{modelValue:J.prop,"onUpdate:modelValue":me=>J.prop=me,onChange:me=>u.handleUpdate(me,J.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(J.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),i.createVNode(A,{modelValue:f.sessionManagement,"onUpdate:modelValue":s[0]||(s[0]=J=>f.sessionManagement=J),label:"Enable Session Management",onChange:u.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:i.withCtx(()=>[i.createElementVNode("div",Bf,[i.createElementVNode("div",Tf,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#authorization"},{default:i.withCtx(()=>[If]),_:1})]),Mf,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:l.formModel,options:l.formOptions,schema:f.authFieldsSchema,onModelUpdated:l.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),advanced:i.withCtx(()=>[i.createElementVNode("div",Nf,[i.createElementVNode("div",Af,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/"},{default:i.withCtx(()=>[Ff]),_:1})]),Vf,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:l.formModel,options:l.formOptions,schema:f.advancedFieldsSchema,onModelUpdated:l.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),_:1},8,["tabs"])])}const Of=P(wf,[["render",$f],["__scopeId","data-v-e7395ff0"]]),Lo={general:{packageName:"forms"},"post-function":{tags:{hint:"e.g. tag1, tag2, tag3",newElementButtonLabel:"+ Add"},enabled:{newElementButtonLabel:"+ Add"},selectionGroup:{newElementButtonLabel:"+ Add"},instance_name:{newElementButtonLabel:"+ Add"},name:{newElementButtonLabel:"+ Add"},"config-certificate":{help:"Array of stringified Lua code to be cached and run in sequence during the certificate phase.",newElementButtonLabel:"+ Add"},"config-access":{help:"Array of stringified Lua code to be cached and run in sequence during the access phase.",newElementButtonLabel:"+ Add"},"config-body_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the body_filter phase.",newElementButtonLabel:"+ Add"},"config-header_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the header_filter phase.",newElementButtonLabel:"+ Add"},"config-functions":{newElementButtonLabel:"+ Add"},"config-log":{newElementButtonLabel:"+ Add"},"config-rewrite":{newElementButtonLabel:"+ Add"},"config-ws_client_frame":{newElementButtonLabel:"+ Add"},"config-ws_close":{newElementButtonLabel:"+ Add"},"config-ws_handshake":{newElementButtonLabel:"+ Add"},"config-ws_upstream_frame":{newElementButtonLabel:"+ Add"}},"exit-transformer":{"config-functions":{newElementButtonLabel:"+ Add"}}},Df=P(i.defineComponent({__name:"PostFunction",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const{t:s,te:l}=to.createI18n("en-us",Lo),m=n,f=i.computed(()=>m.formModel.id&&m.isEditing||!m.isEditing),u=i.computed(()=>{const b=m.formSchema;return b.fields.map(g=>{const E=`post-function.${g.model}`;return g.hint=l(`${E}.hint`)&&s(`${E}.hint`)||g.hint,g.help=l(`${E}.help`)&&s(`${E}.help`)||g.help,g.newElementButtonLabel=l(`${E}.newElementButtonLabel`)&&s(`${E}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="post-function-array-item-container",g.fieldItemsClasses="post-function-array-item",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>f.value?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)}}),[["__scopeId","data-v-6706c68b"]]),Lf=P(i.defineComponent({__name:"ExitTransformer",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const{t:s,te:l}=to.createI18n("en-us",Lo),m=n,f=i.computed(()=>m.formModel.id&&m.isEditing||!m.isEditing),u=i.computed(()=>{const b=m.formSchema;return b.fields.map(g=>{const E=`exit-transformer.${g.model}`;return g.hint=l(`${E}.hint`)&&s(`${E}.hint`)||g.hint,g.help=l(`${E}.help`)&&s(`${E}.help`)||g.help,g.newElementButtonLabel=l(`${E}.newElementButtonLabel`)&&s(`${E}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="exit-transformer-array-item-container",g.fieldItemsClasses="exit-transformer-array-item",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>f.value?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)}}),[["__scopeId","data-v-0fc8ef29"]]),Uf={fields:[{inputType:"text",label:"Config.Account Email",model:"config-account_email",required:!0,type:"input"},{inputType:"text",label:"Config.Account Key.Key Id",model:"config-account_key-key_id",required:!0,type:"input"},{type:"input",inputType:"text",valueType:"string",label:"Config.Account Key.Key Set",model:"config-account_key-key_set",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",label:"Config.Allow Any Domain",model:"config-allow_any_domain",order:0,disabled:!1}]},Rf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",model:"config-tos_accepted",label:"Config.Tos Accepted",order:0,disabled:!1}]},xf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_hmac_key",label:"Config.Eab Hmac Key",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_kid",label:"Config.Eab Kid",order:0,disabled:!1}]},Vt=n=>(i.pushScopeId("data-v-5b189366"),n=n(),i.popScopeId(),n),Pf={class:"general-settings"},qf=Vt(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),zf=Vt(()=>i.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),Hf=Vt(()=>i.createElementVNode("hr",null,null,-1)),Wf={class:"sub-form"},Kf={class:"general-settings"},Yf=Vt(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),Gf=Vt(()=>i.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),Zf={class:"sub-form"},Jf={class:"general-settings"},Xf=Vt(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),Qf=Vt(()=>i.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),jf=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:P(i.defineComponent({__name:"ACMEForm",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const s=n,l=i.ref("zeroSsl"),m=i.ref("shm"),f=i.computed(()=>{var L;const F={};if((L=s.formSchema)!=null&&L.fields)for(const G of s.formSchema.fields)F[G.model]=G;return F}),u=i.computed(()=>{var L;const F=C.cloneDeep(Uf);for(const G of F.fields){const ue=(L=f.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ue=="string"&&(G.help=ue)}return F}),b=i.computed(()=>{var L;const F=C.cloneDeep(Rf);for(const G of F.fields){const ue=(L=f.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ue=="string"&&(G.help=ue)}return F}),g=i.computed(()=>{var L;const F=C.cloneDeep(xf);for(const G of F.fields){const ue=(L=f.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ue=="string"&&(G.help=ue)}return F}),E=i.computed(()=>({fields:s.formSchema.fields.filter(F=>!F.model.startsWith("config")&&F.model!=="tags")})),T=i.computed(()=>({fields:u.value.fields.filter(L=>!b.value.fields.some(G=>G.model===L.model)&&!g.value.fields.some(G=>G.model===L.model))})),A=i.computed(()=>({fields:s.formSchema.fields.filter(L=>L.model.startsWith("config-storage")&&!L.model.startsWith("config-storage_config-consul")&&!L.model.startsWith("config-storage_config-redis")&&!L.model.startsWith("config-storage_config-shm")&&!L.model.startsWith("config-storage_config-vault"))})),Q=i.computed(()=>({fields:s.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-consul"))})),J=i.computed(()=>({fields:s.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-redis"))})),me=i.computed(()=>({fields:s.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-shm"))})),de=i.computed(()=>({fields:s.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-vault"))})),lt=i.computed(()=>({fields:s.formSchema.fields.filter(F=>F.model.startsWith("config")&&!T.value.fields.filter(L=>L.model===F.model).length&&!A.value.fields.filter(L=>L.model===F.model).length||F.model==="tags")})),ce=i.computed(()=>s.formModel.id&&s.isEditing||!s.isEditing),Te=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],st=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];i.onMounted(()=>{l.value==="zeroSsl"&&(s.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const Ie=F=>{l.value=F.value,(F.value==="zeroSsl"||F.value==="other")&&(F.value==="zeroSsl"?s.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":s.formModel["config-api_uri"]="https://acme.example.com/",s.formModel["config-tos_accepted"]=!1),F.value==="letsEncrypt"&&(s.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",s.formModel["config-eab_hmac_key"]="",s.formModel["config-eab_kid"]=""),s.onModelUpdated()},Me=(F,L)=>{L==="config-storage"&&(m.value=F),s.onModelUpdated()};return(F,L)=>{const G=i.resolveComponent("KSelect"),ue=i.resolveComponent("KTabs");return i.openBlock(),i.createElementBlock("div",null,[n.formModel.id&&n.isEditing||!n.isEditing?(i.openBlock(),i.createBlock(Ce,{key:0,class:"global-fields",model:n.formModel,options:n.formOptions,schema:E.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(ue,{tabs:Te},{general:i.withCtx(()=>[i.createElementVNode("div",Pf,[qf,zf,ce.value?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:T.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),Hf,i.createVNode(G,{class:"issuer-select",items:st,label:"Issuer",onChange:Ie}),i.createElementVNode("div",Wf,[l.value==="letsEncrypt"?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:b.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),l.value==="zeroSsl"||l.value==="other"?(i.openBlock(),i.createBlock(Ce,{key:1,model:n.formModel,options:n.formOptions,schema:g.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])])]),storage:i.withCtx(()=>[i.createElementVNode("div",Kf,[Yf,Gf,ce.value?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:A.value,onModelUpdated:Me},null,8,["model","options","schema"])):i.createCommentVNode("",!0),i.createElementVNode("div",Zf,[m.value==="consul"?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:Q.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="redis"?(i.openBlock(),i.createBlock(Ce,{key:1,model:n.formModel,options:n.formOptions,schema:J.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="shm"?(i.openBlock(),i.createBlock(Ce,{key:2,model:n.formModel,options:n.formOptions,schema:me.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="vault"?(i.openBlock(),i.createBlock(Ce,{key:3,model:n.formModel,options:n.formOptions,schema:de.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])])]),advanced:i.withCtx(()=>[i.createElementVNode("div",Jf,[Xf,Qf,ce.value?(i.openBlock(),i.createBlock(Ce,{key:0,model:n.formModel,options:n.formOptions,schema:lt.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-5b189366"]]),ExitTransformer:Lf,OIDCForm:Of,PostFunction:Df},Symbol.toStringTag,{value:"Module"})),eh=["array","metric","advanced","selectionGroup","object-advanced"],th={install:n=>{n.component("VueFormGenerator",Ce)}},nh=(n,s=!1)=>({...s&&{acme:"ACMEForm"},"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer"})[n];ve.FORMS_API_KEY=wt,ve.VueFormGenerator=Ce,ve.abstractField=Ba,ve.customFields=eh,ve.default=th,ve.getSharedFormName=nh,ve.sharedForms=jf,Object.defineProperties(ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/forms",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/forms.umd.js",
|
|
6
6
|
"module": "./dist/forms.es.js",
|
|
@@ -32,21 +32,21 @@
|
|
|
32
32
|
"extends": "../../../package.json"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@kong/icons": "^1.8.
|
|
35
|
+
"@kong/icons": "^1.8.16",
|
|
36
36
|
"fecha": "^4.2.3",
|
|
37
37
|
"lodash": "^4.17.21"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@kong/kongponents": "9.0.0-alpha.124",
|
|
41
41
|
"vue": "^3.4.21",
|
|
42
|
-
"@kong-ui-public/i18n": "^2.1.
|
|
42
|
+
"@kong-ui-public/i18n": "^2.1.5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@kong/design-tokens": "1.12.
|
|
45
|
+
"@kong/design-tokens": "1.12.11",
|
|
46
46
|
"@kong/kongponents": "9.0.0-alpha.124",
|
|
47
47
|
"@types/lodash": "^4.14.202",
|
|
48
48
|
"pug": "^3.0.2",
|
|
49
|
-
"@kong-ui-public/i18n": "^2.1.
|
|
49
|
+
"@kong-ui-public/i18n": "^2.1.5"
|
|
50
50
|
},
|
|
51
51
|
"distSizeChecker": {
|
|
52
52
|
"errorLimit": "1.2MB"
|