dynamic-mui 2.2.0 → 2.3.0

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.
Files changed (166) hide show
  1. package/README.md +142 -5
  2. package/dist/accordion-DqBdGRim.mjs +23 -0
  3. package/dist/accordion-lvbD_BpX.js +1 -0
  4. package/dist/addressfield-CGX3UppE.mjs +152 -0
  5. package/dist/addressfield-DDG15fqJ.js +1 -0
  6. package/dist/asyncautocomplete-BAfBR9P7.mjs +89 -0
  7. package/dist/asyncautocomplete-w9q_1DWt.js +1 -0
  8. package/dist/bar-BzO7tvYJ.mjs +20 -0
  9. package/dist/bar-DEVxyUVS.js +1 -0
  10. package/dist/cascadeselect-C3QVfoig.mjs +64 -0
  11. package/dist/cascadeselect-DzbhK9en.js +1 -0
  12. package/dist/colorpicker-5qmEq7ZI.js +1 -0
  13. package/dist/colorpicker-DhNZulJY.mjs +98 -0
  14. package/dist/components/DynamicComponent.d.ts +2 -0
  15. package/dist/components/FormGenerator.d.ts +99 -10
  16. package/dist/components/controls/index.d.ts +45 -79
  17. package/dist/consentfield-B7Rm8d3U.js +1 -0
  18. package/dist/consentfield-CBQUR4J5.mjs +78 -0
  19. package/dist/datatable-BIQznwQe.mjs +20 -0
  20. package/dist/datatable-BWlcUP0M.js +1 -0
  21. package/dist/dynamic-mui.cjs +1 -0
  22. package/dist/dynamic-mui.mjs +32 -0
  23. package/dist/editabletable-DCoRmsEO.js +1 -0
  24. package/dist/editabletable-DRlBV8lk.mjs +126 -0
  25. package/dist/fileupload-ByBv1UjT.mjs +172 -0
  26. package/dist/fileupload-Cze3Oc_2.js +1 -0
  27. package/dist/formrepeater-BBkKGLFJ.mjs +71 -0
  28. package/dist/formrepeater-BxJzXoHx.js +1 -0
  29. package/dist/formwizard-BDZE1UDD.js +1 -0
  30. package/dist/formwizard-D2u1bMvK.mjs +83 -0
  31. package/dist/geofield-8WTeZk0Z.mjs +104 -0
  32. package/dist/geofield-Bw3p4NLJ.js +1 -0
  33. package/dist/group-B2mSylHd.mjs +23 -0
  34. package/dist/group-BlfO3ZZf.js +1 -0
  35. package/dist/imagelist-Bn9QhIv7.js +1 -0
  36. package/dist/imagelist-rqmJajHt.mjs +18 -0
  37. package/dist/index-CddjLTWF.mjs +12499 -0
  38. package/dist/index-D08GIfqF.js +43 -0
  39. package/dist/index.d.ts +9 -1
  40. package/dist/intlphone-B_Xn98pU.js +1 -0
  41. package/dist/intlphone-DtQZ12xk.mjs +140 -0
  42. package/dist/keyvaluefield-B_1NeGuP.mjs +125 -0
  43. package/dist/keyvaluefield-DyKCGd32.js +1 -0
  44. package/dist/line-B-DwR1hm.mjs +20 -0
  45. package/dist/line-BkymZu31.js +1 -0
  46. package/dist/lineitemlist-DGo8UOZC.js +1 -0
  47. package/dist/lineitemlist-vGKzJlQx.mjs +166 -0
  48. package/dist/list-7uNWrepS.mjs +20 -0
  49. package/dist/list-C0FgmtQw.js +1 -0
  50. package/dist/locationfield-CeUgxLkQ.mjs +119 -0
  51. package/dist/locationfield-Duyw1ZEz.js +1 -0
  52. package/dist/markdowneditor-B1y-hfny.mjs +90 -0
  53. package/dist/markdowneditor-Db0Un1_Z.js +2 -0
  54. package/dist/matrixfield-C7Sc-YpI.mjs +117 -0
  55. package/dist/matrixfield-CckODuPn.js +1 -0
  56. package/dist/mixChart-C3o184UT.js +1 -0
  57. package/dist/mixChart-ISf3Kbr-.mjs +75 -0
  58. package/dist/multitextbox-BYazIAeG.js +1 -0
  59. package/dist/multitextbox-ide2lvJ6.mjs +78 -0
  60. package/dist/npsscale-C2e88qk_.js +1 -0
  61. package/dist/npsscale-lndz7GEq.mjs +87 -0
  62. package/dist/numberstepper-DitbcvV9.mjs +128 -0
  63. package/dist/numberstepper-DyRjQM_K.js +1 -0
  64. package/dist/pie-CJSL8Sv5.js +1 -0
  65. package/dist/pie-CL29dlh5.mjs +20 -0
  66. package/dist/richtexteditor-CVg-MnKp.js +1 -0
  67. package/dist/richtexteditor-DsC1XC7h.mjs +141 -0
  68. package/dist/s3Upload-B0JeoLkS.js +1 -0
  69. package/dist/s3Upload-dpioZ2c8.mjs +51 -0
  70. package/dist/signature-14OrZriO.mjs +1225 -0
  71. package/dist/signature-D582X6tB.js +2 -0
  72. package/dist/stepper-B-FpcZvT.js +1 -0
  73. package/dist/stepper-CDfEy_C6.mjs +140 -0
  74. package/dist/summaryfield-B08ZmVHh.js +1 -0
  75. package/dist/summaryfield-CTpPlZBG.mjs +96 -0
  76. package/dist/tabs-BIliqFOs.js +1 -0
  77. package/dist/tabs-DDeJCFt8.mjs +39 -0
  78. package/dist/tagsinput-D-q6rRZS.mjs +58 -0
  79. package/dist/tagsinput-qh_lhdFb.js +1 -0
  80. package/dist/util/registry.d.ts +29 -0
  81. package/dist/util/resolvers.d.ts +45 -0
  82. package/dist/util/useFormEngine.d.ts +74 -0
  83. package/dist/util/validateSchema.d.ts +23 -0
  84. package/dist/v4-BysszJq8.mjs +30 -0
  85. package/dist/v4-CqdK_b8Y.js +1 -0
  86. package/package.json +36 -11
  87. package/dist/AxisSharedComponents-BbsKw1BT.js +0 -3
  88. package/dist/AxisSharedComponents-xLtpOLH_.mjs +0 -605
  89. package/dist/ChartsAxis-CANvBdY9.mjs +0 -47
  90. package/dist/ChartsAxis-EZ7m_KrU.js +0 -1
  91. package/dist/ChartsGrid-BCRTvNTr.js +0 -3
  92. package/dist/ChartsGrid-C_HT7qpL.mjs +0 -381
  93. package/dist/ChartsWrapper-CM7EDyAK.js +0 -5
  94. package/dist/ChartsWrapper-CO5_Z6BD.mjs +0 -1878
  95. package/dist/ChartsXAxis-CPmuCRhq.mjs +0 -487
  96. package/dist/ChartsXAxis-DFFY1sPg.js +0 -3
  97. package/dist/ChartsYAxis-DLUMr9vG.mjs +0 -392
  98. package/dist/ChartsYAxis-fpevi1sP.js +0 -1
  99. package/dist/XmlShapeDeserializer-3yQdm0b0.mjs +0 -237
  100. package/dist/XmlShapeDeserializer-XKJAoqLc.js +0 -1
  101. package/dist/clampAngle-BvZjnf53.mjs +0 -11
  102. package/dist/clampAngle-DpAsDoeT.js +0 -1
  103. package/dist/createSelector-B-9FwV16.mjs +0 -430
  104. package/dist/createSelector-f0oqn8Lr.js +0 -7
  105. package/dist/date-utils-CFUUt6NL.js +0 -4
  106. package/dist/date-utils-pGzaKb0p.mjs +0 -477
  107. package/dist/dynamic-mui.cjs.js +0 -1
  108. package/dist/dynamic-mui.es.js +0 -22
  109. package/dist/index--8Zky9Oh.js +0 -299
  110. package/dist/index-6WTs1Xy_.js +0 -1
  111. package/dist/index-B1R1akM2.js +0 -1
  112. package/dist/index-BW8_rRff.js +0 -7
  113. package/dist/index-BXFVK_GX.js +0 -1
  114. package/dist/index-B_KNUTjy.js +0 -1
  115. package/dist/index-BhaKvHkU.mjs +0 -62051
  116. package/dist/index-Bif92ima.js +0 -1
  117. package/dist/index-BnZOu8CL.js +0 -1
  118. package/dist/index-CDxpgRlR.mjs +0 -7
  119. package/dist/index-CThMfvtJ.mjs +0 -2555
  120. package/dist/index-CVqLvm8B.js +0 -1
  121. package/dist/index-CodJBIn6.mjs +0 -1665
  122. package/dist/index-Cr6Wp_S-.mjs +0 -3141
  123. package/dist/index-CslPwsrf.mjs +0 -4
  124. package/dist/index-CuV0MQzZ.mjs +0 -1173
  125. package/dist/index-DA0XouZs.mjs +0 -153
  126. package/dist/index-DKS5Sz9e.js +0 -14
  127. package/dist/index-DSkYYZuW.mjs +0 -4
  128. package/dist/index-DU78_FiA.js +0 -1
  129. package/dist/index-D_mYhgJ0.js +0 -10
  130. package/dist/index-DcWfyXJp.mjs +0 -92
  131. package/dist/index-Dlimbnxj.mjs +0 -2965
  132. package/dist/index-MllWgTJ5.mjs +0 -9372
  133. package/dist/index-in5z9hUb.js +0 -133
  134. package/dist/index-qUW7FnZ-.mjs +0 -20540
  135. package/dist/index.browser-BSu11T_q.mjs +0 -363
  136. package/dist/index.browser-By7-GABP.js +0 -4
  137. package/dist/isDeepEqual-BHfPvf9U.mjs +0 -393
  138. package/dist/isDeepEqual-CqxZGVRk.js +0 -1
  139. package/dist/loadCognitoIdentity-DtYTy-DW.js +0 -1
  140. package/dist/loadCognitoIdentity-DzdR91GB.mjs +0 -872
  141. package/dist/loadSts-Cic6UToN.mjs +0 -593
  142. package/dist/loadSts-csbFP6zX.js +0 -1
  143. package/dist/main.d.ts +0 -1
  144. package/dist/noAuth-B8ui2kBg.mjs +0 -71
  145. package/dist/noAuth-JPA2o4dt.js +0 -1
  146. package/dist/playground/AIContext.d.ts +0 -18
  147. package/dist/playground/AIPanel.d.ts +0 -10
  148. package/dist/playground/Builder.d.ts +0 -1
  149. package/dist/playground/Canvas.d.ts +0 -9
  150. package/dist/playground/DemoGallery.d.ts +0 -6
  151. package/dist/playground/PropertiesEditor.d.ts +0 -10
  152. package/dist/playground/Sidebar.d.ts +0 -9
  153. package/dist/playground/demoForms.d.ts +0 -3
  154. package/dist/playground/demoRecipes.d.ts +0 -15
  155. package/dist/playground/demoVariants.d.ts +0 -11
  156. package/dist/playground/documentation.d.ts +0 -6
  157. package/dist/playground/templates.d.ts +0 -7
  158. package/dist/playground/testData.d.ts +0 -2
  159. package/dist/test/setup.d.ts +0 -0
  160. package/dist/theme/theme.d.ts +0 -6
  161. package/dist/useAxis-DSbfEtO7.js +0 -3
  162. package/dist/useAxis-SiNBMMWq.mjs +0 -3010
  163. package/dist/useChartContainerProps-Bl3hO-r1.mjs +0 -5418
  164. package/dist/useChartContainerProps-C_C_PZoi.js +0 -12
  165. package/dist/useItemHighlightedGetter-9CIwqsGj.js +0 -1
  166. package/dist/useItemHighlightedGetter-CTISrNdV.mjs +0 -88
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react/jsx-runtime"),N=require("react"),Dt=require("./index-D08GIfqF.js"),Y=require("@mui/material"),$t=require("./s3Upload-B0JeoLkS.js");function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},yt.apply(null,arguments)}function Lt(e,r){if(e==null)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(r.indexOf(t)!==-1)continue;n[t]=e[t]}return n}function zt(e,r){if(e==null)return{};var n,t,o=Lt(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t<a.length;t++)n=a[t],r.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function mt(e){"@babel/helpers - typeof";return mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},mt(e)}function qt(e,r,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Ut(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function gt(e,r){return gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},gt(e,r)}function Bt(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&gt(e,r)}function at(e){return at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},at(e)}function It(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(It=function(){return!!e})()}function Ft(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yt(e,r){if(r&&(mt(r)=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ft(e)}function Nt(e){var r=It();return function(){var n,t=at(e);if(r){var o=at(this).constructor;n=Reflect.construct(t,arguments,o)}else n=t.apply(this,arguments);return Yt(this,n)}}var nt={exports:{}},ot={exports:{}},M={};var Et;function Vt(){if(Et)return M;Et=1;var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,t=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,W=e?Symbol.for("react.scope"):60119;function I(d){if(typeof d=="object"&&d!==null){var V=d.$$typeof;switch(V){case r:switch(d=d.type,d){case l:case c:case t:case a:case o:case p:return d;default:switch(d=d&&d.$$typeof,d){case i:case f:case E:case m:case u:return d;default:return V}}case n:return V}}}function A(d){return I(d)===c}return M.AsyncMode=l,M.ConcurrentMode=c,M.ContextConsumer=i,M.ContextProvider=u,M.Element=r,M.ForwardRef=f,M.Fragment=t,M.Lazy=E,M.Memo=m,M.Portal=n,M.Profiler=a,M.StrictMode=o,M.Suspense=p,M.isAsyncMode=function(d){return A(d)||I(d)===l},M.isConcurrentMode=A,M.isContextConsumer=function(d){return I(d)===i},M.isContextProvider=function(d){return I(d)===u},M.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===r},M.isForwardRef=function(d){return I(d)===f},M.isFragment=function(d){return I(d)===t},M.isLazy=function(d){return I(d)===E},M.isMemo=function(d){return I(d)===m},M.isPortal=function(d){return I(d)===n},M.isProfiler=function(d){return I(d)===a},M.isStrictMode=function(d){return I(d)===o},M.isSuspense=function(d){return I(d)===p},M.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===t||d===c||d===a||d===o||d===p||d===v||typeof d=="object"&&d!==null&&(d.$$typeof===E||d.$$typeof===m||d.$$typeof===u||d.$$typeof===i||d.$$typeof===f||d.$$typeof===b||d.$$typeof===w||d.$$typeof===W||d.$$typeof===g)},M.typeOf=I,M}var j={};var wt;function Ht(){return wt||(wt=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,t=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,W=e?Symbol.for("react.scope"):60119;function I(h){return typeof h=="string"||typeof h=="function"||h===t||h===c||h===a||h===o||h===p||h===v||typeof h=="object"&&h!==null&&(h.$$typeof===E||h.$$typeof===m||h.$$typeof===u||h.$$typeof===i||h.$$typeof===f||h.$$typeof===b||h.$$typeof===w||h.$$typeof===W||h.$$typeof===g)}function A(h){if(typeof h=="object"&&h!==null){var F=h.$$typeof;switch(F){case r:var rt=h.type;switch(rt){case l:case c:case t:case a:case o:case p:return rt;default:var xt=rt&&rt.$$typeof;switch(xt){case i:case f:case E:case m:case u:return xt;default:return F}}case n:return F}}}var d=l,V=c,X=i,Q=u,tt=r,q=f,H=t,U=E,J=m,Z=n,ct=a,B=o,G=p,et=!1;function ut(h){return et||(et=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),s(h)||A(h)===l}function s(h){return A(h)===c}function y(h){return A(h)===i}function S(h){return A(h)===u}function P(h){return typeof h=="object"&&h!==null&&h.$$typeof===r}function _(h){return A(h)===f}function C(h){return A(h)===t}function x(h){return A(h)===E}function T(h){return A(h)===m}function O(h){return A(h)===n}function D(h){return A(h)===a}function R(h){return A(h)===o}function $(h){return A(h)===p}j.AsyncMode=d,j.ConcurrentMode=V,j.ContextConsumer=X,j.ContextProvider=Q,j.Element=tt,j.ForwardRef=q,j.Fragment=H,j.Lazy=U,j.Memo=J,j.Portal=Z,j.Profiler=ct,j.StrictMode=B,j.Suspense=G,j.isAsyncMode=ut,j.isConcurrentMode=s,j.isContextConsumer=y,j.isContextProvider=S,j.isElement=P,j.isForwardRef=_,j.isFragment=C,j.isLazy=x,j.isMemo=T,j.isPortal=O,j.isProfiler=D,j.isStrictMode=R,j.isSuspense=$,j.isValidElementType=I,j.typeOf=A})()),j}var Pt;function kt(){return Pt||(Pt=1,process.env.NODE_ENV==="production"?ot.exports=Vt():ot.exports=Ht()),ot.exports}var ft,Tt;function Xt(){if(Tt)return ft;Tt=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function t(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function o(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var u={},i=0;i<10;i++)u["_"+String.fromCharCode(i)]=i;var l=Object.getOwnPropertyNames(u).map(function(f){return u[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ft=o()?Object.assign:function(a,u){for(var i,l=t(a),c,f=1;f<arguments.length;f++){i=Object(arguments[f]);for(var p in i)r.call(i,p)&&(l[p]=i[p]);if(e){c=e(i);for(var v=0;v<c.length;v++)n.call(i,c[v])&&(l[c[v]]=i[c[v]])}}return l},ft}var lt,St;function _t(){if(St)return lt;St=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return lt=e,lt}var dt,Ct;function Wt(){return Ct||(Ct=1,dt=Function.call.bind(Object.prototype.hasOwnProperty)),dt}var ht,Ot;function Jt(){if(Ot)return ht;Ot=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=_t(),n={},t=Wt();e=function(a){var u="Warning: "+a;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}}}function o(a,u,i,l,c){if(process.env.NODE_ENV!=="production"){for(var f in a)if(t(a,f)){var p;try{if(typeof a[f]!="function"){var v=Error((l||"React class")+": "+i+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}p=a[f](u,f,l,i,null,r)}catch(E){p=E}if(p&&!(p instanceof Error)&&e((l||"React class")+": type specification of "+i+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in n)){n[p.message]=!0;var m=c?c():"";e("Failed "+i+" type: "+p.message+(m??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ht=o,ht}var pt,Rt;function Gt(){if(Rt)return pt;Rt=1;var e=kt(),r=Xt(),n=_t(),t=Wt(),o=Jt(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(i){var l="Warning: "+i;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function u(){return null}return pt=function(i,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function p(s){var y=s&&(c&&s[c]||s[f]);if(typeof y=="function")return y}var v="<<anonymous>>",m={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:W(),arrayOf:I,element:A(),elementType:d(),instanceOf:V,node:q(),objectOf:Q,oneOf:X,oneOfType:tt,shape:U,exact:J};function E(s,y){return s===y?s!==0||1/s===1/y:s!==s&&y!==y}function g(s,y){this.message=s,this.data=y&&typeof y=="object"?y:{},this.stack=""}g.prototype=Error.prototype;function b(s){if(process.env.NODE_ENV!=="production")var y={},S=0;function P(C,x,T,O,D,R,$){if(O=O||v,R=R||T,$!==n){if(l){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var F=O+":"+T;!y[F]&&S<3&&(a("You are manually calling a React.PropTypes validation function for the `"+R+"` prop on `"+O+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),y[F]=!0,S++)}}return x[T]==null?C?x[T]===null?new g("The "+D+" `"+R+"` is marked as required "+("in `"+O+"`, but its value is `null`.")):new g("The "+D+" `"+R+"` is marked as required in "+("`"+O+"`, but its value is `undefined`.")):null:s(x,T,O,D,R)}var _=P.bind(null,!1);return _.isRequired=P.bind(null,!0),_}function w(s){function y(S,P,_,C,x,T){var O=S[P],D=B(O);if(D!==s){var R=G(O);return new g("Invalid "+C+" `"+x+"` of type "+("`"+R+"` supplied to `"+_+"`, expected ")+("`"+s+"`."),{expectedType:s})}return null}return b(y)}function W(){return b(u)}function I(s){function y(S,P,_,C,x){if(typeof s!="function")return new g("Property `"+x+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var T=S[P];if(!Array.isArray(T)){var O=B(T);return new g("Invalid "+C+" `"+x+"` of type "+("`"+O+"` supplied to `"+_+"`, expected an array."))}for(var D=0;D<T.length;D++){var R=s(T,D,_,C,x+"["+D+"]",n);if(R instanceof Error)return R}return null}return b(y)}function A(){function s(y,S,P,_,C){var x=y[S];if(!i(x)){var T=B(x);return new g("Invalid "+_+" `"+C+"` of type "+("`"+T+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return b(s)}function d(){function s(y,S,P,_,C){var x=y[S];if(!e.isValidElementType(x)){var T=B(x);return new g("Invalid "+_+" `"+C+"` of type "+("`"+T+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return b(s)}function V(s){function y(S,P,_,C,x){if(!(S[P]instanceof s)){var T=s.name||v,O=ut(S[P]);return new g("Invalid "+C+" `"+x+"` of type "+("`"+O+"` supplied to `"+_+"`, expected ")+("instance of `"+T+"`."))}return null}return b(y)}function X(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),u;function y(S,P,_,C,x){for(var T=S[P],O=0;O<s.length;O++)if(E(T,s[O]))return null;var D=JSON.stringify(s,function($,h){var F=G(h);return F==="symbol"?String(h):h});return new g("Invalid "+C+" `"+x+"` of value `"+String(T)+"` "+("supplied to `"+_+"`, expected one of "+D+"."))}return b(y)}function Q(s){function y(S,P,_,C,x){if(typeof s!="function")return new g("Property `"+x+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var T=S[P],O=B(T);if(O!=="object")return new g("Invalid "+C+" `"+x+"` of type "+("`"+O+"` supplied to `"+_+"`, expected an object."));for(var D in T)if(t(T,D)){var R=s(T,D,_,C,x+"."+D,n);if(R instanceof Error)return R}return null}return b(y)}function tt(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var y=0;y<s.length;y++){var S=s[y];if(typeof S!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+et(S)+" at index "+y+"."),u}function P(_,C,x,T,O){for(var D=[],R=0;R<s.length;R++){var $=s[R],h=$(_,C,x,T,O,n);if(h==null)return null;h.data&&t(h.data,"expectedType")&&D.push(h.data.expectedType)}var F=D.length>0?", expected one of type ["+D.join(", ")+"]":"";return new g("Invalid "+T+" `"+O+"` supplied to "+("`"+x+"`"+F+"."))}return b(P)}function q(){function s(y,S,P,_,C){return Z(y[S])?null:new g("Invalid "+_+" `"+C+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return b(s)}function H(s,y,S,P,_){return new g((s||"React class")+": "+y+" type `"+S+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+_+"`.")}function U(s){function y(S,P,_,C,x){var T=S[P],O=B(T);if(O!=="object")return new g("Invalid "+C+" `"+x+"` of type `"+O+"` "+("supplied to `"+_+"`, expected `object`."));for(var D in s){var R=s[D];if(typeof R!="function")return H(_,C,x,D,G(R));var $=R(T,D,_,C,x+"."+D,n);if($)return $}return null}return b(y)}function J(s){function y(S,P,_,C,x){var T=S[P],O=B(T);if(O!=="object")return new g("Invalid "+C+" `"+x+"` of type `"+O+"` "+("supplied to `"+_+"`, expected `object`."));var D=r({},S[P],s);for(var R in D){var $=s[R];if(t(s,R)&&typeof $!="function")return H(_,C,x,R,G($));if(!$)return new g("Invalid "+C+" `"+x+"` key `"+R+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(S[P],null," ")+`
2
+ Valid keys: `+JSON.stringify(Object.keys(s),null," "));var h=$(T,R,_,C,x+"."+R,n);if(h)return h}return null}return b(y)}function Z(s){switch(typeof s){case"number":case"string":case"undefined":return!0;case"boolean":return!s;case"object":if(Array.isArray(s))return s.every(Z);if(s===null||i(s))return!0;var y=p(s);if(y){var S=y.call(s),P;if(y!==s.entries){for(;!(P=S.next()).done;)if(!Z(P.value))return!1}else for(;!(P=S.next()).done;){var _=P.value;if(_&&!Z(_[1]))return!1}}else return!1;return!0;default:return!1}}function ct(s,y){return s==="symbol"?!0:y?y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&y instanceof Symbol:!1}function B(s){var y=typeof s;return Array.isArray(s)?"array":s instanceof RegExp?"object":ct(y,s)?"symbol":y}function G(s){if(typeof s>"u"||s===null)return""+s;var y=B(s);if(y==="object"){if(s instanceof Date)return"date";if(s instanceof RegExp)return"regexp"}return y}function et(s){var y=G(s);switch(y){case"array":case"object":return"an "+y;case"boolean":case"date":case"regexp":return"a "+y;default:return y}}function ut(s){return!s.constructor||!s.constructor.name?v:s.constructor.name}return m.checkPropTypes=o,m.resetWarningCache=o.resetWarningCache,m.PropTypes=m,m},pt}var vt,Mt;function Kt(){if(Mt)return vt;Mt=1;var e=_t();function r(){}function n(){}return n.resetWarningCache=r,vt=function(){function t(u,i,l,c,f,p){if(p!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}t.isRequired=t;function o(){return t}var a={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:o,element:t,elementType:t,instanceOf:o,node:t,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:r};return a.PropTypes=a,a},vt}var jt;function Zt(){if(jt)return nt.exports;if(jt=1,process.env.NODE_ENV!=="production"){var e=kt(),r=!0;nt.exports=Gt()(e.isElement,r)}else nt.exports=Kt()();return nt.exports}var Qt=Zt();const L=Dt.getDefaultExportFromCjs(Qt);function K(e,r,n){this.x=e,this.y=r,this.time=n||new Date().getTime()}K.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):1};K.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))};K.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time};function bt(e,r,n,t){this.startPoint=e,this.control1=r,this.control2=n,this.endPoint=t}bt.prototype.length=function(){for(var e=10,r=0,n=void 0,t=void 0,o=0;o<=e;o+=1){var a=o/e,u=this._point(a,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),i=this._point(a,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(o>0){var l=u-n,c=i-t;r+=Math.sqrt(l*l+c*c)}n=u,t=i}return r};bt.prototype._point=function(e,r,n,t,o){return r*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*t*(1-e)*e*e+o*e*e*e};function te(e,r,n){var t,o,a,u=null,i=0;n||(n={});var l=function(){i=n.leading===!1?0:Date.now(),u=null,a=e.apply(t,o),u||(t=o=null)};return function(){var c=Date.now();!i&&n.leading===!1&&(i=c);var f=r-(c-i);return t=this,o=arguments,f<=0||f>r?(u&&(clearTimeout(u),u=null),i=c,a=e.apply(t,o),u||(t=o=null)):!u&&n.trailing!==!1&&(u=setTimeout(l,f)),a}}function k(e,r){var n=this,t=r||{};this.velocityFilterWeight=t.velocityFilterWeight||.7,this.minWidth=t.minWidth||.5,this.maxWidth=t.maxWidth||2.5,this.throttle="throttle"in t?t.throttle:16,this.minDistance="minDistance"in t?t.minDistance:5,this.throttle?this._strokeMoveUpdate=te(k.prototype._strokeUpdate,this.throttle):this._strokeMoveUpdate=k.prototype._strokeUpdate,this.dotSize=t.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=t.penColor||"black",this.backgroundColor=t.backgroundColor||"rgba(0,0,0,0)",this.onBegin=t.onBegin,this.onEnd=t.onEnd,this._canvas=e,this._ctx=e.getContext("2d"),this.clear(),this._handleMouseDown=function(o){o.which===1&&(n._mouseButtonDown=!0,n._strokeBegin(o))},this._handleMouseMove=function(o){n._mouseButtonDown&&n._strokeMoveUpdate(o)},this._handleMouseUp=function(o){o.which===1&&n._mouseButtonDown&&(n._mouseButtonDown=!1,n._strokeEnd(o))},this._handleTouchStart=function(o){if(o.targetTouches.length===1){var a=o.changedTouches[0];n._strokeBegin(a)}},this._handleTouchMove=function(o){o.preventDefault();var a=o.targetTouches[0];n._strokeMoveUpdate(a)},this._handleTouchEnd=function(o){var a=o.target===n._canvas;a&&(o.preventDefault(),n._strokeEnd(o))},this.on()}k.prototype.clear=function(){var e=this._ctx,r=this._canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,r.width,r.height),e.fillRect(0,0,r.width,r.height),this._data=[],this._reset(),this._isEmpty=!0};k.prototype.fromDataURL=function(e){var r=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=new Image,o=n.ratio||window.devicePixelRatio||1,a=n.width||this._canvas.width/o,u=n.height||this._canvas.height/o;this._reset(),t.src=e,t.onload=function(){r._ctx.drawImage(t,0,0,a,u)},this._isEmpty=!1};k.prototype.toDataURL=function(e){var r;switch(e){case"image/svg+xml":return this._toSVG();default:for(var n=arguments.length,t=Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];return(r=this._canvas).toDataURL.apply(r,[e].concat(t))}};k.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()};k.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)};k.prototype.isEmpty=function(){return this._isEmpty};k.prototype._strokeBegin=function(e){this._data.push([]),this._reset(),this._strokeUpdate(e),typeof this.onBegin=="function"&&this.onBegin(e)};k.prototype._strokeUpdate=function(e){var r=e.clientX,n=e.clientY,t=this._createPoint(r,n),o=this._data[this._data.length-1],a=o&&o[o.length-1],u=a&&t.distanceTo(a)<this.minDistance;if(!(a&&u)){var i=this._addPoint(t),l=i.curve,c=i.widths;l&&c&&this._drawCurve(l,c.start,c.end),this._data[this._data.length-1].push({x:t.x,y:t.y,time:t.time,color:this.penColor})}};k.prototype._strokeEnd=function(e){var r=this.points.length>2,n=this.points[0];if(!r&&n&&this._drawDot(n),n){var t=this._data[this._data.length-1],o=t[t.length-1];n.equals(o)||t.push({x:n.x,y:n.y,time:n.time,color:this.penColor})}typeof this.onEnd=="function"&&this.onEnd(e)};k.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)};k.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)};k.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor};k.prototype._createPoint=function(e,r,n){var t=this._canvas.getBoundingClientRect();return new K(e-t.left,r-t.top,n||new Date().getTime())};k.prototype._addPoint=function(e){var r=this.points,n=void 0;if(r.push(e),r.length>2){r.length===3&&r.unshift(r[0]),n=this._calculateCurveControlPoints(r[0],r[1],r[2]);var t=n.c2;n=this._calculateCurveControlPoints(r[1],r[2],r[3]);var o=n.c1,a=new bt(r[1],t,o,r[2]),u=this._calculateCurveWidths(a);return r.shift(),{curve:a,widths:u}}return{}};k.prototype._calculateCurveControlPoints=function(e,r,n){var t=e.x-r.x,o=e.y-r.y,a=r.x-n.x,u=r.y-n.y,i={x:(e.x+r.x)/2,y:(e.y+r.y)/2},l={x:(r.x+n.x)/2,y:(r.y+n.y)/2},c=Math.sqrt(t*t+o*o),f=Math.sqrt(a*a+u*u),p=i.x-l.x,v=i.y-l.y,m=f/(c+f),E={x:l.x+p*m,y:l.y+v*m},g=r.x-E.x,b=r.y-E.y;return{c1:new K(i.x+g,i.y+b),c2:new K(l.x+g,l.y+b)}};k.prototype._calculateCurveWidths=function(e){var r=e.startPoint,n=e.endPoint,t={start:null,end:null},o=this.velocityFilterWeight*n.velocityFrom(r)+(1-this.velocityFilterWeight)*this._lastVelocity,a=this._strokeWidth(o);return t.start=this._lastWidth,t.end=a,this._lastVelocity=o,this._lastWidth=a,t};k.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)};k.prototype._drawPoint=function(e,r,n){var t=this._ctx;t.moveTo(e,r),t.arc(e,r,n,0,2*Math.PI,!1),this._isEmpty=!1};k.prototype._drawCurve=function(e,r,n){var t=this._ctx,o=n-r,a=Math.floor(e.length());t.beginPath();for(var u=0;u<a;u+=1){var i=u/a,l=i*i,c=l*i,f=1-i,p=f*f,v=p*f,m=v*e.startPoint.x;m+=3*p*i*e.control1.x,m+=3*f*l*e.control2.x,m+=c*e.endPoint.x;var E=v*e.startPoint.y;E+=3*p*i*e.control1.y,E+=3*f*l*e.control2.y,E+=c*e.endPoint.y;var g=r+c*o;this._drawPoint(m,E,g)}t.closePath(),t.fill()};k.prototype._drawDot=function(e){var r=this._ctx,n=typeof this.dotSize=="function"?this.dotSize():this.dotSize;r.beginPath(),this._drawPoint(e.x,e.y,n),r.closePath(),r.fill()};k.prototype._fromData=function(e,r,n){for(var t=0;t<e.length;t+=1){var o=e[t];if(o.length>1)for(var a=0;a<o.length;a+=1){var u=o[a],i=new K(u.x,u.y,u.time),l=u.color;if(a===0)this.penColor=l,this._reset(),this._addPoint(i);else if(a!==o.length-1){var c=this._addPoint(i),f=c.curve,p=c.widths;f&&p&&r(f,p,l)}}else{this._reset();var v=o[0];n(v)}}};k.prototype._toSVG=function(){var e=this,r=this._data,n=this._canvas,t=Math.max(window.devicePixelRatio||1,1),o=0,a=0,u=n.width/t,i=n.height/t,l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttributeNS(null,"width",n.width),l.setAttributeNS(null,"height",n.height),this._fromData(r,function(w,W,I){var A=document.createElement("path");if(!isNaN(w.control1.x)&&!isNaN(w.control1.y)&&!isNaN(w.control2.x)&&!isNaN(w.control2.y)){var d="M "+w.startPoint.x.toFixed(3)+","+w.startPoint.y.toFixed(3)+" "+("C "+w.control1.x.toFixed(3)+","+w.control1.y.toFixed(3)+" ")+(w.control2.x.toFixed(3)+","+w.control2.y.toFixed(3)+" ")+(w.endPoint.x.toFixed(3)+","+w.endPoint.y.toFixed(3));A.setAttribute("d",d),A.setAttribute("stroke-width",(W.end*2.25).toFixed(3)),A.setAttribute("stroke",I),A.setAttribute("fill","none"),A.setAttribute("stroke-linecap","round"),l.appendChild(A)}},function(w){var W=document.createElement("circle"),I=typeof e.dotSize=="function"?e.dotSize():e.dotSize;W.setAttribute("r",I),W.setAttribute("cx",w.x),W.setAttribute("cy",w.y),W.setAttribute("fill",w.color),l.appendChild(W)});var c="data:image/svg+xml;base64,",f='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"'+(' viewBox="'+o+" "+a+" "+u+" "+i+'"')+(' width="'+u+'"')+(' height="'+i+'"')+">",p=l.innerHTML;if(p===void 0){var v=document.createElement("dummy"),m=l.childNodes;v.innerHTML="";for(var E=0;E<m.length;E+=1)v.appendChild(m[E].cloneNode(!0));p=v.innerHTML}var g="</svg>",b=f+p+g;return c+btoa(b)};k.prototype.fromData=function(e){var r=this;this.clear(),this._fromData(e,function(n,t){return r._drawCurve(n,t.start,t.end)},function(n){return r._drawDot(n)}),this._data=e};k.prototype.toData=function(){return this._data};var it={exports:{}},ee=it.exports,At;function re(){return At||(At=1,(function(e,r){(function(n,t){e.exports=t()})(ee,function(){return(function(n){function t(a){if(o[a])return o[a].exports;var u=o[a]={exports:{},id:a,loaded:!1};return n[a].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var o={};return t.m=n,t.c=o,t.p="",t(0)})([function(n,t){function o(c){var f=c.getContext("2d"),p=c.width,v=c.height,m=f.getImageData(0,0,p,v).data,E=i(!0,p,v,m),g=i(!1,p,v,m),b=l(!0,p,v,m),w=l(!1,p,v,m),W=w-b+1,I=g-E+1,A=f.getImageData(b,E,W,I);return c.width=W,c.height=I,f.clearRect(0,0,W,I),f.putImageData(A,0,0),c}function a(c,f,p,v){return{red:v[4*(p*f+c)],green:v[4*(p*f+c)+1],blue:v[4*(p*f+c)+2],alpha:v[4*(p*f+c)+3]}}function u(c,f,p,v){return a(c,f,p,v).alpha}function i(c,f,p,v){for(var m=c?1:-1,E=c?0:p-1,g=E;c?g<p:g>-1;g+=m)for(var b=0;b<f;b++)if(u(b,g,f,v))return g;return null}function l(c,f,p,v){for(var m=c?1:-1,E=c?0:f-1,g=E;c?g<f:g>-1;g+=m)for(var b=0;b<p;b++)if(u(g,b,f,v))return g;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o}])})})(it)),it.exports}var ne=re();const oe=Dt.getDefaultExportFromCjs(ne);var ie=["canvasProps","clearOnResize"],st=(function(e){Bt(n,e);var r=Nt(n);function n(){var t;Ut(this,n);for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return t=r.call.apply(r,[this].concat(a)),t.staticThis=t.constructor,t._sigPad=null,t._canvas=null,t.setRef=function(i){t._canvas=i,t._canvas===null&&(t._sigPad=null)},t._excludeOurProps=function(){var i=t.props;i.canvasProps,i.clearOnResize;var l=zt(i,ie);return l},t.componentDidMount=function(){var i=t.getCanvas();t._sigPad=new k(i,t._excludeOurProps()),t._resizeCanvas(),t.on()},t.componentWillUnmount=function(){t.off()},t.componentDidUpdate=function(){Object.assign(t._sigPad,t._excludeOurProps())},t.getCanvas=function(){if(t._canvas===null)throw t.staticThis.refNullError;return t._canvas},t.getTrimmedCanvas=function(){var i=t.getCanvas(),l=document.createElement("canvas");return l.width=i.width,l.height=i.height,l.getContext("2d").drawImage(i,0,0),oe(l)},t.getSignaturePad=function(){if(t._sigPad===null)throw t.staticThis.refNullError;return t._sigPad},t._checkClearOnResize=function(){t.props.clearOnResize&&t._resizeCanvas()},t._resizeCanvas=function(){var i,l,c=(i=t.props.canvasProps)!==null&&i!==void 0?i:{},f=c.width,p=c.height;if(!(typeof f<"u"&&typeof p<"u")){var v=t.getCanvas(),m=Math.max((l=window.devicePixelRatio)!==null&&l!==void 0?l:1,1);typeof f>"u"&&(v.width=v.offsetWidth*m),typeof p>"u"&&(v.height=v.offsetHeight*m),v.getContext("2d").scale(m,m),t.clear()}},t.render=function(){var i=t.props.canvasProps;return N.createElement("canvas",yt({ref:t.setRef},i))},t.on=function(){return window.addEventListener("resize",t._checkClearOnResize),t.getSignaturePad().on()},t.off=function(){return window.removeEventListener("resize",t._checkClearOnResize),t.getSignaturePad().off()},t.clear=function(){return t.getSignaturePad().clear()},t.isEmpty=function(){return t.getSignaturePad().isEmpty()},t.fromDataURL=function(i,l){return t.getSignaturePad().fromDataURL(i,l)},t.toDataURL=function(i,l){return t.getSignaturePad().toDataURL(i,l)},t.fromData=function(i){return t.getSignaturePad().fromData(i)},t.toData=function(){return t.getSignaturePad().toData()},t}return qt(n)})(N.Component);st.propTypes={velocityFilterWeight:L.number,minWidth:L.number,maxWidth:L.number,minDistance:L.number,dotSize:L.oneOfType([L.number,L.func]),penColor:L.string,throttle:L.number,onEnd:L.func,onBegin:L.func,canvasProps:L.object,clearOnResize:L.bool};st.defaultProps={clearOnResize:!0};st.refNullError=new Error("react-signature-canvas is currently mounting or unmounting: React refs are null during this phase.");function ae({attributes:e={},rules:r={},onChange:n}){const{id:t="",MuiAttributes:o={},label:a="Signature",bucket:u="",region:i="",identityPoolId:l="",path:c="",disabled:f=!1,CanvasProps:p={}}=e,v=N.useRef(null),m=N.useRef(null),[E,g]=N.useState(!1),[b,w]=N.useState(e.value||null),[W,I]=N.useState(400),[A,d]=N.useState(!1),V=r?.validation?.some(q=>q.rule==="mandatory")||!1,X=p?.style?.height||150;N.useEffect(()=>{const q=m.current;if(!q)return;const H=new ResizeObserver(U=>{const J=U[0]?.contentRect?.width;J&&J>0&&I(Math.floor(J))});return H.observe(q),()=>H.disconnect()},[]),N.useEffect(()=>{if(!e.value){w(null),d(!1),v.current&&v.current.clear();return}w(e.value)},[e.value]);const Q=()=>{v.current&&v.current.clear(),w(null),d(!1),n&&n({id:t,value:""})},tt=async()=>{if(!v.current||v.current.isEmpty())return;g(!0);const q=v.current.toDataURL("image/png"),H=`${t}-${Date.now()}.png`;try{const U=await $t.uploadToS3(q,H,u,i,l,c);w(U),d(!0),n&&n({id:t,value:U})}catch(U){console.error("Signature upload failed",U)}finally{g(!1)}};return z.jsxs(Y.Box,{sx:{width:"100%",...o.sx},children:[z.jsxs(Y.Typography,{variant:"subtitle2",gutterBottom:!0,sx:{display:"flex"},children:[a,V&&z.jsx(Y.Box,{component:"span",sx:{color:"error.main",ml:.5},children:"*"})]}),z.jsxs(Y.Box,{ref:m,sx:{position:"relative",isolation:"isolate",zIndex:1,border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",bgcolor:"background.paper"},children:[z.jsx(st,{ref:v,penColor:"black",canvasProps:{className:"sigCanvas",width:W,height:X,style:{display:"block",position:"relative",zIndex:1,touchAction:"none",pointerEvents:f?"none":"auto",...p?.style,width:"100%",height:X}},backgroundColor:"transparent"}),b&&z.jsx(Y.Box,{component:"img",src:b,alt:"Signature",sx:{position:"absolute",inset:0,width:"100%",height:X,objectFit:"contain",bgcolor:"background.paper"}})]}),z.jsxs(Y.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1,alignItems:"center",mt:1},children:[z.jsx(Y.Button,{variant:"outlined",color:"secondary",onClick:Q,size:"small",disabled:f||E,children:"Clear"}),z.jsx(Y.Button,{variant:"contained",color:"primary",onClick:tt,size:"small",disabled:f||E||b!==null,startIcon:E?z.jsx(Y.CircularProgress,{size:16,color:"inherit"}):null,children:b?"Saved":"Save"}),A&&b&&z.jsx(Y.Typography,{variant:"caption",color:"success.main",children:"Signature Saved!"})]})]})}exports.default=ae;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),S=require("react"),l=require("@mui/material"),x=require("./index-D08GIfqF.js");function M({components:t=[],onUpdate:r}){return n.jsx(n.Fragment,{children:t.map((p,o)=>{const a=x.mui[p.type];if(!a)return null;const E=x.Controls_default[a.map];if(!E)return null;const u=p.id||p.props?.id||`stepper-comp-${o}`;return n.jsx(E,{attributes:p.props,onChange:r},u)})})}const b={activeStep:0,stepperResponse:{},MuiSteps:[]},P=(t,r)=>{const{type:p,payload:o}=r;switch(p){case"SET_STEPS":return{...t,MuiSteps:o.MuiSteps};case"SET_STEP":return{...t,activeStep:o.currentStep};case"UPDATE_RESPONSE":return{...t,stepperResponse:{...t.stepperResponse,[o.id]:o.value}};case"CHANGE_STEP":return{...t,activeStep:t.activeStep+o.stepChange};default:return t}};function T({attributes:t={},onChange:r,onStepUpdate:p,currentStep:o=0,patch:a={}}){const[E,u]=S.useReducer(P,b,()=>({activeStep:o,stepperResponse:a,MuiSteps:t.MuiSteps||[]})),{activeStep:y,stepperResponse:c,MuiSteps:d}=E;S.useEffect(()=>{u({type:"SET_STEP",payload:{currentStep:o}})},[o]),S.useEffect(()=>{a&&Object.keys(a).length>0&&Object.entries(a).forEach(([e,s])=>{c[e]!==s&&u({type:"UPDATE_RESPONSE",payload:{id:e,value:s}})})},[a]),S.useEffect(()=>{d.forEach(e=>{(e.components||[]).forEach(s=>{const i=s.id||s.props?.id;i&&s.props?.value!==void 0&&c[i]===void 0&&(u({type:"UPDATE_RESPONSE",payload:{id:i,value:s.props.value}}),r&&r({id:i,value:s.props.value}))})})},[]);const m=S.useCallback((e,s,i)=>{u({type:"CHANGE_STEP",payload:{stepChange:e}});const f=y+e;p&&p(f,s&&e>0,i),i&&r&&t.id&&r({id:t.id,value:c})},[y,t.id,r,p,c]),h=S.useCallback(({id:e,value:s})=>{u({type:"UPDATE_RESPONSE",payload:{id:e,value:s}}),r&&r({id:e,value:s})},[r]),v=(e=[],s=[])=>e.some(i=>!c[i])||s.some(i=>c[i.key]===i.value&&i.mandatoryIds.some(f=>!c[f])),j=(e,s,i,f)=>n.jsxs(l.Box,{sx:{mb:2},children:[n.jsx(l.Button,{variant:"contained",onClick:()=>m(1,s,e===d.length-1),disabled:v(i,f),sx:{mt:1,mr:1},...t.MuiButtonAttributes?.next,...e===d.length-1&&{...t.MuiButtonAttributes?.final},children:e===d.length-1?"Finish":"Continue"}),n.jsx(l.Button,{disabled:e===0,onClick:()=>m(-1,s,!1),sx:{mt:1,mr:1},...t.MuiButtonAttributes?.back,children:"Back"})]});return n.jsx(l.Box,{sx:{maxWidth:400},...t.MuiBoxAttributes,children:n.jsx(l.Stepper,{activeStep:y,orientation:"vertical",...t.MuiStepperAttributes,children:d.map((e,s)=>n.jsxs(l.Step,{...t.MuiStepAttributes,children:[n.jsx(l.StepLabel,{optional:s===d.length-1&&n.jsx(l.Typography,{variant:"caption",children:"Last step"}),...t.MuiStepLabelAttributes,children:e.label}),n.jsxs(l.StepContent,{...t.MuiStepContentAttributes,children:[e.components?n.jsx(M,{onUpdate:h,components:x.updatePatchData(e.components,{...c},"",{},e.enableDisableIds)}):n.jsx(l.Typography,{children:e.description}),j(s,e.isScreenChange,e.mandatoryIds,e.optionalMandatoryIds)]})]},e.label))})})}exports.default=T;
@@ -0,0 +1,140 @@
1
+ import { jsx as s, Fragment as R, jsxs as E } from "react/jsx-runtime";
2
+ import { useReducer as _, useEffect as m, useCallback as h } from "react";
3
+ import { Box as v, Stepper as B, Step as x, StepLabel as C, Typography as M, StepContent as D, Button as A } from "@mui/material";
4
+ import { h as k, C as I, i as N } from "./index-CddjLTWF.mjs";
5
+ function O({ components: t = [], onUpdate: o }) {
6
+ return /* @__PURE__ */ s(R, { children: t.map((p, r) => {
7
+ const a = k[p.type];
8
+ if (!a) return null;
9
+ const S = I[a.map];
10
+ if (!S) return null;
11
+ const d = p.id || p.props?.id || `stepper-comp-${r}`;
12
+ return /* @__PURE__ */ s(
13
+ S,
14
+ {
15
+ attributes: p.props,
16
+ onChange: o
17
+ },
18
+ d
19
+ );
20
+ }) });
21
+ }
22
+ const j = { activeStep: 0, stepperResponse: {}, MuiSteps: [] }, U = (t, o) => {
23
+ const { type: p, payload: r } = o;
24
+ switch (p) {
25
+ case "SET_STEPS":
26
+ return { ...t, MuiSteps: r.MuiSteps };
27
+ case "SET_STEP":
28
+ return { ...t, activeStep: r.currentStep };
29
+ case "UPDATE_RESPONSE":
30
+ return {
31
+ ...t,
32
+ stepperResponse: { ...t.stepperResponse, [r.id]: r.value }
33
+ };
34
+ case "CHANGE_STEP":
35
+ return { ...t, activeStep: t.activeStep + r.stepChange };
36
+ default:
37
+ return t;
38
+ }
39
+ };
40
+ function H({ attributes: t = {}, onChange: o, onStepUpdate: p, currentStep: r = 0, patch: a = {} }) {
41
+ const [S, d] = _(U, j, () => ({
42
+ activeStep: r,
43
+ stepperResponse: a,
44
+ MuiSteps: t.MuiSteps || []
45
+ })), { activeStep: f, stepperResponse: l, MuiSteps: c } = S;
46
+ m(() => {
47
+ d({ type: "SET_STEP", payload: { currentStep: r } });
48
+ }, [r]), m(() => {
49
+ a && Object.keys(a).length > 0 && Object.entries(a).forEach(([e, i]) => {
50
+ l[e] !== i && d({ type: "UPDATE_RESPONSE", payload: { id: e, value: i } });
51
+ });
52
+ }, [a]), m(() => {
53
+ c.forEach((e) => {
54
+ (e.components || []).forEach((i) => {
55
+ const n = i.id || i.props?.id;
56
+ n && i.props?.value !== void 0 && l[n] === void 0 && (d({ type: "UPDATE_RESPONSE", payload: { id: n, value: i.props.value } }), o && o({ id: n, value: i.props.value }));
57
+ });
58
+ });
59
+ }, []);
60
+ const y = h(
61
+ (e, i, n) => {
62
+ d({ type: "CHANGE_STEP", payload: { stepChange: e } });
63
+ const u = f + e;
64
+ p && p(u, i && e > 0, n), n && o && t.id && o({ id: t.id, value: l });
65
+ },
66
+ [f, t.id, o, p, l]
67
+ ), P = h(
68
+ ({ id: e, value: i }) => {
69
+ d({ type: "UPDATE_RESPONSE", payload: { id: e, value: i } }), o && o({ id: e, value: i });
70
+ },
71
+ [o]
72
+ ), T = (e = [], i = []) => e.some((n) => !l[n]) || i.some(
73
+ (n) => l[n.key] === n.value && n.mandatoryIds.some((u) => !l[u])
74
+ ), b = (e, i, n, u) => /* @__PURE__ */ E(v, { sx: { mb: 2 }, children: [
75
+ /* @__PURE__ */ s(
76
+ A,
77
+ {
78
+ variant: "contained",
79
+ onClick: () => y(1, i, e === c.length - 1),
80
+ disabled: T(n, u),
81
+ sx: { mt: 1, mr: 1 },
82
+ ...t.MuiButtonAttributes?.next,
83
+ ...e === c.length - 1 && { ...t.MuiButtonAttributes?.final },
84
+ children: e === c.length - 1 ? "Finish" : "Continue"
85
+ }
86
+ ),
87
+ /* @__PURE__ */ s(
88
+ A,
89
+ {
90
+ disabled: e === 0,
91
+ onClick: () => y(-1, i, !1),
92
+ sx: { mt: 1, mr: 1 },
93
+ ...t.MuiButtonAttributes?.back,
94
+ children: "Back"
95
+ }
96
+ )
97
+ ] });
98
+ return /* @__PURE__ */ s(v, { sx: { maxWidth: 400 }, ...t.MuiBoxAttributes, children: /* @__PURE__ */ s(
99
+ B,
100
+ {
101
+ activeStep: f,
102
+ orientation: "vertical",
103
+ ...t.MuiStepperAttributes,
104
+ children: c.map((e, i) => /* @__PURE__ */ E(x, { ...t.MuiStepAttributes, children: [
105
+ /* @__PURE__ */ s(
106
+ C,
107
+ {
108
+ optional: i === c.length - 1 && /* @__PURE__ */ s(M, { variant: "caption", children: "Last step" }),
109
+ ...t.MuiStepLabelAttributes,
110
+ children: e.label
111
+ }
112
+ ),
113
+ /* @__PURE__ */ E(D, { ...t.MuiStepContentAttributes, children: [
114
+ e.components ? /* @__PURE__ */ s(
115
+ O,
116
+ {
117
+ onUpdate: P,
118
+ components: N(
119
+ e.components,
120
+ { ...l },
121
+ "",
122
+ {},
123
+ e.enableDisableIds
124
+ )
125
+ }
126
+ ) : /* @__PURE__ */ s(M, { children: e.description }),
127
+ b(
128
+ i,
129
+ e.isScreenChange,
130
+ e.mandatoryIds,
131
+ e.optionalMandatoryIds
132
+ )
133
+ ] })
134
+ ] }, e.label))
135
+ }
136
+ ) });
137
+ }
138
+ export {
139
+ H as default
140
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),o=require("@mui/material/Box"),n=require("@mui/material/Typography"),s=require("./index-D08GIfqF.js"),c=r=>r==null?"":Array.isArray(r)?r.map(c).join(", "):typeof r=="object"?JSON.stringify(r):String(r),j=r=>r==null?!0:Array.isArray(r)?r.length===0:typeof r=="string"?r.trim()==="":typeof r=="object"?Object.keys(r).length===0:!1;function h({attributes:r={}}){const{id:p="",guid:a,data:l,title:x="Summary",labels:m={},hideEmpty:u=!1,MuiAttributes:d={}}=r,y=l??s.FormData(a)??{},f=Object.entries(y).filter(([,t])=>!(u&&j(t)));return e.jsxs(o,{id:p,...d,sx:s.mergeSx(t=>({...s.premiumSurfaceSx(t),p:0}),d.sx),children:[e.jsx(o,{sx:t=>({px:2,py:1.5,borderBottom:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.action.hover}),children:e.jsx(n,{variant:"subtitle1",sx:{fontWeight:600},children:x})}),e.jsx(o,{component:"dl",sx:{m:0,display:"grid",gridTemplateColumns:"minmax(30%, auto) 1fr",columnGap:2,rowGap:0},children:f.map(([t,g])=>e.jsxs(b.Fragment,{children:[e.jsx(n,{component:"dt",variant:"body2",sx:i=>({px:2,py:1,color:i.palette.text.secondary,fontWeight:500,borderBottom:`1px solid ${i.palette.divider}`}),children:m[t]??t}),e.jsx(n,{component:"dd",variant:"body2",sx:i=>({m:0,px:2,py:1,color:i.palette.text.primary,borderBottom:`1px solid ${i.palette.divider}`,wordBreak:"break-word"}),children:c(g)})]},t))})]})}exports.default=h;
@@ -0,0 +1,96 @@
1
+ import { jsxs as p, jsx as i } from "react/jsx-runtime";
2
+ import u from "react";
3
+ import e from "@mui/material/Box";
4
+ import n from "@mui/material/Typography";
5
+ import { m as h, b as j, e as S } from "./index-CddjLTWF.mjs";
6
+ const s = (r) => r == null ? "" : Array.isArray(r) ? r.map(s).join(", ") : typeof r == "object" ? JSON.stringify(r) : String(r), A = (r) => r == null ? !0 : Array.isArray(r) ? r.length === 0 : typeof r == "string" ? r.trim() === "" : typeof r == "object" ? Object.keys(r).length === 0 : !1;
7
+ function k({ attributes: r = {} }) {
8
+ const {
9
+ id: a = "",
10
+ guid: m,
11
+ data: c,
12
+ title: l = "Summary",
13
+ labels: f = {},
14
+ hideEmpty: x = !1,
15
+ MuiAttributes: d = {}
16
+ } = r, y = c ?? S(m) ?? {}, b = Object.entries(y).filter(
17
+ ([, t]) => !(x && A(t))
18
+ );
19
+ return /* @__PURE__ */ p(
20
+ e,
21
+ {
22
+ id: a,
23
+ ...d,
24
+ sx: h(
25
+ (t) => ({
26
+ ...j(t),
27
+ p: 0
28
+ }),
29
+ d.sx
30
+ ),
31
+ children: [
32
+ /* @__PURE__ */ i(
33
+ e,
34
+ {
35
+ sx: (t) => ({
36
+ px: 2,
37
+ py: 1.5,
38
+ borderBottom: `1px solid ${t.palette.divider}`,
39
+ backgroundColor: t.palette.action.hover
40
+ }),
41
+ children: /* @__PURE__ */ i(n, { variant: "subtitle1", sx: { fontWeight: 600 }, children: l })
42
+ }
43
+ ),
44
+ /* @__PURE__ */ i(
45
+ e,
46
+ {
47
+ component: "dl",
48
+ sx: {
49
+ m: 0,
50
+ display: "grid",
51
+ gridTemplateColumns: "minmax(30%, auto) 1fr",
52
+ columnGap: 2,
53
+ rowGap: 0
54
+ },
55
+ children: b.map(([t, g]) => /* @__PURE__ */ p(u.Fragment, { children: [
56
+ /* @__PURE__ */ i(
57
+ n,
58
+ {
59
+ component: "dt",
60
+ variant: "body2",
61
+ sx: (o) => ({
62
+ px: 2,
63
+ py: 1,
64
+ color: o.palette.text.secondary,
65
+ fontWeight: 500,
66
+ borderBottom: `1px solid ${o.palette.divider}`
67
+ }),
68
+ children: f[t] ?? t
69
+ }
70
+ ),
71
+ /* @__PURE__ */ i(
72
+ n,
73
+ {
74
+ component: "dd",
75
+ variant: "body2",
76
+ sx: (o) => ({
77
+ m: 0,
78
+ px: 2,
79
+ py: 1,
80
+ color: o.palette.text.primary,
81
+ borderBottom: `1px solid ${o.palette.divider}`,
82
+ wordBreak: "break-word"
83
+ }),
84
+ children: s(g)
85
+ }
86
+ )
87
+ ] }, t))
88
+ }
89
+ )
90
+ ]
91
+ }
92
+ );
93
+ }
94
+ export {
95
+ k as default
96
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),n=require("@mui/material"),h=require("./index-D08GIfqF.js"),m=require("./v4-CqdK_b8Y.js");function j(o){const{children:l,value:a,index:r,...s}=o;return e.jsx("div",{role:"tabpanel",hidden:a!==r,id:`simple-tabpanel-${r}`,"aria-labelledby":`simple-tab-${r}`,...s,children:a===r&&e.jsx(n.Box,{sx:{p:3},children:l})})}function p({attributes:o={},patch:l,onChange:a}){const{MuiAttributes:r={},tabs:s=[]}=o,[d,c]=u.useState(0),b=u.useMemo(()=>s.map(()=>m.v4()),[s.length]),x=(i,t)=>{c(t)};return e.jsxs(n.Box,{sx:{width:"100%"},children:[e.jsx(n.Box,{sx:{borderBottom:1,borderColor:"divider"},children:e.jsx(n.Tabs,{value:d,onChange:x,...r,children:s.map((i,t)=>e.jsx(n.Tab,{label:i.label},t))})}),s.map((i,t)=>e.jsx(j,{value:d,index:t,children:e.jsx(h.FormGenerator,{guid:b[t],data:i.subFields||[],patch:l,onChange:a})},t))]})}exports.default=p;
@@ -0,0 +1,39 @@
1
+ import { jsxs as h, jsx as a } from "react/jsx-runtime";
2
+ import m from "react";
3
+ import { Box as i, Tabs as c, Tab as p } from "@mui/material";
4
+ import { F as f } from "./index-CddjLTWF.mjs";
5
+ import { v } from "./v4-BysszJq8.mjs";
6
+ function g(s) {
7
+ const { children: l, value: o, index: t, ...r } = s;
8
+ return /* @__PURE__ */ a(
9
+ "div",
10
+ {
11
+ role: "tabpanel",
12
+ hidden: o !== t,
13
+ id: `simple-tabpanel-${t}`,
14
+ "aria-labelledby": `simple-tab-${t}`,
15
+ ...r,
16
+ children: o === t && /* @__PURE__ */ a(i, { sx: { p: 3 }, children: l })
17
+ }
18
+ );
19
+ }
20
+ function B({ attributes: s = {}, patch: l, onChange: o }) {
21
+ const { MuiAttributes: t = {}, tabs: r = [] } = s, [d, b] = m.useState(0), u = m.useMemo(() => r.map(() => v()), [r.length]);
22
+ return /* @__PURE__ */ h(i, { sx: { width: "100%" }, children: [
23
+ /* @__PURE__ */ a(i, { sx: { borderBottom: 1, borderColor: "divider" }, children: /* @__PURE__ */ a(c, { value: d, onChange: (n, e) => {
24
+ b(e);
25
+ }, ...t, children: r.map((n, e) => /* @__PURE__ */ a(p, { label: n.label }, e)) }) }),
26
+ r.map((n, e) => /* @__PURE__ */ a(g, { value: d, index: e, children: /* @__PURE__ */ a(
27
+ f,
28
+ {
29
+ guid: u[e],
30
+ data: n.subFields || [],
31
+ patch: l,
32
+ onChange: o
33
+ }
34
+ ) }, e))
35
+ ] });
36
+ }
37
+ export {
38
+ B as default
39
+ };
@@ -0,0 +1,58 @@
1
+ import { jsx as x } from "react/jsx-runtime";
2
+ import { useState as y, useEffect as I, createElement as $ } from "react";
3
+ import k from "@mui/material/Autocomplete";
4
+ import q from "@mui/material/TextField";
5
+ import R from "@mui/material/Chip";
6
+ import { u as j, m as B, p as F, a as P } from "./index-CddjLTWF.mjs";
7
+ const i = (e, a) => Array.isArray(e) ? e.map((t) => String(t)).filter((t) => t !== "") : e == null || e === "" ? [] : String(e).split(new RegExp(`[${a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")},]`)).map((t) => t.trim()).filter((t) => t !== "");
8
+ function K({ attributes: e = {}, rules: a = {}, onChange: m }) {
9
+ const {
10
+ MuiAttributes: p = {},
11
+ id: t = "",
12
+ options: S = [],
13
+ separator: s = ";",
14
+ label: v = "",
15
+ placeholder: T = ""
16
+ } = e, { sx: C, ...A } = p, [c, l] = y(() => i(e.value, s)), [E, d] = y(!1);
17
+ I(() => {
18
+ l(i(e.value, s));
19
+ }, []), j(() => {
20
+ l(i(e.value, s));
21
+ }, [e.value]);
22
+ const f = a?.validation?.some((r) => r.rule === "mandatory" || r.rule === "mandatoryselect") || !1, g = f && E && c.length === 0, M = g ? a?.validation?.find((r) => r.rule === "mandatory" || r.rule === "mandatoryselect")?.message || "Required" : "";
23
+ return /* @__PURE__ */ x(
24
+ k,
25
+ {
26
+ freeSolo: !0,
27
+ multiple: !0,
28
+ id: t,
29
+ options: S,
30
+ value: c,
31
+ onChange: (r, u) => {
32
+ const n = u.map((o) => String(o).trim()).filter((o) => o !== "");
33
+ l(n), d(!0), m?.({ id: t, value: n, option: n });
34
+ },
35
+ onBlur: () => d(!0),
36
+ renderTags: (r, u) => r.map((n, o) => {
37
+ const h = u({ index: o });
38
+ return /* @__PURE__ */ $(R, { label: n, ...h, key: h.key, sx: F });
39
+ }),
40
+ renderInput: (r) => /* @__PURE__ */ x(
41
+ q,
42
+ {
43
+ ...r,
44
+ label: v,
45
+ placeholder: T,
46
+ required: f,
47
+ error: g,
48
+ helperText: M,
49
+ sx: B(P, C)
50
+ }
51
+ ),
52
+ ...A
53
+ }
54
+ );
55
+ }
56
+ export {
57
+ K as default
58
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),u=require("react"),R=require("@mui/material/Autocomplete"),I=require("@mui/material/TextField"),$=require("@mui/material/Chip"),a=require("./index-D08GIfqF.js"),p=(e,o)=>Array.isArray(e)?e.map(t=>String(t)).filter(t=>t!==""):e==null||e===""?[]:String(e).split(new RegExp(`[${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},]`)).map(t=>t.trim()).filter(t=>t!=="");function k({attributes:e={},rules:o={},onChange:d}){const{MuiAttributes:m={},id:t="",options:q=[],separator:i=";",label:v="",placeholder:T=""}=e,{sx:M,...j}=m,[g,l]=u.useState(()=>p(e.value,i)),[A,f]=u.useState(!1);u.useEffect(()=>{l(p(e.value,i))},[]),a.useUpdateEffect(()=>{l(p(e.value,i))},[e.value]);const x=o?.validation?.some(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")||!1,y=x&&A&&g.length===0,C=y?o?.validation?.find(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")?.message||"Required":"",E=(r,c)=>{const n=c.map(s=>String(s).trim()).filter(s=>s!=="");l(n),f(!0),d?.({id:t,value:n,option:n})};return h.jsx(R,{freeSolo:!0,multiple:!0,id:t,options:q,value:g,onChange:E,onBlur:()=>f(!0),renderTags:(r,c)=>r.map((n,s)=>{const S=c({index:s});return u.createElement($,{label:n,...S,key:S.key,sx:a.premiumChipSx})}),renderInput:r=>h.jsx(I,{...r,label:v,placeholder:T,required:x,error:y,helperText:C,sx:a.mergeSx(a.premiumInputSx,M)}),...j})}exports.default=k;
@@ -0,0 +1,29 @@
1
+ import { ComponentType } from 'react';
2
+ import { ControlProps } from '../types';
3
+ /** A control is any component that accepts the standard `ControlProps`
4
+ * (`attributes`, `rules`, `onChange`, `submitTick`, `messages`, …). */
5
+ export type ControlComponent = ComponentType<ControlProps>;
6
+ /**
7
+ * Register a custom control so `{ type: '<type>' }` in a form schema renders it.
8
+ * The component receives the same props as any built-in control (its value is in
9
+ * `attributes.value`, its id in `attributes.id`; call `onChange({ id, value })` to
10
+ * update the form). Registering an existing type overrides the built-in control.
11
+ *
12
+ * ```tsx
13
+ * registerControl('color-swatch', ({ attributes, onChange }) => (
14
+ * <input type="color" value={attributes.value ?? '#000'}
15
+ * onChange={(e) => onChange?.({ id: attributes.id, value: e.target.value })} />
16
+ * ));
17
+ * ```
18
+ */
19
+ export declare function registerControl(type: string, component: ControlComponent): void;
20
+ /** Register several custom controls at once. */
21
+ export declare function registerControls(controls: Record<string, ControlComponent>): void;
22
+ /** Remove a previously registered custom control. */
23
+ export declare function unregisterControl(type: string): void;
24
+ /** Look up a registered custom control (used by the renderer). */
25
+ export declare function getRegisteredControl(type?: string): ControlComponent | undefined;
26
+ /** True when a custom control is registered for this type. */
27
+ export declare function hasRegisteredControl(type?: string): boolean;
28
+ /** All registered custom control type names. */
29
+ export declare function registeredControlTypes(): string[];
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Schema-validation adapters. These let you validate a whole form against an
3
+ * existing Zod / Yup object schema instead of (or in addition to) per-field
4
+ * `rules.validation`.
5
+ *
6
+ * Neither `zod` nor `yup` is imported here — the resolvers duck-type the schema
7
+ * object you pass (calling `safeParse` / `validateSync`), so those libraries are
8
+ * never bundled. You bring your own schema instance.
9
+ */
10
+ /** A single field error produced by a resolver. */
11
+ export interface FieldError {
12
+ /** Field id the error belongs to (the schema key). */
13
+ id: string;
14
+ message: string;
15
+ /** Originating rule/code, if the schema provides one. */
16
+ rule?: string;
17
+ }
18
+ /** Maps the current form values to a flat list of field errors. */
19
+ export type FormResolver = (values: Record<string, any>) => FieldError[];
20
+ /**
21
+ * Adapt a Zod object schema. Uses `safeParse` (synchronous), mapping each issue
22
+ * to the first segment of its `path` (the field id).
23
+ *
24
+ * ```ts
25
+ * import { z } from 'zod';
26
+ * const schema = z.object({ email: z.string().email(), age: z.number().min(18) });
27
+ * <FormGenerator ... resolver={zodResolver(schema)} />
28
+ * ```
29
+ */
30
+ export declare function zodResolver(schema: {
31
+ safeParse: (v: any) => any;
32
+ }): FormResolver;
33
+ /**
34
+ * Adapt a Yup object schema. Uses `validateSync({ abortEarly: false })` so every
35
+ * field error is collected in one pass.
36
+ *
37
+ * ```ts
38
+ * import * as yup from 'yup';
39
+ * const schema = yup.object({ email: yup.string().email().required() });
40
+ * <FormGenerator ... resolver={yupResolver(schema)} />
41
+ * ```
42
+ */
43
+ export declare function yupResolver(schema: {
44
+ validateSync: (v: any, opts?: any) => any;
45
+ }): FormResolver;
@@ -0,0 +1,74 @@
1
+ import { FormField } from './helper';
2
+ import { FormResolver, FieldError } from './resolvers';
3
+ /** The fully-resolved state of one field, ready for a consumer to render. */
4
+ export interface FieldState {
5
+ /** Field id (`field.id` or `field.props.id`). */
6
+ id: string;
7
+ /** The original schema field. */
8
+ field: FormField;
9
+ /** Current value (a computed field returns its formula result). */
10
+ value: any;
11
+ /** False when a `visibleWhen` rule hides it. */
12
+ visible: boolean;
13
+ /** True when a `disabledWhen` rule holds. */
14
+ disabled: boolean;
15
+ /** True when it has a mandatory rule or a satisfied `requiredWhen`. */
16
+ required: boolean;
17
+ /** Resolved options (dynamic `dependsOn`/`optionsMap` applied). */
18
+ options?: any[];
19
+ /** First error message for this field, if any (populated after validate/submit). */
20
+ error?: string;
21
+ }
22
+ export interface UseFormEngineOptions {
23
+ /** Seed values (merged over schema `props.value` defaults). */
24
+ initialValues?: Record<string, any>;
25
+ /** Whole-form schema validation (see `zodResolver`/`yupResolver`). */
26
+ resolver?: FormResolver;
27
+ /** Localizable messages (currently: the default required message). */
28
+ messages?: {
29
+ required?: string;
30
+ };
31
+ }
32
+ export interface FormEngine {
33
+ /** Current values, keyed by field id. */
34
+ values: Record<string, any>;
35
+ /** Errors from the last `validate()`/`submit()`. */
36
+ errors: FieldError[];
37
+ /** Every currently-active field (top-level + matching subform branches) with resolved state. */
38
+ fields: FieldState[];
39
+ /** Only the fields that should render right now (active AND visible). */
40
+ visibleFields: FieldState[];
41
+ /** Resolved state for one field id. */
42
+ getFieldState: (id: string) => FieldState | undefined;
43
+ /** Set one field's value (clears now-unreachable fields + recomputes formulas). */
44
+ setValue: (id: string, value: any) => void;
45
+ /** Merge several values at once. */
46
+ setValues: (patch: Record<string, any>) => void;
47
+ /** Run validation now; returns (and stores) the errors. */
48
+ validate: () => FieldError[];
49
+ /** True when the last validation found no errors. */
50
+ isValid: boolean;
51
+ /** True when values differ from the initial snapshot. */
52
+ isDirty: boolean;
53
+ /** Restore the initial values and clear errors. */
54
+ reset: () => void;
55
+ /** Validate; if clean, call `onValid(values)`. Returns the errors either way. */
56
+ submit: (onValid?: (values: Record<string, any>) => void) => FieldError[];
57
+ }
58
+ /**
59
+ * Headless form engine. Drives the same dynamic rules as `<FormGenerator>`
60
+ * (visibleWhen / disabledWhen / requiredWhen / formula / dependsOn+optionsMap /
61
+ * subforms / validation / resolver) but renders NOTHING — you map over
62
+ * `visibleFields` and render your own components, calling `setValue`.
63
+ *
64
+ * ```tsx
65
+ * const form = useFormEngine(schema);
66
+ * return form.visibleFields.map((f) => (
67
+ * <MyInput key={f.id} label={f.field.props.MuiAttributes?.label}
68
+ * value={f.value} required={f.required} disabled={f.disabled}
69
+ * options={f.options} error={f.error}
70
+ * onChange={(v) => form.setValue(f.id, v)} />
71
+ * ));
72
+ * ```
73
+ */
74
+ export declare function useFormEngine(schema: FormField[], options?: UseFormEngineOptions): FormEngine;
@@ -0,0 +1,23 @@
1
+ import { FormField } from './helper';
2
+ /** A problem found in a form schema by `validateSchema`. */
3
+ export interface SchemaIssue {
4
+ /** 'error' = will misbehave at runtime; 'warning' = likely a mistake. */
5
+ level: 'error' | 'warning';
6
+ /** Machine-readable code, e.g. 'duplicate-id'. */
7
+ code: string;
8
+ /** Human-readable explanation. */
9
+ message: string;
10
+ /** The field id involved, when applicable. */
11
+ field?: string;
12
+ }
13
+ /**
14
+ * Lint a form schema and return the problems found — run it in a test or a build
15
+ * step to catch config mistakes early (returns `[]` for a clean schema).
16
+ *
17
+ * Detects: duplicate ids (within a sibling list), missing ids on value fields,
18
+ * `dependsOn`/`optionsMap` mismatches and unknown targets, rule conditions
19
+ * (`visibleWhen`/`disabledWhen`/`requiredWhen` + cross-field validators)
20
+ * referencing non-existent fields, and subform `conditionValue`s that aren't one
21
+ * of the driving field's options.
22
+ */
23
+ export declare function validateSchema(schema: FormField[]): SchemaIssue[];
@@ -0,0 +1,30 @@
1
+ const e = [];
2
+ for (let n = 0; n < 256; ++n)
3
+ e.push((n + 256).toString(16).slice(1));
4
+ function i(n, t = 0) {
5
+ return (e[n[t + 0]] + e[n[t + 1]] + e[n[t + 2]] + e[n[t + 3]] + "-" + e[n[t + 4]] + e[n[t + 5]] + "-" + e[n[t + 6]] + e[n[t + 7]] + "-" + e[n[t + 8]] + e[n[t + 9]] + "-" + e[n[t + 10]] + e[n[t + 11]] + e[n[t + 12]] + e[n[t + 13]] + e[n[t + 14]] + e[n[t + 15]]).toLowerCase();
6
+ }
7
+ let o;
8
+ const r = new Uint8Array(16);
9
+ function y() {
10
+ if (!o) {
11
+ if (typeof crypto > "u" || !crypto.getRandomValues)
12
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
13
+ o = crypto.getRandomValues.bind(crypto);
14
+ }
15
+ return o(r);
16
+ }
17
+ const m = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), d = { randomUUID: m };
18
+ function p(n, t, c) {
19
+ n = n || {};
20
+ const u = n.random ?? n.rng?.() ?? y();
21
+ if (u.length < 16)
22
+ throw new Error("Random bytes length must be >= 16");
23
+ return u[6] = u[6] & 15 | 64, u[8] = u[8] & 63 | 128, i(u);
24
+ }
25
+ function g(n, t, c) {
26
+ return d.randomUUID && !n ? d.randomUUID() : p(n);
27
+ }
28
+ export {
29
+ g as v
30
+ };