toku-form-extensions 0.1.0 → 0.1.1

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/index.umd.js CHANGED
@@ -217,5 +217,5 @@ ${l.line} | ${m}
217
217
  ${h} | ${Lo("",s.column-1," ")}${Lo("",b,"^")}`}else t+=`
218
218
  at ${c}`}return t},Bi.buildMessage=function(e,t){const n={literal(m){return`"${s(m.text)}"`},class(m){const v=m.parts.map(function(b){return Array.isArray(b)?`${l(b[0])}-${l(b[1])}`:l(b)});return`[${m.inverted?"^":""}${v.join("")}]`},any(){return"any character"},end(){return"end of input"},other(m){return m.description}};function i(m){return m.charCodeAt(0).toString(16).toUpperCase()}function s(m){return m.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return`\\x0${i(v)}`}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return`\\x${i(v)}`})}function l(m){return m.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return`\\x0${i(v)}`}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return`\\x${i(v)}`})}function c(m){return n[m.type](m)}function f(m){const v=m.map(c);let b,x;if(v.sort(),v.length>0){for(b=1,x=1;b<v.length;b++)v[b-1]!==v[b]&&(v[x]=v[b],x++);v.length=x}switch(v.length){case 1:return v[0];case 2:return`${v[0]} or ${v[1]}`;default:return`${v.slice(0,-1).join(", ")}, or ${v[v.length-1]}`}}function h(m){return m?`"${s(m)}"`:"end of input"}return`Expected ${f(e)} but ${h(t)} found.`};function h1(e,t){t=t!==void 0?t:{};const n={},i=t.grammarSource,s={Expression:Je};let l=Je;const c="+",f="-",h="*",m="/",v="(",b=")",x=",",H="VAR(",Y=".",E=/^[a-zA-Z]/,ee=/^[a-zA-Z_]/,G=/^[0-9]/,se=/^[ \t\n\r]/,X=Ye("+",!1),xe=Ye("-",!1),ye=Ye("*",!1),j=Ye("/",!1),N=Ye("(",!1),de=Ye(")",!1),De=on([["a","z"],["A","Z"]],!1,!1),Ae=Ye(",",!1),bi=Ye("VAR(",!1),ni=on([["a","z"],["A","Z"],"_"],!1,!1),yi=zn("integer"),an=on([["0","9"]],!1,!1),$r=zn("decimal"),kr=Ye(".",!1),jt=zn("whitespace"),yt=on([" "," ",`
219
219
  `,"\r"],!1,!1),Le=function(D,O){return O.reduce(function(L,z){if(z[1]==="+")return L+z[3];if(z[1]==="-")return L-z[3]},D)},Bn=function(D,O){return O.reduce(function(L,z){if(z[1]==="*")return L*z[3];if(z[1]==="/")return L/z[3]},D)},Se=function(D){return D},Li=function(D,O){const L=D.join("");if(L==="ROUND")return jn(O[0],O[1]);if(L==="POWER")return Hn(O[0],O[1]);throw new Error(`Function ${L} is not defined`)},Oe=function(D,O){return[D].concat(O.map(L=>L[3]))},Nn=function(D){if(Mt.hasOwnProperty(D.join("")))return Mt[D.join("")];throw new Error(`Variable ${D.join("")} is not defined`)},Ht=function(){return parseInt(je(),10)},Ln=function(){return parseFloat(je())};let T=0,Qe=0;const Pt=[{line:1,column:1}];let qe=0,lt=[],oe=0,sn;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "${t.startRule}".`);l=s[t.startRule]}function je(){return e.substring(Qe,T)}function Ye(D,O){return{type:"literal",text:D,ignoreCase:O}}function on(D,O,L){return{type:"class",parts:D,inverted:O,ignoreCase:L}}function wt(){return{type:"end"}}function zn(D){return{type:"other",description:D}}function zi(D){let O=Pt[D],L;if(O)return O;for(L=D-1;!Pt[L];)L--;for(O=Pt[L],O={line:O.line,column:O.column};L<D;)e.charCodeAt(L)===10?(O.line++,O.column=1):O.column++,L++;return Pt[D]=O,O}function Vt(D,O,L){const z=zi(D),q=zi(O),te={source:i,start:{offset:D,line:z.line,column:z.column},end:{offset:O,line:q.line,column:q.column}};return L&&i&&typeof i.offset=="function"&&(te.start=i.offset(te.start),te.end=i.offset(te.end)),te}function ne(D){T<qe||(T>qe&&(qe=T,lt=[]),lt.push(D))}function $t(D,O,L){return new Bi(Bi.buildMessage(D,O),D,O,L)}function Je(){let D,O,L,z,q,te,Ke,Ie;if(D=T,O=ii(),O!==n){for(L=[],z=T,q=we(),e.charCodeAt(T)===43?(te=c,T++):(te=n,oe===0&&ne(X)),te===n&&(e.charCodeAt(T)===45?(te=f,T++):(te=n,oe===0&&ne(xe))),te!==n?(Ke=we(),Ie=ii(),Ie!==n?(q=[q,te,Ke,Ie],z=q):(T=z,z=n)):(T=z,z=n);z!==n;)L.push(z),z=T,q=we(),e.charCodeAt(T)===43?(te=c,T++):(te=n,oe===0&&ne(X)),te===n&&(e.charCodeAt(T)===45?(te=f,T++):(te=n,oe===0&&ne(xe))),te!==n?(Ke=we(),Ie=ii(),Ie!==n?(q=[q,te,Ke,Ie],z=q):(T=z,z=n)):(T=z,z=n);Qe=D,D=Le(O,L)}else T=D,D=n;return D}function ii(){let D,O,L,z,q,te,Ke,Ie;if(D=T,O=Wt(),O!==n){for(L=[],z=T,q=we(),e.charCodeAt(T)===42?(te=h,T++):(te=n,oe===0&&ne(ye)),te===n&&(e.charCodeAt(T)===47?(te=m,T++):(te=n,oe===0&&ne(j))),te!==n?(Ke=we(),Ie=Wt(),Ie!==n?(q=[q,te,Ke,Ie],z=q):(T=z,z=n)):(T=z,z=n);z!==n;)L.push(z),z=T,q=we(),e.charCodeAt(T)===42?(te=h,T++):(te=n,oe===0&&ne(ye)),te===n&&(e.charCodeAt(T)===47?(te=m,T++):(te=n,oe===0&&ne(j))),te!==n?(Ke=we(),Ie=Wt(),Ie!==n?(q=[q,te,Ke,Ie],z=q):(T=z,z=n)):(T=z,z=n);Qe=D,D=Bn(O,L)}else T=D,D=n;return D}function Wt(){let D,O,L,z;return D=T,e.charCodeAt(T)===40?(O=v,T++):(O=n,oe===0&&ne(N)),O!==n?(we(),L=Je(),L!==n?(we(),e.charCodeAt(T)===41?(z=b,T++):(z=n,oe===0&&ne(de)),z!==n?(Qe=D,D=Se(L)):(T=D,D=n)):(T=D,D=n)):(T=D,D=n),D===n&&(D=un(),D===n&&(D=kn(),D===n&&(D=$n(),D===n&&(D=ji())))),D}function ji(){let D,O,L,z,q;if(D=T,O=[],E.test(e.charAt(T))?(L=e.charAt(T),T++):(L=n,oe===0&&ne(De)),L!==n)for(;L!==n;)O.push(L),E.test(e.charAt(T))?(L=e.charAt(T),T++):(L=n,oe===0&&ne(De));else O=n;return O!==n?(e.charCodeAt(T)===40?(L=v,T++):(L=n,oe===0&&ne(N)),L!==n?(we(),z=ln(),z===n&&(z=null),we(),e.charCodeAt(T)===41?(q=b,T++):(q=n,oe===0&&ne(de)),q!==n?(Qe=D,D=Li(O,z)):(T=D,D=n)):(T=D,D=n)):(T=D,D=n),D}function ln(){let D,O,L,z,q,te,Ke,Ie;if(D=T,O=Je(),O!==n){for(L=[],z=T,q=we(),e.charCodeAt(T)===44?(te=x,T++):(te=n,oe===0&&ne(Ae)),te!==n?(Ke=we(),Ie=Je(),Ie!==n?(q=[q,te,Ke,Ie],z=q):(T=z,z=n)):(T=z,z=n);z!==n;)L.push(z),z=T,q=we(),e.charCodeAt(T)===44?(te=x,T++):(te=n,oe===0&&ne(Ae)),te!==n?(Ke=we(),Ie=Je(),Ie!==n?(q=[q,te,Ke,Ie],z=q):(T=z,z=n)):(T=z,z=n);Qe=D,D=Oe(O,L)}else T=D,D=n;return D}function un(){let D,O,L,z;if(D=T,e.substr(T,4)===H?(O=H,T+=4):(O=n,oe===0&&ne(bi)),O!==n){if(L=[],ee.test(e.charAt(T))?(z=e.charAt(T),T++):(z=n,oe===0&&ne(ni)),z!==n)for(;z!==n;)L.push(z),ee.test(e.charAt(T))?(z=e.charAt(T),T++):(z=n,oe===0&&ne(ni));else L=n;L!==n?(e.charCodeAt(T)===41?(z=b,T++):(z=n,oe===0&&ne(de)),z!==n?(Qe=D,D=Nn(L)):(T=D,D=n)):(T=D,D=n)}else T=D,D=n;return D}function $n(){let D,O,L;if(oe++,D=T,we(),O=[],G.test(e.charAt(T))?(L=e.charAt(T),T++):(L=n,oe===0&&ne(an)),L!==n)for(;L!==n;)O.push(L),G.test(e.charAt(T))?(L=e.charAt(T),T++):(L=n,oe===0&&ne(an));else O=n;return O!==n?(Qe=D,D=Ht()):(T=D,D=n),oe--,D===n&&oe===0&&ne(yi),D}function kn(){let D,O,L,z,q;if(oe++,D=T,we(),O=[],G.test(e.charAt(T))?(L=e.charAt(T),T++):(L=n,oe===0&&ne(an)),L!==n)for(;L!==n;)O.push(L),G.test(e.charAt(T))?(L=e.charAt(T),T++):(L=n,oe===0&&ne(an));else O=n;if(O!==n)if(e.charCodeAt(T)===46?(L=Y,T++):(L=n,oe===0&&ne(kr)),L!==n){if(z=[],G.test(e.charAt(T))?(q=e.charAt(T),T++):(q=n,oe===0&&ne(an)),q!==n)for(;q!==n;)z.push(q),G.test(e.charAt(T))?(q=e.charAt(T),T++):(q=n,oe===0&&ne(an));else z=n;z!==n?(Qe=D,D=Ln()):(T=D,D=n)}else T=D,D=n;else T=D,D=n;return oe--,D===n&&oe===0&&ne($r),D}function we(){let D,O;for(oe++,D=[],se.test(e.charAt(T))?(O=e.charAt(T),T++):(O=n,oe===0&&ne(yt));O!==n;)D.push(O),se.test(e.charAt(T))?(O=e.charAt(T),T++):(O=n,oe===0&&ne(yt));return oe--,O=n,oe===0&&ne(jt),D}const Mt=t.variables||{};function jn(D,O){const L=Math.pow(10,O);return Math.round(D*L)/L}function Hn(D,O){return Math.pow(D,O)}if(sn=l(),sn!==n&&T===e.length)return sn;throw sn!==n&&T<e.length&&ne(wt()),$t(lt,qe<e.length?e.charAt(qe):null,qe<e.length?Vt(qe,qe+1):Vt(qe,qe))}const p1=h1;function tf(e,t){try{return p1(e,{variables:t})}catch{return e}}function nf(e){if(e)S.provide("fields",e);else if(e=S.inject("fields"),!e)throw new Error("Fields were not provided");const t=n=>{if(n.relatedField){const i=e==null?void 0:e.value.find(({name:s,value:l})=>n.relatedField===s&&n.relatedFieldValue===l);return i?t(i):!1}return!0};return{shouldShowField:t}}function zo(e){return typeof e=="string"?e.replace(/^0+|[^0-9kK]+/g,"").toUpperCase():""}function _1(e){if(typeof e!="string"||!/^0*(\d{1,3}(\.?\d{3})*)-?([\dkK])$/.test(e))return!1;e=zo(e);for(var t=parseInt(e.slice(0,-1),10),n=0,i=1;t>0;)i=(i+t%10*(9-n++%6))%11,t=Math.floor(t/10);var s=i>0?""+(i-1):"K";return s===e.slice(-1)}function m1(e){e=zo(e);for(var t=e.slice(-4,-1)+"-"+e.substr(e.length-1),n=4;n<e.length;n+=3)t=e.slice(-3-n,-n)+"."+t;return t}var v1={validate:_1,clean:zo,format:m1};const g1={CL:{governmentIdCleaner:v1.clean},MX:{}};function b1(){return{cleanGovernmentId:(t,n)=>{if(t&&n){const i=g1[n].governmentIdCleaner;return i?i(t):t}return t}}}const y1=e=>typeof e=="string",w1=e=>e instanceof Date,rf=e=>`0${e}`.slice(-2),$1=e=>`${e.getFullYear()}-${rf(e.getMonth()+1)}-${rf(e.getDate())}`;/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:af,setPrototypeOf:sf,isFrozen:k1,getPrototypeOf:S1,getOwnPropertyDescriptor:of}=Object;let{freeze:ht,seal:rn,create:lf}=Object,{apply:jo,construct:Ho}=typeof Reflect<"u"&&Reflect;ht||(ht=function(t){return t}),rn||(rn=function(t){return t}),jo||(jo=function(t,n,i){return t.apply(n,i)}),Ho||(Ho=function(t,n){return new t(...n)});const Ia=zt(Array.prototype.forEach),uf=zt(Array.prototype.pop),br=zt(Array.prototype.push),Ea=zt(String.prototype.toLowerCase),Vo=zt(String.prototype.toString),C1=zt(String.prototype.match),yr=zt(String.prototype.replace),x1=zt(String.prototype.indexOf),D1=zt(String.prototype.trim),Tt=zt(RegExp.prototype.test),wr=A1(TypeError);function zt(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return jo(e,t,i)}}function A1(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Ho(e,n)}}function he(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ea;sf&&sf(e,null);let i=t.length;for(;i--;){let s=t[i];if(typeof s=="string"){const l=n(s);l!==s&&(k1(t)||(t[i]=l),s=l)}e[s]=!0}return e}function Ni(e){const t=lf(null);for(const[n,i]of af(e))of(e,n)!==void 0&&(t[n]=i);return t}function Oa(e,t){for(;e!==null;){const i=of(e,t);if(i){if(i.get)return zt(i.get);if(typeof i.value=="function")return zt(i.value)}e=S1(e)}function n(i){return console.warn("fallback value for",i),null}return n}const cf=ht(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wo=ht(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Uo=ht(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),T1=ht(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Yo=ht(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P1=ht(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),df=ht(["#text"]),ff=ht(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),qo=ht(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hf=ht(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ra=ht(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),M1=rn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),F1=rn(/<%[\w\W]*|[\w\W]*%>/gm),I1=rn(/\${[\w\W]*}/gm),E1=rn(/^data-[\-\w.\u00B7-\uFFFF]/),O1=rn(/^aria-[\-\w]+$/),pf=rn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),R1=rn(/^(?:\w+script|data):/i),B1=rn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_f=rn(/^html$/i);var mf=Object.freeze({__proto__:null,MUSTACHE_EXPR:M1,ERB_EXPR:F1,TMPLIT_EXPR:I1,DATA_ATTR:E1,ARIA_ATTR:O1,IS_ALLOWED_URI:pf,IS_SCRIPT_OR_DATA:R1,ATTR_WHITESPACE:B1,DOCTYPE_NAME:_f});const N1=function(){return typeof window>"u"?null:window},L1=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(i=n.getAttribute(s));const l="dompurify"+(i?"#"+i:"");try{return t.createPolicy(l,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}};function vf(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N1();const t=Q=>vf(Q);if(t.version="3.0.6",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let{document:n}=e;const i=n,s=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:f,Element:h,NodeFilter:m,NamedNodeMap:v=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:b,DOMParser:x,trustedTypes:H}=e,Y=h.prototype,E=Oa(Y,"cloneNode"),ee=Oa(Y,"nextSibling"),G=Oa(Y,"childNodes"),se=Oa(Y,"parentNode");if(typeof c=="function"){const Q=n.createElement("template");Q.content&&Q.content.ownerDocument&&(n=Q.content.ownerDocument)}let X,xe="";const{implementation:ye,createNodeIterator:j,createDocumentFragment:N,getElementsByTagName:de}=n,{importNode:De}=i;let Ae={};t.isSupported=typeof af=="function"&&typeof se=="function"&&ye&&ye.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:bi,ERB_EXPR:ni,TMPLIT_EXPR:yi,DATA_ATTR:an,ARIA_ATTR:$r,IS_SCRIPT_OR_DATA:kr,ATTR_WHITESPACE:jt}=mf;let{IS_ALLOWED_URI:yt}=mf,Le=null;const Bn=he({},[...cf,...Wo,...Uo,...Yo,...df]);let Se=null;const Li=he({},[...ff,...qo,...hf,...Ra]);let Oe=Object.seal(lf(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Nn=null,Ht=null,Ln=!0,T=!0,Qe=!1,Pt=!0,qe=!1,lt=!1,oe=!1,sn=!1,je=!1,Ye=!1,on=!1,wt=!0,zn=!1;const zi="user-content-";let Vt=!0,ne=!1,$t={},Je=null;const ii=he({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Wt=null;const ji=he({},["audio","video","img","source","image","track"]);let ln=null;const un=he({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$n="http://www.w3.org/1998/Math/MathML",kn="http://www.w3.org/2000/svg",we="http://www.w3.org/1999/xhtml";let Mt=we,jn=!1,Hn=null;const D=he({},[$n,kn,we],Vo);let O=null;const L=["application/xhtml+xml","text/html"],z="text/html";let q=null,te=null;const Ke=n.createElement("form"),Ie=function($){return $ instanceof RegExp||$ instanceof Function},Sr=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(te&&te===$)){if((!$||typeof $!="object")&&($={}),$=Ni($),O=L.indexOf($.PARSER_MEDIA_TYPE)===-1?O=z:O=$.PARSER_MEDIA_TYPE,q=O==="application/xhtml+xml"?Vo:Ea,Le="ALLOWED_TAGS"in $?he({},$.ALLOWED_TAGS,q):Bn,Se="ALLOWED_ATTR"in $?he({},$.ALLOWED_ATTR,q):Li,Hn="ALLOWED_NAMESPACES"in $?he({},$.ALLOWED_NAMESPACES,Vo):D,ln="ADD_URI_SAFE_ATTR"in $?he(Ni(un),$.ADD_URI_SAFE_ATTR,q):un,Wt="ADD_DATA_URI_TAGS"in $?he(Ni(ji),$.ADD_DATA_URI_TAGS,q):ji,Je="FORBID_CONTENTS"in $?he({},$.FORBID_CONTENTS,q):ii,Nn="FORBID_TAGS"in $?he({},$.FORBID_TAGS,q):{},Ht="FORBID_ATTR"in $?he({},$.FORBID_ATTR,q):{},$t="USE_PROFILES"in $?$.USE_PROFILES:!1,Ln=$.ALLOW_ARIA_ATTR!==!1,T=$.ALLOW_DATA_ATTR!==!1,Qe=$.ALLOW_UNKNOWN_PROTOCOLS||!1,Pt=$.ALLOW_SELF_CLOSE_IN_ATTR!==!1,qe=$.SAFE_FOR_TEMPLATES||!1,lt=$.WHOLE_DOCUMENT||!1,je=$.RETURN_DOM||!1,Ye=$.RETURN_DOM_FRAGMENT||!1,on=$.RETURN_TRUSTED_TYPE||!1,sn=$.FORCE_BODY||!1,wt=$.SANITIZE_DOM!==!1,zn=$.SANITIZE_NAMED_PROPS||!1,Vt=$.KEEP_CONTENT!==!1,ne=$.IN_PLACE||!1,yt=$.ALLOWED_URI_REGEXP||pf,Mt=$.NAMESPACE||we,Oe=$.CUSTOM_ELEMENT_HANDLING||{},$.CUSTOM_ELEMENT_HANDLING&&Ie($.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Oe.tagNameCheck=$.CUSTOM_ELEMENT_HANDLING.tagNameCheck),$.CUSTOM_ELEMENT_HANDLING&&Ie($.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Oe.attributeNameCheck=$.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),$.CUSTOM_ELEMENT_HANDLING&&typeof $.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Oe.allowCustomizedBuiltInElements=$.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),qe&&(T=!1),Ye&&(je=!0),$t&&(Le=he({},[...df]),Se=[],$t.html===!0&&(he(Le,cf),he(Se,ff)),$t.svg===!0&&(he(Le,Wo),he(Se,qo),he(Se,Ra)),$t.svgFilters===!0&&(he(Le,Uo),he(Se,qo),he(Se,Ra)),$t.mathMl===!0&&(he(Le,Yo),he(Se,hf),he(Se,Ra))),$.ADD_TAGS&&(Le===Bn&&(Le=Ni(Le)),he(Le,$.ADD_TAGS,q)),$.ADD_ATTR&&(Se===Li&&(Se=Ni(Se)),he(Se,$.ADD_ATTR,q)),$.ADD_URI_SAFE_ATTR&&he(ln,$.ADD_URI_SAFE_ATTR,q),$.FORBID_CONTENTS&&(Je===ii&&(Je=Ni(Je)),he(Je,$.FORBID_CONTENTS,q)),Vt&&(Le["#text"]=!0),lt&&he(Le,["html","head","body"]),Le.table&&(he(Le,["tbody"]),delete Nn.tbody),$.TRUSTED_TYPES_POLICY){if(typeof $.TRUSTED_TYPES_POLICY.createHTML!="function")throw wr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof $.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');X=$.TRUSTED_TYPES_POLICY,xe=X.createHTML("")}else X===void 0&&(X=L1(H,s)),X!==null&&typeof xe=="string"&&(xe=X.createHTML(""));ht&&ht($),te=$}},Na=he({},["mi","mo","mn","ms","mtext"]),La=he({},["foreignobject","desc","title","annotation-xml"]),Ko=he({},["title","style","font","a","script"]),wi=he({},Wo);he(wi,Uo),he(wi,T1);const Cr=he({},Yo);he(Cr,P1);const Xo=function($){let R=se($);(!R||!R.tagName)&&(R={namespaceURI:Mt,tagName:"template"});const K=Ea($.tagName),Me=Ea(R.tagName);return Hn[$.namespaceURI]?$.namespaceURI===kn?R.namespaceURI===we?K==="svg":R.namespaceURI===$n?K==="svg"&&(Me==="annotation-xml"||Na[Me]):!!wi[K]:$.namespaceURI===$n?R.namespaceURI===we?K==="math":R.namespaceURI===kn?K==="math"&&La[Me]:!!Cr[K]:$.namespaceURI===we?R.namespaceURI===kn&&!La[Me]||R.namespaceURI===$n&&!Na[Me]?!1:!Cr[K]&&(Ko[K]||!wi[K]):!!(O==="application/xhtml+xml"&&Hn[$.namespaceURI]):!1},Vn=function($){br(t.removed,{element:$});try{$.parentNode.removeChild($)}catch{$.remove()}},$i=function($,R){try{br(t.removed,{attribute:R.getAttributeNode($),from:R})}catch{br(t.removed,{attribute:null,from:R})}if(R.removeAttribute($),$==="is"&&!Se[$])if(je||Ye)try{Vn(R)}catch{}else try{R.setAttribute($,"")}catch{}},za=function($){let R=null,K=null;if(sn)$="<remove></remove>"+$;else{const tt=C1($,/^[\r\n\t ]+/);K=tt&&tt[0]}O==="application/xhtml+xml"&&Mt===we&&($='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+$+"</body></html>");const Me=X?X.createHTML($):$;if(Mt===we)try{R=new x().parseFromString(Me,O)}catch{}if(!R||!R.documentElement){R=ye.createDocument(Mt,"template",null);try{R.documentElement.innerHTML=jn?xe:Me}catch{}}const et=R.body||R.documentElement;return $&&K&&et.insertBefore(n.createTextNode(K),et.childNodes[0]||null),Mt===we?de.call(R,lt?"html":"body")[0]:lt?R.documentElement:et},Hi=function($){return j.call($.ownerDocument||$,$,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT,null)},Go=function($){return $ instanceof b&&(typeof $.nodeName!="string"||typeof $.textContent!="string"||typeof $.removeChild!="function"||!($.attributes instanceof v)||typeof $.removeAttribute!="function"||typeof $.setAttribute!="function"||typeof $.namespaceURI!="string"||typeof $.insertBefore!="function"||typeof $.hasChildNodes!="function")},ja=function($){return typeof f=="function"&&$ instanceof f},cn=function($,R,K){Ae[$]&&Ia(Ae[$],Me=>{Me.call(t,R,K,te)})},Ha=function($){let R=null;if(cn("beforeSanitizeElements",$,null),Go($))return Vn($),!0;const K=q($.nodeName);if(cn("uponSanitizeElement",$,{tagName:K,allowedTags:Le}),$.hasChildNodes()&&!ja($.firstElementChild)&&Tt(/<[/\w]/g,$.innerHTML)&&Tt(/<[/\w]/g,$.textContent))return Vn($),!0;if(!Le[K]||Nn[K]){if(!Nn[K]&&Wa(K)&&(Oe.tagNameCheck instanceof RegExp&&Tt(Oe.tagNameCheck,K)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(K)))return!1;if(Vt&&!Je[K]){const Me=se($)||$.parentNode,et=G($)||$.childNodes;if(et&&Me){const tt=et.length;for(let Xe=tt-1;Xe>=0;--Xe)Me.insertBefore(E(et[Xe],!0),ee($))}}return Vn($),!0}return $ instanceof h&&!Xo($)||(K==="noscript"||K==="noembed"||K==="noframes")&&Tt(/<\/no(script|embed|frames)/i,$.innerHTML)?(Vn($),!0):(qe&&$.nodeType===3&&(R=$.textContent,Ia([bi,ni,yi],Me=>{R=yr(R,Me," ")}),$.textContent!==R&&(br(t.removed,{element:$.cloneNode()}),$.textContent=R)),cn("afterSanitizeElements",$,null),!1)},Va=function($,R,K){if(wt&&(R==="id"||R==="name")&&(K in n||K in Ke))return!1;if(!(T&&!Ht[R]&&Tt(an,R))){if(!(Ln&&Tt($r,R))){if(!Se[R]||Ht[R]){if(!(Wa($)&&(Oe.tagNameCheck instanceof RegExp&&Tt(Oe.tagNameCheck,$)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck($))&&(Oe.attributeNameCheck instanceof RegExp&&Tt(Oe.attributeNameCheck,R)||Oe.attributeNameCheck instanceof Function&&Oe.attributeNameCheck(R))||R==="is"&&Oe.allowCustomizedBuiltInElements&&(Oe.tagNameCheck instanceof RegExp&&Tt(Oe.tagNameCheck,K)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(K))))return!1}else if(!ln[R]){if(!Tt(yt,yr(K,jt,""))){if(!((R==="src"||R==="xlink:href"||R==="href")&&$!=="script"&&x1(K,"data:")===0&&Wt[$])){if(!(Qe&&!Tt(kr,yr(K,jt,"")))){if(K)return!1}}}}}}return!0},Wa=function($){return $.indexOf("-")>0},Ua=function($){cn("beforeSanitizeAttributes",$,null);const{attributes:R}=$;if(!R)return;const K={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se};let Me=R.length;for(;Me--;){const et=R[Me],{name:tt,namespaceURI:Xe,value:Wn}=et,Sn=q(tt);let ut=tt==="value"?Wn:D1(Wn);if(K.attrName=Sn,K.attrValue=ut,K.keepAttr=!0,K.forceKeepAttr=void 0,cn("uponSanitizeAttribute",$,K),ut=K.attrValue,K.forceKeepAttr||($i(tt,$),!K.keepAttr))continue;if(!Pt&&Tt(/\/>/i,ut)){$i(tt,$);continue}qe&&Ia([bi,ni,yi],qa=>{ut=yr(ut,qa," ")});const Ya=q($.nodeName);if(Va(Ya,Sn,ut)){if(zn&&(Sn==="id"||Sn==="name")&&($i(tt,$),ut=zi+ut),X&&typeof H=="object"&&typeof H.getAttributeType=="function"&&!Xe)switch(H.getAttributeType(Ya,Sn)){case"TrustedHTML":{ut=X.createHTML(ut);break}case"TrustedScriptURL":{ut=X.createScriptURL(ut);break}}try{Xe?$.setAttributeNS(Xe,tt,ut):$.setAttribute(tt,ut),uf(t.removed)}catch{}}}cn("afterSanitizeAttributes",$,null)},Zo=function Q($){let R=null;const K=Hi($);for(cn("beforeSanitizeShadowDOM",$,null);R=K.nextNode();)cn("uponSanitizeShadowNode",R,null),!Ha(R)&&(R.content instanceof l&&Q(R.content),Ua(R));cn("afterSanitizeShadowDOM",$,null)};return t.sanitize=function(Q){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=null,K=null,Me=null,et=null;if(jn=!Q,jn&&(Q="<!-->"),typeof Q!="string"&&!ja(Q))if(typeof Q.toString=="function"){if(Q=Q.toString(),typeof Q!="string")throw wr("dirty is not a string, aborting")}else throw wr("toString is not a function");if(!t.isSupported)return Q;if(oe||Sr($),t.removed=[],typeof Q=="string"&&(ne=!1),ne){if(Q.nodeName){const Wn=q(Q.nodeName);if(!Le[Wn]||Nn[Wn])throw wr("root node is forbidden and cannot be sanitized in-place")}}else if(Q instanceof f)R=za("<!---->"),K=R.ownerDocument.importNode(Q,!0),K.nodeType===1&&K.nodeName==="BODY"||K.nodeName==="HTML"?R=K:R.appendChild(K);else{if(!je&&!qe&&!lt&&Q.indexOf("<")===-1)return X&&on?X.createHTML(Q):Q;if(R=za(Q),!R)return je?null:on?xe:""}R&&sn&&Vn(R.firstChild);const tt=Hi(ne?Q:R);for(;Me=tt.nextNode();)Ha(Me)||(Me.content instanceof l&&Zo(Me.content),Ua(Me));if(ne)return Q;if(je){if(Ye)for(et=N.call(R.ownerDocument);R.firstChild;)et.appendChild(R.firstChild);else et=R;return(Se.shadowroot||Se.shadowrootmode)&&(et=De.call(i,et,!0)),et}let Xe=lt?R.outerHTML:R.innerHTML;return lt&&Le["!doctype"]&&R.ownerDocument&&R.ownerDocument.doctype&&R.ownerDocument.doctype.name&&Tt(_f,R.ownerDocument.doctype.name)&&(Xe="<!DOCTYPE "+R.ownerDocument.doctype.name+`>
220
- `+Xe),qe&&Ia([bi,ni,yi],Wn=>{Xe=yr(Xe,Wn," ")}),X&&on?X.createHTML(Xe):Xe},t.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sr(Q),oe=!0},t.clearConfig=function(){te=null,oe=!1},t.isValidAttribute=function(Q,$,R){te||Sr({});const K=q(Q),Me=q($);return Va(K,Me,R)},t.addHook=function(Q,$){typeof $=="function"&&(Ae[Q]=Ae[Q]||[],br(Ae[Q],$))},t.removeHook=function(Q){if(Ae[Q])return uf(Ae[Q])},t.removeHooks=function(Q){Ae[Q]&&(Ae[Q]=[])},t.removeAllHooks=function(){Ae={}},t}var z1=vf();const LO="",j1=S.defineComponent({__name:"SignupField",props:{id:null,value:null,label:null,disabled:{type:Boolean},displayInfo:{type:Boolean},type:null,decimals:null,leftIcon:null,rightIcon:null,placeholder:null,helperText:null,errorText:null,required:{type:Boolean},regex:null},emits:["input","right-icon-click"],setup(e,{emit:t}){const n=e;S.use(Gc);const i=E=>{const ee={ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","target"]};return E?z1.sanitize(E,ee):""},s=S.ref(!1),l=S.ref(!1),c=S.computed(()=>{var E;return l.value?"Obligatorio":n.errorText||((E=n.regex)==null?void 0:E.message)}),f=S.computed(()=>n.placeholder||""),h=S.computed(()=>s.value?c.value:i(n.helperText)),m=S.computed(()=>{let E="";return n.leftIcon&&(E+="padding-left"),n.rightIcon&&(E+=" padding-right"),s.value&&(E+=" input-error"),E}),v=S.computed(()=>{let E="t-field__helper-text";return s.value&&(E+=" error"),E}),b=()=>{n.regex&&typeof n.value=="string"?s.value=!RegExp(n.regex.pattern).test(n.value):n.required&&(s.value=!n.value,l.value=!n.value)};return S.watch(()=>n.value,b),{__sfc:!0,props:n,emits:t,stringToHTML:i,isError:s,displayRequired:l,errorText:c,placeholder:f,lowerLabel:h,inputClass:m,lowerLabelClass:v,validate:b,handleInput:E=>{t("input",E.target.value)},handleDatePicker:E=>{t("input",E)},handleRightIconClick:()=>{t("right-icon-click")},Icon:Lt}}}),zO="";function Ba(e,t,n,i,s,l,c,f){var h=typeof e=="function"?e.options:e;t&&(h.render=t,h.staticRenderFns=n,h._compiled=!0),i&&(h.functional=!0),l&&(h._scopeId="data-v-"+l);var m;if(c?(m=function(x){x=x||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!x&&typeof __VUE_SSR_CONTEXT__<"u"&&(x=__VUE_SSR_CONTEXT__),s&&s.call(this,x),x&&x._registeredComponents&&x._registeredComponents.add(c)},h._ssrRegister=m):s&&(m=f?function(){s.call(this,(h.functional?this.parent:this).$root.$options.shadowRoot)}:s),m)if(h.functional){h._injectStyles=m;var v=h.render;h.render=function(H,Y){return m.call(Y),v(H,Y)}}else{var b=h.beforeCreate;h.beforeCreate=b?[].concat(b,m):[m]}return{exports:e,options:h}}var H1=function(){var t=this,n=t._self._c,i=t._self._setupProxy;return n("div",{staticClass:"t-field"},[n("link",{attrs:{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/@mdi/font@5.8.55/css/materialdesignicons.min.css"}}),t.label?n("label",{staticClass:"t-field__label",attrs:{for:t.id},domProps:{innerHTML:t._s(i.stringToHTML(t.label))}}):t._e(),t.displayInfo?n("div",[n("p",{staticClass:"display-info"},[t._v(" "+t._s(t.value)+" ")])]):n("div",{staticClass:"t-field__input-container"},[n("div",{staticClass:"t-field__icon t-field__icon--right",attrs:{role:"button",tabindex:"0"},on:{click:i.handleRightIconClick,keydown:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:i.handleRightIconClick.apply(null,arguments)}}},[t.rightIcon?n(i.Icon,{attrs:{icon:t.rightIcon,color:"black"}}):t._e()],1),t.leftIcon?n(i.Icon,{staticClass:"t-field__icon t-field__icon--left",attrs:{icon:t.leftIcon,color:"black"}}):t._e(),t.type==="date"?n("b-datepicker",{staticClass:"date-class",attrs:{value:t.value,locale:"es-ES"},on:{input:i.handleDatePicker}}):n("input",{staticClass:"t-field__input",class:i.inputClass,attrs:{id:t.id,placeholder:i.placeholder,type:t.type,disabled:t.disabled},domProps:{value:t.value},on:{input:i.handleInput}})],1),n("p",{class:i.lowerLabelClass,attrs:{for:t.id},domProps:{innerHTML:t._s(i.lowerLabel)}})])},V1=[],W1=Ba(j1,H1,V1,!1,null,"bb7d03da",null,null);const U1=W1.exports,Y1=S.defineComponent({__name:"SignupFields",props:{fieldsType:null,title:null,fields:null,autocomplete:{type:Boolean},accounts:null},emits:["input","search"],setup(e,{emit:t}){const n=e,i=(b,x)=>{t("input",{id:b,value:x})},{shouldShowField:s}=nf(),l=S.computed(()=>n.fields.filter(s)),c=S.computed(()=>{const b={};return l.value.forEach(x=>{b[x.name]=x.value}),b});return{__sfc:!0,props:n,emit:t,handleInput:i,shouldShowField:s,fieldsToShow:l,variables:c,getFieldValue:b=>b.displayInfo&&y1(b.value)?tf(b.value,c.value):b.value,isFieldSearchable:b=>b.isExternalId&&n.autocomplete,handleRightIconClick:()=>{t("search")},retrocompatibleIcon:b=>b==="DollarIcon"?"solar:dollar-outline":b,TTypography:ef,TSelect:e1,SignupFieldComponent:U1}}}),jO="";var q1=function(){var t=this,n=t._self._c,i=t._self._setupProxy;return n("div",{staticClass:"fields"},[n(i.TTypography,{attrs:{variant:"s2","font-weight":"medium"}},[t._v(" "+t._s(t.title)+" ")]),n("div",{staticClass:"fields__base"},[t._l(i.fieldsToShow,function(s){var l,c;return[t.fieldsType==="invoice"&&s.isAccount?n(i.TSelect,{key:s.id||s.name,staticClass:"t-select",attrs:{placeholder:s.placeholder,label:s.label,value:(l=s.value)==null?void 0:l.toString(),"helper-text":s.helperText},on:{input:f=>i.handleInput(s.id||s.id||s.name,f)}},t._l(t.accounts,function({id:f,name:h}){return n("option",{key:f,domProps:{value:f}},[t._v(" "+t._s(h)+" ")])}),0):s.defaultOptions!==void 0?n(i.TSelect,{key:s.id||s.name,staticClass:"t-select",attrs:{placeholder:s.placeholder,label:s.label,value:(c=s.value)==null?void 0:c.toString(),"helper-text":s.helperText},on:{input:f=>i.handleInput(s.id||s.name,f)}},t._l(s.defaultOptions,function(f){return n("option",{key:f.toString(),domProps:{value:f.toString()}},[t._v(" "+t._s(f)+" ")])}),0):n(i.SignupFieldComponent,{key:s.name,attrs:{id:s.id||s.name,value:i.getFieldValue(s),type:s.type,label:s.label,placeholder:s.placeholder,decimals:s.decimals,"helper-text":s.helperText,"left-icon":i.retrocompatibleIcon(s.leftIcon),required:s.required,regex:s.regex,"display-info":s.displayInfo,"right-icon":i.isFieldSearchable(s)?"ph:magnifying-glass":void 0},on:{input:f=>i.handleInput(s.id||s.name,f),"right-icon-click":function(f){i.isFieldSearchable(s)&&i.handleRightIconClick()}}})]})],2)],1)},K1=[],X1=Ba(Y1,q1,K1,!1,null,"31fab577",null,null);const G1=X1.exports,Z1=S.defineComponent({__name:"SignupCompleted",props:{type:{default:"success"},errorMessage:null,errorButtonLabel:null,successMessage:null,successButtonLabel:null},emits:["reset"],setup(e){const t=e,n=S.computed(()=>t.type==="error"?t.errorMessage:t.successMessage),i=S.computed(()=>t.type==="error"?t.errorButtonLabel:t.successButtonLabel);return{__sfc:!0,props:t,message:n,buttonText:i,TButton:Jd,TTypography:ef}}}),HO="";var Q1=function(){var t=this,n=t._self._c,i=t._self._setupProxy;return n("div",{staticClass:"success-form"},[n(i.TTypography,{attrs:{variant:"h1"}},[t._v(" "+t._s(i.message)+" ")]),n(i.TButton,{attrs:{variant:"secondary"},on:{click:function(s){return t.$emit("reset")}}},[t._v(" "+t._s(i.buttonText)+" ")])],1)},J1=[],eS=Ba(Z1,Q1,J1,!1,null,"dd9e3f67",null,null);const tS=eS.exports,VO="",nS=S.defineComponent({__name:"CustomForm",props:{customerFields:null,invoiceFields:null,showSendByEmail:{type:Boolean},countryIso:null,disableSubmit:{type:Boolean},isLoading:{type:Boolean},submitFormStatus:null,signupCompleted:{type:Boolean},isAutocompleteEnabled:{type:Boolean},accounts:null,invoiceFieldsTitle:{default:"Plan de pagos"},customerFieldsTitle:{default:"Información Cliente"},buttonLabel:{default:"Registrar"},sendByEmailText:{default:"Enviar información a correo electrónico"},errorMessage:{default:"Error en la creación"},errorButtonLabel:{default:"Intentar nuevamente"},successMessage:{default:"Inscripción exitosa"},successButtonLabel:{default:"Registrar nuevo cliente"},useRows:{type:Boolean,default:!1},buttonColor:{default:"#5c0087"}},emits:["submit-form-data","reset","autocomplete-subscription","autocomplete-external-id"],setup(e,{emit:t}){const n=e;S.useCssVars((j,N)=>({"911f18da":j.buttonColor})),S.use(Gc);const i=S.ref(n.customerFields),s=S.ref(n.invoiceFields),l=S.ref(n.isLoading),c=S.ref(n.submitFormStatus),f=S.ref(n.signupCompleted),h=S.ref(n.errorMessage),m=S.ref(n.isAutocompleteEnabled),v=S.ref(!n.showSendByEmail),b=S.computed(()=>[...i.value,...s.value]),{shouldShowField:x}=nf(b),{cleanGovernmentId:H}=b1(),Y=Rk({colors:{primary:{main:"#707070"}}});S.watch(n,j=>{i.value=j.customerFields,s.value=j.invoiceFields,l.value=j.isLoading,c.value=j.submitFormStatus,f.value=j.signupCompleted,h.value=j.errorMessage,m.value=j.isAutocompleteEnabled});const E=(j,N)=>j.type==="number"&&j.decimals?(Math.round(Number(N)*10**j.decimals)/10**j.decimals).toString():N,ee=()=>{const j=i.value.find(({isExternalId:N})=>N);t("autocomplete-external-id",j==null?void 0:j.value)},G=(j,{id:N,value:de})=>{const De=j.findIndex(Ae=>N===Ae.id||N===Ae.name);if(De!==-1){const Ae=j[De];S.set(Ae,"value",E(Ae,de)),Ae.name==="product_id"&&m.value&&t("autocomplete-subscription",de)}},se=()=>{const j={};return b.value.forEach(N=>{x(N)&&(j[N.name]=N.value)}),j},X=()=>{const j=se(),N={additional_data:{},customer_metadata:{},subscription_metadata:{},invoice_metadata:{},send_mail:v.value};return b.value.forEach(de=>{if(de.value){if(de.relatedField&&!x(de))return;let{value:De}=de;de.displayInfo&&(De=tf(De,j)),de.name.includes("customer_metadata")?N.customer_metadata[de.name.replace("customer_metadata_","")]=De:de.name.includes("subscription_metadata")?N.subscription_metadata[de.name.replace("subscription_metadata_","")]=De:de.name.includes("invoice_metadata")?N.invoice_metadata[de.name.replace("invoice_metadata_","")]=De:de.name.includes("additional_data")?N.additional_data[de.name.replace("additional_data_","")]=De:de.name==="government_id"&&n.countryIso==="CL"?N[de.name]=H(De,n.countryIso):de.name==="due_date"&&w1(De)?N[de.name]=$1(De):de.isAccount?N.id_account=De:N[de.name]=De}}),N},xe=()=>{let j=!0;return b.value.forEach(N=>{const de=N.required&&(N.value===void 0||N.value==="")&&(!N.relatedField||x(N)),De=N.regex&&!RegExp(N.regex.pattern).test(N.value);(de||De)&&(j=!1)}),j};return{__sfc:!0,props:n,emit:t,customerFields:i,invoiceFields:s,isLoading:l,submitFormStatus:c,signupCompleted:f,errorMessage:h,isAutocompleteEnabled:m,sendEmail:v,allFields:b,shouldShowField:x,cleanGovernmentId:H,theme:Y,formatFieldValue:E,handleSearch:ee,handleInput:G,getVariables:se,buildSignupRequestBody:X,validateFormValues:xe,submitForm:()=>{if(!xe())return;const N=X();t("submit-form-data",N)},TButton:Jd,TThemeProvider:zk,SignupFields:G1,SignupCompleted:tS}}}),WO="";var iS=function(){var t=this,n=t._self._c,i=t._self._setupProxy;return n(i.TThemeProvider,{attrs:{theme:i.theme}},[n("main",[n("transition",{attrs:{name:"slide-fade",mode:"out-in"}},[i.signupCompleted?n(i.SignupCompleted,{attrs:{type:i.submitFormStatus,"error-message":i.errorMessage,"error-button-label":t.errorButtonLabel,"success-message":t.successMessage,"success-button-label":t.successButtonLabel},on:{reset:function(s){return i.emit("reset")}}}):n("div",{staticClass:"custom-form"},[n("div",{class:[t.useRows?"custom-form--rows":"custom-form--columns"]},[n(i.SignupFields,{attrs:{fields:i.customerFields,"fields-type":"customer",title:t.customerFieldsTitle,autocomplete:i.isAutocompleteEnabled,accounts:t.accounts},on:{input:s=>i.handleInput(i.customerFields,s),search:i.handleSearch}}),n(i.SignupFields,{attrs:{fields:i.invoiceFields,"fields-type":"invoice",title:t.invoiceFieldsTitle,accounts:t.accounts},on:{input:s=>i.handleInput(i.invoiceFields,s)}})],1),n("div",{staticClass:"custom-form__checkbox"},[t.showSendByEmail?n("b-checkbox",{attrs:{id:"send_email"},model:{value:i.sendEmail,callback:function(s){i.sendEmail=s},expression:"sendEmail"}},[t._v(" "+t._s(t.sendByEmailText)+" ")]):t._e()],1),n("div",[n(i.TButton,{staticClass:"custom-form__button",attrs:{disabled:t.disableSubmit,size:"medium",loading:i.isLoading},on:{click:i.submitForm}},[t._v(" "+t._s(t.buttonLabel)+" ")])],1)])],1)],1)])},rS=[],aS=Ba(nS,iS,rS,!1,null,"20fbbab1",null,null);const sS=aS.exports;hi.CustomForm=sS,Object.defineProperty(hi,Symbol.toStringTag,{value:"Module"})});
220
+ `+Xe),qe&&Ia([bi,ni,yi],Wn=>{Xe=yr(Xe,Wn," ")}),X&&on?X.createHTML(Xe):Xe},t.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sr(Q),oe=!0},t.clearConfig=function(){te=null,oe=!1},t.isValidAttribute=function(Q,$,R){te||Sr({});const K=q(Q),Me=q($);return Va(K,Me,R)},t.addHook=function(Q,$){typeof $=="function"&&(Ae[Q]=Ae[Q]||[],br(Ae[Q],$))},t.removeHook=function(Q){if(Ae[Q])return uf(Ae[Q])},t.removeHooks=function(Q){Ae[Q]&&(Ae[Q]=[])},t.removeAllHooks=function(){Ae={}},t}var z1=vf();const LO="",j1=S.defineComponent({__name:"SignupField",props:{id:null,value:null,label:null,disabled:{type:Boolean},displayInfo:{type:Boolean},type:null,decimals:null,leftIcon:null,rightIcon:null,placeholder:null,helperText:null,errorText:null,required:{type:Boolean},regex:null},emits:["input","right-icon-click"],setup(e,{emit:t}){const n=e;S.use(Gc);const i=E=>{const ee={ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","target"]};return E?z1.sanitize(E,ee):""},s=S.ref(!1),l=S.ref(!1),c=S.computed(()=>{var E;return l.value?"Obligatorio":n.errorText||((E=n.regex)==null?void 0:E.message)}),f=S.computed(()=>n.placeholder||""),h=S.computed(()=>s.value?c.value:i(n.helperText)),m=S.computed(()=>{let E="";return n.leftIcon&&(E+="padding-left"),n.rightIcon&&(E+=" padding-right"),s.value&&(E+=" input-error"),E}),v=S.computed(()=>{let E="t-field__helper-text";return s.value&&(E+=" error"),E}),b=()=>{n.regex&&typeof n.value=="string"?s.value=!RegExp(n.regex.pattern).test(n.value):n.required&&(s.value=!n.value,l.value=!n.value)};return S.watch(()=>n.value,b),{__sfc:!0,props:n,emits:t,stringToHTML:i,isError:s,displayRequired:l,errorText:c,placeholder:f,lowerLabel:h,inputClass:m,lowerLabelClass:v,validate:b,handleInput:E=>{t("input",E.target.value)},handleDatePicker:E=>{t("input",E)},handleRightIconClick:()=>{t("right-icon-click")},Icon:Lt}}}),zO="";function Ba(e,t,n,i,s,l,c,f){var h=typeof e=="function"?e.options:e;t&&(h.render=t,h.staticRenderFns=n,h._compiled=!0),i&&(h.functional=!0),l&&(h._scopeId="data-v-"+l);var m;if(c?(m=function(x){x=x||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!x&&typeof __VUE_SSR_CONTEXT__<"u"&&(x=__VUE_SSR_CONTEXT__),s&&s.call(this,x),x&&x._registeredComponents&&x._registeredComponents.add(c)},h._ssrRegister=m):s&&(m=f?function(){s.call(this,(h.functional?this.parent:this).$root.$options.shadowRoot)}:s),m)if(h.functional){h._injectStyles=m;var v=h.render;h.render=function(H,Y){return m.call(Y),v(H,Y)}}else{var b=h.beforeCreate;h.beforeCreate=b?[].concat(b,m):[m]}return{exports:e,options:h}}var H1=function(){var t=this,n=t._self._c,i=t._self._setupProxy;return n("div",{staticClass:"t-field"},[n("link",{attrs:{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/@mdi/font@5.8.55/css/materialdesignicons.min.css"}}),t.label?n("label",{staticClass:"t-field__label",attrs:{for:t.id},domProps:{innerHTML:t._s(i.stringToHTML(t.label))}}):t._e(),t.displayInfo?n("div",[n("p",{staticClass:"display-info"},[t._v(" "+t._s(t.value)+" ")])]):n("div",{staticClass:"t-field__input-container"},[n("div",{staticClass:"t-field__icon t-field__icon--right",attrs:{role:"button",tabindex:"0"},on:{click:i.handleRightIconClick,keydown:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:i.handleRightIconClick.apply(null,arguments)}}},[t.rightIcon?n(i.Icon,{attrs:{icon:t.rightIcon,color:"black"}}):t._e()],1),t.leftIcon?n(i.Icon,{staticClass:"t-field__icon t-field__icon--left",attrs:{icon:t.leftIcon,color:"black"}}):t._e(),t.type==="date"?n("b-datepicker",{staticClass:"date-class",attrs:{value:t.value,locale:"es-ES"},on:{input:i.handleDatePicker}}):n("input",{staticClass:"t-field__input",class:i.inputClass,attrs:{id:t.id,placeholder:i.placeholder,type:t.type,disabled:t.disabled},domProps:{value:t.value},on:{input:i.handleInput}})],1),n("p",{class:i.lowerLabelClass,attrs:{for:t.id},domProps:{innerHTML:t._s(i.lowerLabel)}})])},V1=[],W1=Ba(j1,H1,V1,!1,null,"a21ecf7f",null,null);const U1=W1.exports,Y1=S.defineComponent({__name:"SignupFields",props:{fieldsType:null,title:null,fields:null,autocomplete:{type:Boolean},accounts:null},emits:["input","search"],setup(e,{emit:t}){const n=e,i=(b,x)=>{t("input",{id:b,value:x})},{shouldShowField:s}=nf(),l=S.computed(()=>n.fields.filter(s)),c=S.computed(()=>{const b={};return l.value.forEach(x=>{b[x.name]=x.value}),b});return{__sfc:!0,props:n,emit:t,handleInput:i,shouldShowField:s,fieldsToShow:l,variables:c,getFieldValue:b=>b.displayInfo&&y1(b.value)?tf(b.value,c.value):b.value,isFieldSearchable:b=>b.isExternalId&&n.autocomplete,handleRightIconClick:()=>{t("search")},retrocompatibleIcon:b=>b==="DollarIcon"?"solar:dollar-outline":b,TTypography:ef,TSelect:e1,SignupFieldComponent:U1}}}),jO="";var q1=function(){var t=this,n=t._self._c,i=t._self._setupProxy;return n("div",{staticClass:"fields"},[n(i.TTypography,{attrs:{variant:"s2","font-weight":"medium"}},[t._v(" "+t._s(t.title)+" ")]),n("div",{staticClass:"fields__base"},[t._l(i.fieldsToShow,function(s){var l,c;return[t.fieldsType==="invoice"&&s.isAccount?n(i.TSelect,{key:s.id||s.name,staticClass:"t-select",attrs:{placeholder:s.placeholder,label:s.label,value:(l=s.value)==null?void 0:l.toString(),"helper-text":s.helperText},on:{input:f=>i.handleInput(s.id||s.id||s.name,f)}},t._l(t.accounts,function({id:f,name:h}){return n("option",{key:f,domProps:{value:f}},[t._v(" "+t._s(h)+" ")])}),0):s.defaultOptions!==void 0?n(i.TSelect,{key:s.id||s.name,staticClass:"t-select",attrs:{placeholder:s.placeholder,label:s.label,value:(c=s.value)==null?void 0:c.toString(),"helper-text":s.helperText},on:{input:f=>i.handleInput(s.id||s.name,f)}},t._l(s.defaultOptions,function(f){return n("option",{key:f.toString(),domProps:{value:f.toString()}},[t._v(" "+t._s(f)+" ")])}),0):n(i.SignupFieldComponent,{key:s.name,attrs:{id:s.id||s.name,value:i.getFieldValue(s),type:s.type,label:s.label,placeholder:s.placeholder,decimals:s.decimals,"helper-text":s.helperText,"left-icon":i.retrocompatibleIcon(s.leftIcon),required:s.required,regex:s.regex,"display-info":s.displayInfo,"right-icon":i.isFieldSearchable(s)?"ph:magnifying-glass":void 0},on:{input:f=>i.handleInput(s.id||s.name,f),"right-icon-click":function(f){i.isFieldSearchable(s)&&i.handleRightIconClick()}}})]})],2)],1)},K1=[],X1=Ba(Y1,q1,K1,!1,null,"31fab577",null,null);const G1=X1.exports,Z1=S.defineComponent({__name:"SignupCompleted",props:{type:{default:"success"},errorMessage:null,errorButtonLabel:null,successMessage:null,successButtonLabel:null},emits:["reset"],setup(e){const t=e,n=S.computed(()=>t.type==="error"?t.errorMessage:t.successMessage),i=S.computed(()=>t.type==="error"?t.errorButtonLabel:t.successButtonLabel);return{__sfc:!0,props:t,message:n,buttonText:i,TButton:Jd,TTypography:ef}}}),HO="";var Q1=function(){var t=this,n=t._self._c,i=t._self._setupProxy;return n("div",{staticClass:"success-form"},[n(i.TTypography,{attrs:{variant:"h1"}},[t._v(" "+t._s(i.message)+" ")]),n(i.TButton,{attrs:{variant:"secondary"},on:{click:function(s){return t.$emit("reset")}}},[t._v(" "+t._s(i.buttonText)+" ")])],1)},J1=[],eS=Ba(Z1,Q1,J1,!1,null,"dd9e3f67",null,null);const tS=eS.exports,VO="",nS=S.defineComponent({__name:"CustomForm",props:{customerFields:null,invoiceFields:null,showSendByEmail:{type:Boolean},countryIso:null,disableSubmit:{type:Boolean},isLoading:{type:Boolean},submitFormStatus:null,signupCompleted:{type:Boolean},isAutocompleteEnabled:{type:Boolean},accounts:null,invoiceFieldsTitle:{default:"Plan de pagos"},customerFieldsTitle:{default:"Información Cliente"},buttonLabel:{default:"Registrar"},sendByEmailText:{default:"Enviar información a correo electrónico"},errorMessage:{default:"Error en la creación"},errorButtonLabel:{default:"Intentar nuevamente"},successMessage:{default:"Inscripción exitosa"},successButtonLabel:{default:"Registrar nuevo cliente"},useRows:{type:Boolean,default:!1},buttonColor:{default:"#5c0087"}},emits:["submit-form-data","reset","autocomplete-subscription","autocomplete-external-id"],setup(e,{emit:t}){const n=e;S.useCssVars((j,N)=>({"911f18da":j.buttonColor})),S.use(Gc);const i=S.ref(n.customerFields),s=S.ref(n.invoiceFields),l=S.ref(n.isLoading),c=S.ref(n.submitFormStatus),f=S.ref(n.signupCompleted),h=S.ref(n.errorMessage),m=S.ref(n.isAutocompleteEnabled),v=S.ref(!n.showSendByEmail),b=S.computed(()=>[...i.value,...s.value]),{shouldShowField:x}=nf(b),{cleanGovernmentId:H}=b1(),Y=Rk({colors:{primary:{main:"#707070"}}});S.watch(n,j=>{i.value=j.customerFields,s.value=j.invoiceFields,l.value=j.isLoading,c.value=j.submitFormStatus,f.value=j.signupCompleted,h.value=j.errorMessage,m.value=j.isAutocompleteEnabled});const E=(j,N)=>j.type==="number"&&j.decimals?(Math.round(Number(N)*10**j.decimals)/10**j.decimals).toString():N,ee=()=>{const j=i.value.find(({isExternalId:N})=>N);t("autocomplete-external-id",j==null?void 0:j.value)},G=(j,{id:N,value:de})=>{const De=j.findIndex(Ae=>N===Ae.id||N===Ae.name);if(De!==-1){const Ae=j[De];S.set(Ae,"value",E(Ae,de)),Ae.name==="product_id"&&m.value&&t("autocomplete-subscription",de)}},se=()=>{const j={};return b.value.forEach(N=>{x(N)&&(j[N.name]=N.value)}),j},X=()=>{const j=se(),N={additional_data:{},customer_metadata:{},subscription_metadata:{},invoice_metadata:{},send_mail:v.value};return b.value.forEach(de=>{if(de.value){if(de.relatedField&&!x(de))return;let{value:De}=de;de.displayInfo&&(De=tf(De,j)),de.name.includes("customer_metadata")?N.customer_metadata[de.name.replace("customer_metadata_","")]=De:de.name.includes("subscription_metadata")?N.subscription_metadata[de.name.replace("subscription_metadata_","")]=De:de.name.includes("invoice_metadata")?N.invoice_metadata[de.name.replace("invoice_metadata_","")]=De:de.name.includes("additional_data")?N.additional_data[de.name.replace("additional_data_","")]=De:de.name==="government_id"&&n.countryIso==="CL"?N[de.name]=H(De,n.countryIso):de.name==="due_date"&&w1(De)?N[de.name]=$1(De):de.isAccount?N.id_account=De:N[de.name]=De}}),N},xe=()=>{let j=!0;return b.value.forEach(N=>{const de=N.required&&(N.value===void 0||N.value==="")&&(!N.relatedField||x(N)),De=N.regex&&!RegExp(N.regex.pattern).test(N.value);(de||De)&&(j=!1)}),j};return{__sfc:!0,props:n,emit:t,customerFields:i,invoiceFields:s,isLoading:l,submitFormStatus:c,signupCompleted:f,errorMessage:h,isAutocompleteEnabled:m,sendEmail:v,allFields:b,shouldShowField:x,cleanGovernmentId:H,theme:Y,formatFieldValue:E,handleSearch:ee,handleInput:G,getVariables:se,buildSignupRequestBody:X,validateFormValues:xe,submitForm:()=>{if(!xe())return;const N=X();t("submit-form-data",N)},TButton:Jd,TThemeProvider:zk,SignupFields:G1,SignupCompleted:tS}}}),WO="";var iS=function(){var t=this,n=t._self._c,i=t._self._setupProxy;return n(i.TThemeProvider,{attrs:{theme:i.theme}},[n("main",[n("transition",{attrs:{name:"slide-fade",mode:"out-in"}},[i.signupCompleted?n(i.SignupCompleted,{attrs:{type:i.submitFormStatus,"error-message":i.errorMessage,"error-button-label":t.errorButtonLabel,"success-message":t.successMessage,"success-button-label":t.successButtonLabel},on:{reset:function(s){return i.emit("reset")}}}):n("div",{staticClass:"custom-form"},[n("div",{class:[t.useRows?"custom-form--rows":"custom-form--columns"]},[n(i.SignupFields,{attrs:{fields:i.customerFields,"fields-type":"customer",title:t.customerFieldsTitle,autocomplete:i.isAutocompleteEnabled,accounts:t.accounts},on:{input:s=>i.handleInput(i.customerFields,s),search:i.handleSearch}}),n(i.SignupFields,{attrs:{fields:i.invoiceFields,"fields-type":"invoice",title:t.invoiceFieldsTitle,accounts:t.accounts},on:{input:s=>i.handleInput(i.invoiceFields,s)}})],1),n("div",{staticClass:"custom-form__checkbox"},[t.showSendByEmail?n("b-checkbox",{attrs:{id:"send_email"},model:{value:i.sendEmail,callback:function(s){i.sendEmail=s},expression:"sendEmail"}},[t._v(" "+t._s(t.sendByEmailText)+" ")]):t._e()],1),n("div",[n(i.TButton,{staticClass:"custom-form__button",attrs:{disabled:t.disableSubmit,size:"medium",loading:i.isLoading},on:{click:i.submitForm}},[t._v(" "+t._s(t.buttonLabel)+" ")])],1)])],1)],1)])},rS=[],aS=Ba(nS,iS,rS,!1,null,"20fbbab1",null,null);const sS=aS.exports;hi.CustomForm=sS,Object.defineProperty(hi,Symbol.toStringTag,{value:"Module"})});
221
221
  //# sourceMappingURL=index.umd.js.map