slthcore 0.6.3__tar.gz → 0.6.4__tar.gz

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 (130) hide show
  1. {slthcore-0.6.3/slthcore.egg-info → slthcore-0.6.4}/PKG-INFO +1 -1
  2. {slthcore-0.6.3 → slthcore-0.6.4}/setup.py +1 -1
  3. {slthcore-0.6.3 → slthcore-0.6.4}/slth/static/js/slth.min.js +2 -2
  4. {slthcore-0.6.3 → slthcore-0.6.4/slthcore.egg-info}/PKG-INFO +1 -1
  5. {slthcore-0.6.3 → slthcore-0.6.4}/MANIFEST.in +0 -0
  6. {slthcore-0.6.3 → slthcore-0.6.4}/setup.cfg +0 -0
  7. {slthcore-0.6.3 → slthcore-0.6.4}/slth/__init__.py +0 -0
  8. {slthcore-0.6.3 → slthcore-0.6.4}/slth/application.py +0 -0
  9. {slthcore-0.6.3 → slthcore-0.6.4}/slth/apps.py +0 -0
  10. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/configure/__main__.py +0 -0
  11. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/__main__.py +0 -0
  12. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/__pycache__/__main__.cpython-312.pyc +0 -0
  13. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/.DS_Store +0 -0
  14. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/.gitignore +0 -0
  15. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/api/__init__.py +0 -0
  16. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/api/asgi.py +0 -0
  17. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/api/endpoints/__init__.py +0 -0
  18. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/api/models.py +0 -0
  19. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/api/settings.py +0 -0
  20. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/api/tests.py +0 -0
  21. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/api/urls.py +0 -0
  22. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/api/wsgi.py +0 -0
  23. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/entrypoint.sh +0 -0
  24. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/manage.py +0 -0
  25. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/backend/requirements.txt +0 -0
  26. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/base.env +0 -0
  27. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/docker-compose.yml +0 -0
  28. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/frontend/package.json +0 -0
  29. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/frontend/src/main.jsx +0 -0
  30. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/frontend/vite.config.js +0 -0
  31. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/local.env +0 -0
  32. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/run.sh +0 -0
  33. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/selenium/run.sh +0 -0
  34. {slthcore-0.6.3 → slthcore-0.6.4}/slth/cmd/init/boilerplate/test.sh +0 -0
  35. {slthcore-0.6.3 → slthcore-0.6.4}/slth/components.py +0 -0
  36. {slthcore-0.6.3 → slthcore-0.6.4}/slth/db/__init__.py +0 -0
  37. {slthcore-0.6.3 → slthcore-0.6.4}/slth/db/generic.py +0 -0
  38. {slthcore-0.6.3 → slthcore-0.6.4}/slth/db/models.py +0 -0
  39. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/__init__.py +0 -0
  40. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/auth.py +0 -0
  41. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/deletion.py +0 -0
  42. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/dev.py +0 -0
  43. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/email.py +0 -0
  44. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/job.py +0 -0
  45. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/log.py +0 -0
  46. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/profile.py +0 -0
  47. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/pushsubscription.py +0 -0
  48. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/report.py +0 -0
  49. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/role.py +0 -0
  50. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/settings.py +0 -0
  51. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/task.py +0 -0
  52. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/timezone.py +0 -0
  53. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/user.py +0 -0
  54. {slthcore-0.6.3 → slthcore-0.6.4}/slth/endpoints/whatsappnotification.py +0 -0
  55. {slthcore-0.6.3 → slthcore-0.6.4}/slth/exceptions.py +0 -0
  56. {slthcore-0.6.3 → slthcore-0.6.4}/slth/factory.py +0 -0
  57. {slthcore-0.6.3 → slthcore-0.6.4}/slth/forms.py +0 -0
  58. {slthcore-0.6.3 → slthcore-0.6.4}/slth/geo/__init__.py +0 -0
  59. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/__init__.py +0 -0
  60. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/deepseek/__init__.py +0 -0
  61. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/google/__init__.py +0 -0
  62. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/google/gemini.py +0 -0
  63. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/google/places.py +0 -0
  64. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/google/vision.py +0 -0
  65. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/justvoip/__init__.py +0 -0
  66. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/mercadopago/__init__.py +0 -0
  67. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/openai/__init__.py +0 -0
  68. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/openai/chatgpt.py +0 -0
  69. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/viacep/__init__.py +0 -0
  70. {slthcore-0.6.3 → slthcore-0.6.4}/slth/integrations/whatsapp/__init__.py +0 -0
  71. {slthcore-0.6.3 → slthcore-0.6.4}/slth/management/__init__.py +0 -0
  72. {slthcore-0.6.3 → slthcore-0.6.4}/slth/management/commands/__init__.py +0 -0
  73. {slthcore-0.6.3 → slthcore-0.6.4}/slth/management/commands/api.py +0 -0
  74. {slthcore-0.6.3 → slthcore-0.6.4}/slth/management/commands/integration_test.py +0 -0
  75. {slthcore-0.6.3 → slthcore-0.6.4}/slth/management/commands/sync.py +0 -0
  76. {slthcore-0.6.3 → slthcore-0.6.4}/slth/management/commands/worker.py +0 -0
  77. {slthcore-0.6.3 → slthcore-0.6.4}/slth/middleware/__init__.py +0 -0
  78. {slthcore-0.6.3 → slthcore-0.6.4}/slth/middleware/timezone.py +0 -0
  79. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0001_initial.py +0 -0
  80. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0002_email_role_pushsubscription_error.py +0 -0
  81. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0003_rename_photo_profile_alter_profile_options.py +0 -0
  82. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0004_alter_profile_photo.py +0 -0
  83. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0005_alter_profile_photo.py +0 -0
  84. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0006_user.py +0 -0
  85. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0007_deletion_log.py +0 -0
  86. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0008_alter_deletion_datetime_alter_log_datetime.py +0 -0
  87. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0009_remove_email_from_email_email_action_email_attempt_and_more.py +0 -0
  88. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0010_email_key_alter_email_action_alter_email_attempt_and_more.py +0 -0
  89. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0011_usertimezone.py +0 -0
  90. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0012_timezone_remove_usertimezone_key_and_more.py +0 -0
  91. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0013_whatsappnotification.py +0 -0
  92. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0014_settings.py +0 -0
  93. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/0015_auto_20250412_1126.py +0 -0
  94. {slthcore-0.6.3 → slthcore-0.6.4}/slth/migrations/__init__.py +0 -0
  95. {slthcore-0.6.3 → slthcore-0.6.4}/slth/models.py +0 -0
  96. {slthcore-0.6.3 → slthcore-0.6.4}/slth/notifications.py +0 -0
  97. {slthcore-0.6.3 → slthcore-0.6.4}/slth/oauth.py +0 -0
  98. {slthcore-0.6.3 → slthcore-0.6.4}/slth/pdf/__init__.py +0 -0
  99. {slthcore-0.6.3 → slthcore-0.6.4}/slth/pdf/tests.py +0 -0
  100. {slthcore-0.6.3 → slthcore-0.6.4}/slth/permissions.py +0 -0
  101. {slthcore-0.6.3 → slthcore-0.6.4}/slth/printer.py +0 -0
  102. {slthcore-0.6.3 → slthcore-0.6.4}/slth/queryset.py +0 -0
  103. {slthcore-0.6.3 → slthcore-0.6.4}/slth/roles.py +0 -0
  104. {slthcore-0.6.3 → slthcore-0.6.4}/slth/selenium/__init__.py +0 -0
  105. {slthcore-0.6.3 → slthcore-0.6.4}/slth/selenium/browser.py +0 -0
  106. {slthcore-0.6.3 → slthcore-0.6.4}/slth/serializer.py +0 -0
  107. {slthcore-0.6.3 → slthcore-0.6.4}/slth/static/.DS_Store +0 -0
  108. {slthcore-0.6.3 → slthcore-0.6.4}/slth/static/css/.DS_Store +0 -0
  109. {slthcore-0.6.3 → slthcore-0.6.4}/slth/static/css/slth.css +0 -0
  110. {slthcore-0.6.3 → slthcore-0.6.4}/slth/static/images/placeholder.png +0 -0
  111. {slthcore-0.6.3 → slthcore-0.6.4}/slth/static/js/index.min.js +0 -0
  112. {slthcore-0.6.3 → slthcore-0.6.4}/slth/static/js/react.min.js +0 -0
  113. {slthcore-0.6.3 → slthcore-0.6.4}/slth/statistics.py +0 -0
  114. {slthcore-0.6.3 → slthcore-0.6.4}/slth/storage/__init__.py +0 -0
  115. {slthcore-0.6.3 → slthcore-0.6.4}/slth/storage/s3.py +0 -0
  116. {slthcore-0.6.3 → slthcore-0.6.4}/slth/tasks.py +0 -0
  117. {slthcore-0.6.3 → slthcore-0.6.4}/slth/templates/email.html +0 -0
  118. {slthcore-0.6.3 → slthcore-0.6.4}/slth/templates/index.html +0 -0
  119. {slthcore-0.6.3 → slthcore-0.6.4}/slth/templates/report.html +0 -0
  120. {slthcore-0.6.3 → slthcore-0.6.4}/slth/templates/service-worker.js +0 -0
  121. {slthcore-0.6.3 → slthcore-0.6.4}/slth/templates/signature.html +0 -0
  122. {slthcore-0.6.3 → slthcore-0.6.4}/slth/tests.py +0 -0
  123. {slthcore-0.6.3 → slthcore-0.6.4}/slth/threadlocal.py +0 -0
  124. {slthcore-0.6.3 → slthcore-0.6.4}/slth/timezone.py +0 -0
  125. {slthcore-0.6.3 → slthcore-0.6.4}/slth/urls.py +0 -0
  126. {slthcore-0.6.3 → slthcore-0.6.4}/slth/utils.py +0 -0
  127. {slthcore-0.6.3 → slthcore-0.6.4}/slth/views.py +0 -0
  128. {slthcore-0.6.3 → slthcore-0.6.4}/slthcore.egg-info/SOURCES.txt +0 -0
  129. {slthcore-0.6.3 → slthcore-0.6.4}/slthcore.egg-info/dependency_links.txt +0 -0
  130. {slthcore-0.6.3 → slthcore-0.6.4}/slthcore.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: slthcore
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: API generator based on yml file
5
5
  Home-page: https://github.com/brenokcc
6
6
  Author: Breno Silva
@@ -4,7 +4,7 @@ install_requires = []
4
4
 
5
5
  setup(
6
6
  name='slthcore',
7
- version='0.6.3',
7
+ version='0.6.4',
8
8
  packages=find_packages(),
9
9
  install_requires=install_requires,
10
10
  include_package_data=True,
@@ -143,7 +143,7 @@ import{j as t,r as I,c as Y,R as Re}from"./react.min.js";const T={colors:{primar
143
143
  .tooltip:hover .tooltiptext {
144
144
  visibility: visible;
145
145
  }
146
- `),t.jsxs("div",{className:"tooltip",children:[e.children,t.jsx("div",{className:"tooltiptext",children:V(e.text)})]})}return n()}const Ct=["text","password","email","number","date","datetime-local","file","image","range","search","tel","time","url","week","hidden","color"],ae={padding:15,border:"var(--input-border)",borderRadius:5,backgroundColor:"var(--input-background)"};function Et(e,n){const a=new FormData(e);for(let[i,r]of Array.from(a.entries())){const o=e[i];r!==""&&r!==null||n!=i&&(o.tagName=="SELECT"&&r!==""||o.tagName==null&&r!==""||o.type=="radio"&&r!==""||o.type=="checkbox"&&r!==""||a.delete(i))}return new URLSearchParams(a).toString()}function ee(e,n,a){const i=e.indexOf("?")<0?"?":"&",r=Et(n,a);return e=e+(r?i+r:""),e}function he(e){if(e){const a=[".png",".jpeg",".jpeg",".gif"];for(var n=0;n<a.length;n++)if(e.toLowerCase().indexOf(a[n])>0)return!0}}function re(e,n){O("GET",ee(n,e.closest("form"),e.name),qe)}function Tt(e){if(e){var n=document.querySelector(".form-fieldset."+e);n&&(n.style.display="none");var a=document.querySelector(".form-group."+e);a&&(a.style.display="none");var i=document.querySelector(".form-field."+e);i&&(i.style.display="none")}}function Mt(e){if(e){var n=document.querySelector(".form-fieldset."+e);n&&(n.style.display="block");var a=document.querySelector(".form-group."+e);a&&(a.style.display="block");var i=document.querySelector(".form-field."+e);i&&(i.style.display="block")}}function It(e){const n="reload-"+e+"-field";window[n]&&window[n]()}function Nt(e,n){var a=document.querySelector(".form-group."+e),i=a.querySelectorAll('*[name="'+e+'"]');if(i.length>1)i.forEach(function(o){n==null?o.checked=!1:n.id!=null?o.checked=o.value.toString()==n.id.toString():o.checked=o.value.toString()==n.toString()});else{const o=i[0];if(o.tagName=="INPUT"||o.tagName=="TEXTAREA")o.value=n;else if(o.tagName=="SELECT"){if(o.style.display!="none")o.dispatchEvent(new CustomEvent("customchange",{detail:{value:n}}));else for(var r=0;r<o.options.length;r++)if(o.options[r].value==n){o.selectedIndex=r;break}}}}function qe(e){if(e){for(var n=0;n<e.hide.length;n++)Tt(e.hide[n]);for(var n=0;n<e.show.length;n++)Mt(e.show[n]);for(var n=0;n<e.reload.length;n++)It(e.reload[n]);for(var a in e.set)Nt(a,e.set[a])}}function Lt(e){function n(){const a={color:"white",display:"none",backgroundColor:"#e52207",marginTop:2,marginBottom:2,padding:8};return t.jsxs("div",{style:a,id:e.id,className:"error",children:[t.jsx(k,{icon:"xmark-circle",style:{marginRight:5}}),t.jsx("span",{})]})}return n()}function At(e){function n(){const a={marginTop:2,marginBottom:2,fontStyle:"italic"};return t.jsx("div",{style:a,children:t.jsx("span",{children:e.text})})}return n()}function le(e){const n=e.data.name+Math.random();function a(){const l={display:"flex",justifyContent:"space-between",alignItems:"baseline"};return e.data.action&&(e.data.action.icon=null,e.data.action.modal=!0,e.data.action.urlfunc=function(){return ee(e.data.action.url,document.getElementById(n).closest("form"))}),t.jsxs("div",{style:l,children:[t.jsxs("label",{className:"bold",children:[e.data.label," ",e.data.label&&e.data.required?"*":""]}),e.data.action&&t.jsx(U,{data:e.data.action,style:{padding:0,margin:0},tabIndex:"-1"})]})}function i(){return e.data.type=="datetime"&&(e.data.type="datetime-local"),Ct.indexOf(e.data.type)>=0?t.jsx(ke,{data:e.data}):e.data.type=="choice"&&Array.isArray(e.data.choices)?e.data.pick?Array.isArray(e.data.value)?t.jsx(Se,{data:e.data}):t.jsx(me,{data:e.data}):t.jsx(Dt,{data:e.data}):e.data.type=="choice"?e.data.pick?Array.isArray(e.data.value)?t.jsx(Se,{data:e.data}):t.jsx(me,{data:e.data}):t.jsx(Be,{data:e.data}):e.data.type=="decimal"?t.jsx(ke,{data:e.data}):e.data.type=="boolean"?t.jsx(Bt,{data:e.data}):e.data.type=="textarea"?t.jsx(qt,{data:e.data}):e.data.type=="scheduler"?(e.data.scheduler.input_name=e.data.name,t.jsx(Ae,{data:e.data.scheduler})):t.jsx("span",{children:e.data.name})}function r(){return t.jsx("div",{children:t.jsx(Lt,{id:e.data.name+"_error"})})}function o(){return e.data.help_text&&t.jsx(At,{text:e.data.help_text})}function h(){const l={display:e.data.type=="hidden"?"none":"flex",flexDirection:"column",padding:5,width:"calc(100%-5px)",position:"relative"};return t.jsxs("div",{id:n,style:l,className:"form-group "+e.data.name,children:[a(),i(),o(),r()]})}return h()}function ke(e){var n="";const a=e.data.name+Math.random();e.data.mask=="decimal"&&(n="decimal",e.data.value&&(e.data.value=Math.round(parseFloat(e.data.value)).toFixed(2).replace(".",","))),I.useEffect(()=>{function l(d,u,m){var g=m.target,y=g.value.replace(/\D/g,""),w=g.value.length>u?1:0;VMasker(g).unMask(),VMasker(g).maskPattern(d[w]),g.value=VMasker.toPattern(y,d[w])}if(e.data.mask){var s=document.getElementById(a);if(e.data.mask=="decimal")VMasker(s).maskMoney({precision:2,separator:",",delimiter:"."});else if(e.data.mask.indexOf("|")>0){var c=e.data.mask.split("|");VMasker(s).maskPattern(c[0]),s.addEventListener("input",l.bind(void 0,c,14),!1)}else VMasker(s).maskPattern(e.data.mask)}},[]);function i(l){re(l.target,e.data.onchange)}function r(l){if(e.data.type=="file"&&l.target.files){let c=l.target.files[0];var s=new FileReader;s.onload=function(d){if(he(c.name)){const y="display"+a;var u=document.createElement("img");u.id=l.target.id+"img",u.style.width="200px",u.style.display="block",u.style.margin="auto",u.style.marginTop="20px",u.onload=function(w){const B=e.data.width>e.data.height?e.data.width/u.width:e.data.height/u.height;var j=document.createElement("canvas");const z=j.getContext("2d");j.height=j.width*(u.height/u.width);const M=document.createElement("canvas"),v=M.getContext("2d");M.width=u.width*B,M.height=u.height*B,v.drawImage(u,0,0,M.width,M.height),z.drawImage(M,0,0,M.width*B,M.height*B,0,0,j.width,j.height),M.toBlob(function(E){const D=new DataTransfer;D.items.add(new File([E],c.name)),l.target.files=D.files});var p=document.getElementById(y);p==null?(p=document.createElement("div"),p.id=y):p.removeChild(p.childNodes[0]),p.appendChild(u),l.target.parentNode.appendChild(p)},u.src=d.target.result}const m=document.getElementById("fileinfo"+a);var g=c.size/1024;g<1024?g=parseInt(g)+" Kb":g=(g/1024).toFixed(2)+" Mb",m.innerHTML=c.name+" / "+g,e.data.max_size&&c.size/1024/1024>e.data.max_size&&alert("O limite de tamanho é "+e.data.max_size+"Mb. O arquivo informado possui "+g+". Por favor, adicione um arquivo menor.")},s.readAsDataURL(c)}}function o(){var l=e.data.type;if(l=="datetime"&&(l="datetime-regional"),l=="decimal"&&(l="text"),l=="file"){const d={alignContent:"center",minHeight:75,padding:5,maxWidth:"100%",margin:"auto"};var s=null;return e.data.extensions&&e.data.extensions.length>0&&(s=e.data.extensions.map(u=>"."+u).join(", ")),t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:window.innerWidth<800?"block":"flex",justifyContent:"space-between",backgroundColor:"rgba(15, 145, 210, 0.05)",border:"1px dashed rgba(15, 145, 210, 0.4)",borderRadius:10,textAlign:"center"},children:[t.jsx("div",{style:d,children:t.jsx(k,{icon:"cloud-upload",style:{fontSize:"2.5rem",color:T.colors.primary}})}),t.jsxs("div",{style:d,children:[e.data.value&&he(e.data.value)&&t.jsx("div",{style:{textAlign:"center"},children:t.jsx("img",{src:e.data.value,height:50})}),e.data.value&&!he(e.data.value)&&t.jsx("div",{style:{textAlign:"center"},children:e.data.value}),"Selecione um arquivo clicando no botão ao lado.",t.jsxs("div",{className:"bold",id:"fileinfo"+a,children:["O arquivo",e.data.max_size&&"deve possuir até "+e.data.max_size+" Mb e ","deve ter extensão"," ",e.data.extensions.map(u=>"."+u).join(" ou "),"."]})]}),t.jsx("div",{style:d,align:"center",children:t.jsx(F,{label:"Selecionar Arquivo",onClick:()=>document.getElementById(a).click()})})]}),t.jsx("input",{className:"form-control "+n,type:l,name:e.data.name,id:a,"data-label":N(e.data.label),readOnly:e.data.read_only,onBlur:e.data.onchange?i:null,onChange:r,style:{zIndex:"-1",marginTop:-20},accept:s})]})}else{var c=ae;return l=="color"&&(c={...ae},c.width="100%",c.height=47.5),t.jsxs(t.Fragment,{children:[t.jsx("input",{className:"form-control "+n,type:l,name:e.data.name,id:a,defaultValue:e.data.value,"data-label":N(e.data.label),readOnly:e.data.read_only,onBlur:e.data.onchange?i:null,onChange:r,style:c}),e.data.type=="password"&&t.jsx(k,{icon:"eye",style:{marginTop:-35,marginLeft:"90%",width:20,color:"#CCC",cursor:"pointer"},onClick:h})]})}}function h(l){const s=document.getElementById(a);s.type=s.type=="text"?"password":"text"}return o()}function Be(e){var n=[];Array.isArray(e.data.value)?e.data.value.forEach(function(v,p){n.push({id:v.id,value:v.label})}):e.data.value!=null&&n.push({id:e.data.value.id,value:e.data.value.label}),e.data.id==null&&(e.data.id=Math.random()),e.data.id2==null&&(e.data.id2=e.data.id+"__autocomplete");const a=e.data.id,i=e.data.id2,r=Array.isArray(e.data.value),[o,h]=I.useState(!1),[l,s]=I.useState(null);var c=!1;let d;I.useEffect(()=>{j(n,!0),document.getElementById(a).addEventListener("customchange",function(v){j(v.detail.value);const p=document.getElementById(e.data.name);p&&reactTriggerChange(p)})},[]);function u(){const v=document.getElementById(a);if(r){const p={padding:5,display:"inline"},E={cursor:"pointer",marginRight:5},D={fontSize:"0.8rem"};return t.jsxs("div",{children:[v==null&&n.map((W,q)=>t.jsxs("div",{style:p,children:[t.jsx("span",{onClick:()=>z(q),style:E,children:t.jsx(k,{icon:"trash-can",style:D})}),W.value]},Math.random())),v!=null&&Array.from(v.options).map((W,q)=>t.jsxs("div",{style:p,children:[t.jsx("span",{onClick:()=>z(q),style:E,children:t.jsx(k,{icon:"trash-can",style:D})}),W.innerHTML]},Math.random()))]})}}function m(){return t.jsx("select",{id:a,name:e.data.name,multiple:r,readOnly:!0,style:{display:"contents"}})}function g(){const v={...ae,...e.style||{}},p={padding:0,margin:0,border:"solid 1px #d9d9d9",marginTop:-1,borderRadius:5,maxHeight:150,overflowY:"auto",zIndex:99999};p.position="absolute",p.backgroundColor="var(--default-background)";const E=document.getElementById(i);if(e.data.icon&&(v.paddingLeft=30),E){let q=E,b=null;for(;!b&&(q=q.parentElement)instanceof HTMLElement;)q.matches("dialog")&&(b=q);const S=E.getBoundingClientRect();p.width=S.width,p.top=80,p.left=5}const D={cursor:"pointer",padding:10},W=!r&&n.length>0&&n[0].value||"";return t.jsxs(t.Fragment,{children:[t.jsx(k,{icon:"search",style:{position:"absolute",right:20,top:45}}),t.jsx("input",{id:i,name:e.data.name+"__autocomplete",type:"text",className:"form-control",autocomplete:"off",onFocus:q=>{q.target.select(),B(q)},onChange:B,onMouseLeave:y,onBlur:y,defaultValue:W,style:v,"data-label":N(e.data.label)}),l&&o&&t.jsxs("ul",{style:p,onMouseLeave:w,onMouseEnter:function(q){c=!0},children:[l.length==0&&t.jsx("li",{style:D,children:"Nenhuma opção encontrada."}),l.map(q=>t.jsx("li",{onClick:()=>{h(!1),e.onSelect?e.onSelect(q):j(q)},style:D,className:"autocomplete-item","data-label":N(q.value),children:q.value},Math.random()))]})]})}function y(v){c=!1,setTimeout(function(){c||w(v)},250)}function w(v){const p=document.getElementById(a);if(p){const E=document.getElementById(i);r||(p.options.length==0||p.options.length>0&&E.value!=p.options[0].innerHTML)&&(p.innerHTML="",E.value="",h(!1),e.data.onchange&&re(E,e.data.onchange)),v.target.tagName=="UL"?h(!1):c||h(!1)}}function B(v){clearTimeout(d),d=setTimeout(function(){const p=v.target.closest("form"),E=e.data.choices.indexOf("?")<0?"?":"&";h(!0),O("GET",ee(e.data.choices+E+"term="+v.target.value,p),function(W){s(W)})},1e3)}function j(v,p=!1){const E=document.getElementById(a),D=document.getElementById(i);E.innerHTML==null&&(E.innerHTML=""),Array.isArray(v)?E.innerHTML=v.map(W=>`<option selected value="${W.id}">${W.value}</option>`).join(""):v?r?(E.innerHTML+=`<option selected value="${v.id}">${v.value}</option>`,D.value=""):(E.innerHTML=`<option selected value="${v.id}">${v.value}</option>`,D.value=v.value):(E.innerHTML="",D.value=""),e.data.onchange&&!p&&re(D,e.data.onchange)}function z(v){const p=document.getElementById(a);var E=Array.from(p.options);p.innerHTML=E.slice(0,v).concat(E.slice(v+1)).map(D=>`<option selected value="${D.value}">${D.innerHTML}</option>`).join(""),s([])}function M(){return t.jsxs(t.Fragment,{children:[m(),g(),u()]})}return M()}function qt(e){function n(){var a={...ae};return a.height=100,t.jsx("textarea",{id:e.data.name,name:e.data.name,"data-label":N(e.data.label),style:a,defaultValue:e.data.value||"",className:"form-control"})}return n()}function Bt(e){return t.jsx(me,{data:e.data})}function me(e){const[n,a]=I.useState(e.data.choices);var i=Math.random(),r=e.data;function o(c){return r.value!=null&&r.value.toString()==c.id.toString()||r.value!=null&&r.value.id!=null&&r.value.id.toString()==c.id.toString()||r.value==null&&c.id.toString()=="null"}function h(c){var d=document.getElementById(c);r.checked&&(d.checked=!1),e.data.onchange&&re(d,e.data.onchange)}function l(c){var d=document.getElementById(c);r.checked=d.checked}function s(){return window["reload-"+r.name+"-field"]=function(){O("GET",ee(e.data.pick,document.querySelector(".radio-group."+r.name).closest("form")),function(d){a(d)})},n.length>0?t.jsx("div",{className:"radio-group "+r.name,children:n.map((c,d)=>(c.id||c.id===!1)&&t.jsxs("div",{style:{paddingTop:10,display:"inline-block",marginRight:25,width:window.innerWidth>800?"auto":"100%"},children:[t.jsx("input",{id:r.name+i+d,type:"radio",name:r.name,defaultValue:c.id,defaultChecked:o(c),"data-label":N(c.value),onClick:function(){h(r.name+i+d)},onMouseEnter:function(){l(r.name+i+d)}}),t.jsx("label",{htmlFor:r.name+i+d,children:c.value})]},i+d))}):t.jsx("div",{className:"radio-group empty "+r.name,children:t.jsx(ie,{data:{text:"Nenhuma opção disponível para seleção."}})})}return s()}function Se(e){const[n,a]=I.useState(e.data.choices);var i=Math.random(),r=e.data;function o(s){var c=!1;if(r.value)for(var d=0;d<r.value.length;d++){var u=r.value[d];(u==s.id||u.id==s.id)&&(c=!0)}return c}function h(s){e.data.onchange&&re(s.target,e.data.onchange)}function l(){return window["reload-"+r.name+"-field"]=function(){O("GET",ee(e.data.pick,document.querySelector(".checkbox-group."+r.name).closest("form")),function(c){a(c)})},n.length>0?t.jsx("div",{className:"checkbox-group "+r.name,children:n.map((s,c)=>(s.id||s.id===!1)&&t.jsxs("div",{style:{paddingTop:10,display:"inline-block",marginRight:25,width:window.innerWidth>800?"auto":"100%"},children:[t.jsx("input",{id:r.name+i+c,type:"checkbox",name:r.name,onClick:h,defaultValue:s.id,defaultChecked:o(s),"data-label":N(s.value)}),t.jsx("label",{htmlFor:r.name+i+c,children:s.value})]},i+c))}):t.jsx("div",{className:"checkbox-group empty "+r.name,children:t.jsx(ie,{data:{text:"Nenhuma opção disponível para seleção."}})})}return l()}function Dt(e){var n=e.data;return t.jsx(t.Fragment,{children:t.jsx("select",{className:"form-control",id:n.name,name:n.name,"data-label":N(n.label),defaultValue:n.value,style:ae,children:n.choices.map(a=>t.jsx("option",{value:a.id,children:a.value},Math.random()))})})}function Rt(e){const n=Math.random(),a=e.data.value[0],i=a.fields?a.fields[0]:a.fieldsets[0].fields[0][0];function r(){return!e.data.required&&t.jsx("div",{id:"info-"+n,children:t.jsxs(ie,{data:{text:"Esta informação é opcional. Controle seu preenchimento com o botão ao lado."},children:[t.jsx(F,{primary:!0,icon:"pen-clip",onClick:()=>o(!0),id:"show-"+n,display:i.value?"none":"inline"}),t.jsx(F,{primary:!0,icon:"trash",onClick:()=>o(!1),id:"hide-"+n,display:i.value?"inline":"none"})]})})}function o(s){const c=document.querySelector("input[name="+i.name+"]"),d=document.getElementById("inline-form-"+n),u=document.getElementById("show-"+n),m=document.getElementById("hide-"+n);d.style.display=s?"block":"none",u.style.display=s?"none":"inline",m.style.display=s?"inline":"none",s?c.value===""?c.value=0:c.value=-parseInt(c.value):parseInt(c.value)==0?c.value="":c.value=-parseInt(c.value)}function h(){const s={display:i.value?"block":"none"};return e.data.required&&(s.display="block",i.value===""&&(i.value=0)),t.jsx("div",{className:"fieldset-inline-forms",style:s,id:"inline-form-"+n,children:e.data.value.map(function(c){return t.jsx(ye,{data:c},Math.random())})})}function l(){const s={margin:0};return t.jsxs("div",{className:"form-fieldset "+e.data.name,children:[t.jsx("h2",{style:s,"data-label":N(e.data.label),children:e.data.label}),r(),h()]})}return l()}function Ot(e){var n=0;const a=Math.random();e.data.template==null&&(e.data.template=e.data.value.pop());function i(d,u){const m=n;return n+=1,t.jsxs("div",{style:{display:"block"},id:"form-"+m+"-"+a,children:[t.jsx(ye,{data:d}),t.jsxs("div",{style:{textAlign:"center",marginTop:10,marginBottom:10},children:[t.jsx(F,{primary:!0,icon:"plus",onClick:()=>o(),id:"extra-add-"+m+"-",display:u}),t.jsx(F,{primary:!0,icon:"trash",onClick:()=>h(m),display:"inline"})]})]},Math.random())}function r(){const d=l(),u=d.length>0?"none":"inline";document.getElementById("add-"+a).style.display=u;for(var m=0;m<n;m++){var g=document.getElementById("extra-add-"+m+"-");g.style.display="none"}if(d.length>0){var g=document.getElementById("extra-add-"+d[d.length-1]+"-");g.style.display="inline"}}function o(){r();var d=JSON.parse(JSON.stringify(e.data.template));d.fields?(d.fields.map(function(u){u.name=u.name.replace("__n__","__"+n+"__")}),d.fields[0].value=0):d.fieldsets.map(function(u){u.fields.map(function(m){m.map(function(g){g.name=g.name.replace("__n__","__"+n+"__")}),m[0].value=0})}),Y.createRoot(document.getElementById(a).appendChild(document.createElement("div"))).render(i(d,"inline")),setTimeout(r,100)}function h(d){const u=e.data.template,g=(u.fields?u.fields[0]:u.fieldsets[0].fields[0][0]).name.replace("__n__","__"+d+"__"),y=document.querySelector("input[name="+g+"]");parseInt(y.value)==0?y.value="":y.value=-parseInt(y.value),document.getElementById("form-"+d+"-"+a).style.display="none",r()}function l(){for(var d=[],u=0;u<n;u++)document.getElementById("form-"+u+"-"+a).style.display=="block"&&d.push(u);return d}function s(){return t.jsx("div",{id:"info-"+a,children:t.jsx(ie,{data:{text:'Clique no botão com o ícone de "+" para adicionar e com o ícone da "lixeira" para remover.'},children:t.jsx(F,{primary:!0,icon:"add",onClick:()=>o(),id:"add-"+a,display:e.data.value.length>0?"none":"inline"})})})}function c(){const d={margin:0};return t.jsxs("div",{className:"form-fieldset "+e.data.name,children:[t.jsx("h2",{style:d,"data-label":N(e.data.label),children:e.data.label}),t.jsx("div",{children:!1}),t.jsxs("div",{id:a,className:"fieldset-inline-forms",children:[s(),e.data.value.map(function(u,m){return i(u,m==e.data.value.length-1?"inline":"none")})]})]})}return c()}function ye(e){I.useEffect(()=>{e.data.controls&&qe(e.data.controls)},[]);function n(i){return i.type=="inline"?i.max==i.min==1?t.jsx(Rt,{data:i},Math.random()):t.jsx(Ot,{data:i},Math.random()):t.jsx(le,{data:i},Math.random())}function a(){return e.data.fields?e.data.fields.length>0?t.jsx("div",{className:"form-fields default-fieldset",children:e.data.fields.map(i=>n(i))}):null:e.data.fieldsets.map(i=>t.jsx("div",{className:"form-fieldset "+i.name,children:i.type=="inline"?n(i):t.jsxs(t.Fragment,{children:[t.jsx("h2",{"data-label":N(i.title),style:{margin:0},children:i.title}),i.fields.map(r=>t.jsx("div",{children:r.map(o=>t.jsx("div",{className:"form-field "+o.name,style:{verticalAlign:"bottom",width:(window.innerWidth>600?100/r.length:100)+"%",display:o.type=="hidden"?"none":"inline-block"},children:n(o)},Math.random()))},Math.random()))]})},Math.random()))}return a()}function _t(e){const n=Math.random();I.useEffect(()=>{e.data.autosubmit&&setInterval(u,e.data.autosubmit*1e3)},[]);function a(){const m={margin:0,color:T.colors.primary};return t.jsx("h1",{style:m,children:e.data.title})}function i(){return e.data.info&&t.jsx(K,{data:{text:e.data.info}})}function r(){if(e.data.display)return t.jsxs(t.Fragment,{children:[e.data.display.map(m=>t.jsx(x,{data:m},Math.random())),t.jsx("div",{style:{marginTop:30}})]})}function o(){return t.jsx(ye,{data:e.data})}function h(){return t.jsxs("div",{style:{marginTop:20,textAlign:"right"},children:[t.jsx(F,{onClick:d,label:"Cancelar",default:!0,display:"inline"}),t.jsx(F,{onClick:u,label:e.data.submit_label,primary:!0,display:"inline",icon:e.data.submit_icon,spin:!0})]})}function l(){return t.jsx("div",{id:"output",style:{marginTop:30}})}function s(){if(e.data.image)return t.jsx("div",{style:{margin:"auto",width:"100%",textAlign:"center"},children:t.jsx("img",{src:e.data.image})})}function c(){return t.jsxs("form",{id:n,className:e.data.key,action:e.data.url,style:{margin:"auto"},method:e.data.method,children:[t.jsx("div",{children:!1}),t.jsxs("div",{style:{padding:5},children:[a(),s(),i(),r(),o(),h(),l()]})]})}function d(){Z()}function u(m){m&&m.preventDefault();var g=e.data.url,y=document.getElementById(n),w=new FormData(y);if(y.method.toUpperCase()=="GET"){const B=g.indexOf("?")>=0?"&":"?";g=g+B+"form="+e.data.key+"&"+new URLSearchParams(w).toString(),w=null}e.data.autosubmit&&m==null&&(g+="&autosubmit=1"),O(y.method.toUpperCase(),g,function(j){if(y.querySelectorAll(".error").forEach(M=>M.style.display="none"),m&&m.target.dataset.spinning&&(m.target.querySelector("i.fa-spin").style.display="none",m.target.querySelector("i.fa-"+m.target.dataset.spinning).style.display="inline-block"),j.type=="response")if(j.store&&Me(j.store),j.redirect&&j.redirect.length>2)j.message&&localStorage.setItem("message",j.message),document.location.href=$(j.redirect);else if(j.message&&G(j.message),j.task){let M=function(){O("GET","/api/job/progress/"+j.task+"/",function(E){E==null||E.progress==100?m.target.innerHTML=v:(m.target.innerHTML="Aguarde... ("+(E.progress||0)+"%)",setTimeout(M,5e3))})};const v=m.target.innerHTML;m.target.innerHTML="Aguarde... (0%)",M()}else j.redirect==".."&&(document.getElementsByTagName("dialog").length==0?history.back():Z()),j.redirect=="."&&(document.getElementsByTagName("dialog").length==0?y.reset():Z()),j.dispose&&(y.style.display="none"),dt();else if(j.type=="error"){var z=j.text;console.log(j),Object.keys(j.errors).map(function(M){if(M=="__all__")z=j.errors[M];else{const v=y.querySelector("#"+M+"_error");v==null?z=M+":"+j.errors[M]:(v.querySelector("span").innerHTML=j.errors[M],v.style.display="block")}}),G(z,!0)}else if(j.type!="redirect"){const M=document.querySelector("#output");M.innerHTML="",Y.createRoot(M.appendChild(document.createElement("div"))).render(t.jsx(x,{data:j}))}},w)}return c()}function Wt(e){_(`
146
+ `),t.jsxs("div",{className:"tooltip",children:[e.children,t.jsx("div",{className:"tooltiptext",children:V(e.text)})]})}return n()}const Ct=["text","password","email","number","date","datetime-local","file","image","range","search","tel","time","url","week","hidden","color"],ae={padding:15,border:"var(--input-border)",borderRadius:5,backgroundColor:"var(--input-background)"};function Et(e,n){const a=new FormData(e);for(let[i,r]of Array.from(a.entries())){const o=e[i];r!==""&&r!==null||n!=i&&(o.tagName=="SELECT"&&r!==""||o.tagName==null&&r!==""||o.type=="radio"&&r!==""||o.type=="checkbox"&&r!==""||a.delete(i))}return new URLSearchParams(a).toString()}function ee(e,n,a){const i=e.indexOf("?")<0?"?":"&",r=Et(n,a);return e=e+(r?i+r:""),e}function he(e){if(e){const a=[".png",".jpeg",".jpeg",".gif"];for(var n=0;n<a.length;n++)if(e.toLowerCase().indexOf(a[n])>0)return!0}}function re(e,n){O("GET",ee(n,e.closest("form"),e.name),qe)}function Tt(e){if(e){var n=document.querySelector(".form-fieldset."+e);n&&(n.style.display="none");var a=document.querySelector(".form-group."+e);a&&(a.style.display="none");var i=document.querySelector(".form-field."+e);i&&(i.style.display="none")}}function Mt(e){if(e){var n=document.querySelector(".form-fieldset."+e);n&&(n.style.display="block");var a=document.querySelector(".form-group."+e);a&&(a.style.display="block");var i=document.querySelector(".form-field."+e);i&&(i.style.display="block")}}function It(e){const n="reload-"+e+"-field";window[n]&&window[n]()}function Nt(e,n){var a=document.querySelector(".form-group."+e),i=a.querySelectorAll('*[name="'+e+'"]');if(i.length>1)i.forEach(function(o){n==null?o.checked=!1:n.id!=null?o.checked=o.value.toString()==n.id.toString():o.checked=o.value.toString()==n.toString()});else{const o=i[0];if(o.tagName=="INPUT"||o.tagName=="TEXTAREA")o.value=n;else if(o.tagName=="SELECT"){if(o.style.display!="none")o.dispatchEvent(new CustomEvent("customchange",{detail:{value:n}}));else for(var r=0;r<o.options.length;r++)if(o.options[r].value==n){o.selectedIndex=r;break}}}}function qe(e){if(e){for(var n=0;n<e.hide.length;n++)Tt(e.hide[n]);for(var n=0;n<e.show.length;n++)Mt(e.show[n]);for(var n=0;n<e.reload.length;n++)It(e.reload[n]);for(var a in e.set)Nt(a,e.set[a])}}function Lt(e){function n(){const a={color:"white",display:"none",backgroundColor:"#e52207",marginTop:2,marginBottom:2,padding:8};return t.jsxs("div",{style:a,id:e.id,className:"error",children:[t.jsx(k,{icon:"xmark-circle",style:{marginRight:5}}),t.jsx("span",{})]})}return n()}function At(e){function n(){const a={marginTop:2,marginBottom:2,fontStyle:"italic"};return t.jsx("div",{style:a,children:t.jsx("span",{children:e.text})})}return n()}function le(e){const n=e.data.name+Math.random();function a(){const l={display:"flex",justifyContent:"space-between",alignItems:"baseline"};return e.data.action&&(e.data.action.icon=null,e.data.action.modal=!0,e.data.action.urlfunc=function(){return ee(e.data.action.url,document.getElementById(n).closest("form"))}),t.jsxs("div",{style:l,children:[t.jsxs("label",{className:"bold",children:[e.data.label," ",e.data.label&&e.data.required?"*":""]}),e.data.action&&t.jsx(U,{data:e.data.action,style:{padding:0,margin:0},tabIndex:"-1"})]})}function i(){return e.data.type=="datetime"&&(e.data.type="datetime-local"),Ct.indexOf(e.data.type)>=0?t.jsx(ke,{data:e.data}):e.data.type=="choice"&&Array.isArray(e.data.choices)?e.data.pick?Array.isArray(e.data.value)?t.jsx(Se,{data:e.data}):t.jsx(me,{data:e.data}):t.jsx(Dt,{data:e.data}):e.data.type=="choice"?e.data.pick?Array.isArray(e.data.value)?t.jsx(Se,{data:e.data}):t.jsx(me,{data:e.data}):t.jsx(Be,{data:e.data}):e.data.type=="decimal"?t.jsx(ke,{data:e.data}):e.data.type=="boolean"?t.jsx(Bt,{data:e.data}):e.data.type=="textarea"?t.jsx(qt,{data:e.data}):e.data.type=="scheduler"?(e.data.scheduler.input_name=e.data.name,t.jsx(Ae,{data:e.data.scheduler})):t.jsx("span",{children:e.data.name})}function r(){return t.jsx("div",{children:t.jsx(Lt,{id:e.data.name+"_error"})})}function o(){return e.data.help_text&&t.jsx(At,{text:e.data.help_text})}function h(){const l={display:e.data.type=="hidden"?"none":"flex",flexDirection:"column",padding:5,width:"calc(100%-5px)",position:"relative"};return t.jsxs("div",{id:n,style:l,className:"form-group "+e.data.name,children:[a(),i(),o(),r()]})}return h()}function ke(e){var n="";const a=e.data.name+Math.random();e.data.mask=="decimal"&&(n="decimal",e.data.value&&(e.data.value=Math.round(parseFloat(e.data.value)).toFixed(2).replace(".",","))),I.useEffect(()=>{function l(d,u,m){var g=m.target,y=g.value.replace(/\D/g,""),w=g.value.length>u?1:0;VMasker(g).unMask(),VMasker(g).maskPattern(d[w]),g.value=VMasker.toPattern(y,d[w])}if(e.data.mask){var s=document.getElementById(a);if(e.data.mask=="decimal")VMasker(s).maskMoney({precision:2,separator:",",delimiter:"."});else if(e.data.mask.indexOf("|")>0){var c=e.data.mask.split("|");VMasker(s).maskPattern(c[0]),s.addEventListener("input",l.bind(void 0,c,14),!1)}else VMasker(s).maskPattern(e.data.mask)}},[]);function i(l){re(l.target,e.data.onchange)}function r(l){if(e.data.type=="file"&&l.target.files){let c=l.target.files[0];var s=new FileReader;s.onload=function(d){if(he(c.name)){const y="display"+a;var u=document.createElement("img");u.id=l.target.id+"img",u.style.width="200px",u.style.display="block",u.style.margin="auto",u.style.marginTop="20px",u.onload=function(w){const B=e.data.width>e.data.height?e.data.width/u.width:e.data.height/u.height;var j=document.createElement("canvas");const z=j.getContext("2d");j.height=j.width*(u.height/u.width);const M=document.createElement("canvas"),v=M.getContext("2d");M.width=u.width*B,M.height=u.height*B,v.drawImage(u,0,0,M.width,M.height),z.drawImage(M,0,0,M.width*B,M.height*B,0,0,j.width,j.height),M.toBlob(function(E){const D=new DataTransfer;D.items.add(new File([E],c.name)),l.target.files=D.files});var p=document.getElementById(y);p==null?(p=document.createElement("div"),p.id=y):p.removeChild(p.childNodes[0]),p.appendChild(u),l.target.parentNode.appendChild(p)},u.src=d.target.result}const m=document.getElementById("fileinfo"+a);var g=c.size/1024;g<1024?g=parseInt(g)+" Kb":g=(g/1024).toFixed(2)+" Mb",m.innerHTML=c.name+" / "+g,e.data.max_size&&c.size/1024/1024>e.data.max_size&&alert("O limite de tamanho é "+e.data.max_size+"Mb. O arquivo informado possui "+g+". Por favor, adicione um arquivo menor.")},s.readAsDataURL(c)}}function o(){var l=e.data.type;if(l=="datetime"&&(l="datetime-regional"),l=="decimal"&&(l="text"),l=="file"){const d={alignContent:"center",minHeight:75,padding:5,maxWidth:"100%",margin:"auto"};var s=null;return e.data.extensions&&e.data.extensions.length>0&&(s=e.data.extensions.map(u=>"."+u).join(", ")),t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:window.innerWidth<800?"block":"flex",justifyContent:"space-between",backgroundColor:"rgba(15, 145, 210, 0.05)",border:"1px dashed rgba(15, 145, 210, 0.4)",borderRadius:10,textAlign:"center"},children:[t.jsx("div",{style:d,children:t.jsx(k,{icon:"cloud-upload",style:{fontSize:"2.5rem",color:T.colors.primary}})}),t.jsxs("div",{style:d,children:[e.data.value&&he(e.data.value)&&t.jsx("div",{style:{textAlign:"center"},children:t.jsx("img",{src:e.data.value,height:50})}),e.data.value&&!he(e.data.value)&&t.jsx("div",{style:{textAlign:"center"},children:e.data.value}),"Selecione um arquivo clicando no botão ao lado.",t.jsxs("div",{className:"bold",id:"fileinfo"+a,children:["O arquivo",e.data.max_size&&"deve possuir até "+e.data.max_size+" Mb e ","deve ter extensão"," ",e.data.extensions.map(u=>"."+u).join(" ou "),"."]})]}),t.jsx("div",{style:d,align:"center",children:t.jsx(F,{label:"Selecionar Arquivo",onClick:()=>document.getElementById(a).click()})})]}),t.jsx("input",{className:"form-control "+n,type:l,name:e.data.name,id:a,"data-label":N(e.data.label),readOnly:e.data.read_only,onBlur:e.data.onchange?i:null,onChange:r,style:{zIndex:"-1",marginTop:-20},accept:s})]})}else{var c=ae;return l=="color"&&(c={...ae},c.width="100%",c.height=47.5),t.jsxs(t.Fragment,{children:[t.jsx("input",{className:"form-control "+n,type:l,name:e.data.name,id:a,defaultValue:e.data.value,"data-label":N(e.data.label),readOnly:e.data.read_only,onBlur:e.data.onchange?i:null,onChange:r,style:c}),e.data.type=="password"&&t.jsx(k,{icon:"eye",style:{marginTop:-35,marginLeft:"90%",width:20,color:"#CCC",cursor:"pointer"},onClick:h})]})}}function h(l){const s=document.getElementById(a);s.type=s.type=="text"?"password":"text"}return o()}function Be(e){var n=[];Array.isArray(e.data.value)?e.data.value.forEach(function(v,p){n.push({id:v.id,value:v.label})}):e.data.value!=null&&n.push({id:e.data.value.id,value:e.data.value.label}),e.data.id==null&&(e.data.id=Math.random()),e.data.id2==null&&(e.data.id2=e.data.id+"__autocomplete");const a=e.data.id,i=e.data.id2,r=Array.isArray(e.data.value),[o,h]=I.useState(!1),[l,s]=I.useState(null);var c=!1;let d;I.useEffect(()=>{j(n,!0),document.getElementById(a).addEventListener("customchange",function(v){j(v.detail.value);const p=document.getElementById(e.data.name);p&&reactTriggerChange(p)})},[]);function u(){const v=document.getElementById(a);if(r){const p={padding:5,display:"inline"},E={cursor:"pointer",marginRight:5},D={fontSize:"0.8rem"};return t.jsxs("div",{children:[v==null&&n.map((W,q)=>t.jsxs("div",{style:p,children:[t.jsx("span",{onClick:()=>z(q),style:E,children:t.jsx(k,{icon:"trash-can",style:D})}),W.value]},Math.random())),v!=null&&Array.from(v.options).map((W,q)=>t.jsxs("div",{style:p,children:[t.jsx("span",{onClick:()=>z(q),style:E,children:t.jsx(k,{icon:"trash-can",style:D})}),W.innerHTML]},Math.random()))]})}}function m(){return t.jsx("select",{id:a,name:e.data.name,multiple:r,readOnly:!0,style:{display:"contents"}})}function g(){const v={...ae,...e.style||{}},p={padding:0,margin:0,border:"solid 1px #d9d9d9",marginTop:-1,borderRadius:5,maxHeight:150,overflowY:"auto",zIndex:99999};p.position="absolute",p.backgroundColor="var(--default-background)";const E=document.getElementById(i);if(e.data.icon&&(v.paddingLeft=30),E){let q=E,b=null;for(;!b&&(q=q.parentElement)instanceof HTMLElement;)q.matches("dialog")&&(b=q);const S=E.getBoundingClientRect();p.width=S.width,p.top=80,p.left=5}const D={cursor:"pointer",padding:10},W=!r&&n.length>0&&n[0].value||"";return t.jsxs(t.Fragment,{children:[t.jsx(k,{icon:"search",style:{position:"absolute",right:20,top:45}}),t.jsx("input",{id:i,name:e.data.name+"__autocomplete",type:"text",className:"form-control",autocomplete:"off",onFocus:q=>{q.target.select(),B(q)},onChange:B,onMouseLeave:y,onBlur:y,defaultValue:W,style:v,"data-label":N(e.data.label)}),l&&o&&t.jsxs("ul",{style:p,onMouseLeave:w,onMouseEnter:function(q){c=!0},children:[l.length==0&&t.jsx("li",{style:D,children:"Nenhuma opção encontrada."}),l.map(q=>t.jsx("li",{onClick:()=>{h(!1),e.onSelect?e.onSelect(q):j(q)},style:D,className:"autocomplete-item","data-label":N(q.value),children:q.value},Math.random()))]})]})}function y(v){c=!1,setTimeout(function(){c||w(v)},250)}function w(v){const p=document.getElementById(a);if(p){const E=document.getElementById(i);r||(p.options.length==0||p.options.length>0&&E.value!=p.options[0].innerHTML)&&(p.innerHTML="",E.value="",h(!1),e.data.onchange&&re(E,e.data.onchange)),v.target.tagName=="UL"?h(!1):c||h(!1)}}function B(v){clearTimeout(d),d=setTimeout(function(){const p=v.target.closest("form"),E=e.data.choices.indexOf("?")<0?"?":"&";h(!0),O("GET",ee(e.data.choices+E+"term="+v.target.value,p),function(W){s(W)})},100)}function j(v,p=!1){const E=document.getElementById(a),D=document.getElementById(i);E.innerHTML==null&&(E.innerHTML=""),Array.isArray(v)?E.innerHTML=v.map(W=>`<option selected value="${W.id}">${W.value}</option>`).join(""):v?r?(E.innerHTML+=`<option selected value="${v.id}">${v.value}</option>`,D.value=""):(E.innerHTML=`<option selected value="${v.id}">${v.value}</option>`,D.value=v.value):(E.innerHTML="",D.value=""),e.data.onchange&&!p&&re(D,e.data.onchange)}function z(v){const p=document.getElementById(a);var E=Array.from(p.options);p.innerHTML=E.slice(0,v).concat(E.slice(v+1)).map(D=>`<option selected value="${D.value}">${D.innerHTML}</option>`).join(""),s([])}function M(){return t.jsxs(t.Fragment,{children:[m(),g(),u()]})}return M()}function qt(e){function n(){var a={...ae};return a.height=100,t.jsx("textarea",{id:e.data.name,name:e.data.name,"data-label":N(e.data.label),style:a,defaultValue:e.data.value||"",className:"form-control"})}return n()}function Bt(e){return t.jsx(me,{data:e.data})}function me(e){const[n,a]=I.useState(e.data.choices);var i=Math.random(),r=e.data;function o(c){return r.value!=null&&r.value.toString()==c.id.toString()||r.value!=null&&r.value.id!=null&&r.value.id.toString()==c.id.toString()||r.value==null&&c.id.toString()=="null"}function h(c){var d=document.getElementById(c);r.checked&&(d.checked=!1),e.data.onchange&&re(d,e.data.onchange)}function l(c){var d=document.getElementById(c);r.checked=d.checked}function s(){return window["reload-"+r.name+"-field"]=function(){O("GET",ee(e.data.pick,document.querySelector(".radio-group."+r.name).closest("form")),function(d){a(d)})},n.length>0?t.jsx("div",{className:"radio-group "+r.name,children:n.map((c,d)=>(c.id||c.id===!1)&&t.jsxs("div",{style:{paddingTop:10,display:"inline-block",marginRight:25,width:window.innerWidth>800?"auto":"100%"},children:[t.jsx("input",{id:r.name+i+d,type:"radio",name:r.name,defaultValue:c.id,defaultChecked:o(c),"data-label":N(c.value),onClick:function(){h(r.name+i+d)},onMouseEnter:function(){l(r.name+i+d)}}),t.jsx("label",{htmlFor:r.name+i+d,children:c.value})]},i+d))}):t.jsx("div",{className:"radio-group empty "+r.name,children:t.jsx(ie,{data:{text:"Nenhuma opção disponível para seleção."}})})}return s()}function Se(e){const[n,a]=I.useState(e.data.choices);var i=Math.random(),r=e.data;function o(s){var c=!1;if(r.value)for(var d=0;d<r.value.length;d++){var u=r.value[d];(u==s.id||u.id==s.id)&&(c=!0)}return c}function h(s){e.data.onchange&&re(s.target,e.data.onchange)}function l(){return window["reload-"+r.name+"-field"]=function(){O("GET",ee(e.data.pick,document.querySelector(".checkbox-group."+r.name).closest("form")),function(c){a(c)})},n.length>0?t.jsx("div",{className:"checkbox-group "+r.name,children:n.map((s,c)=>(s.id||s.id===!1)&&t.jsxs("div",{style:{paddingTop:10,display:"inline-block",marginRight:25,width:window.innerWidth>800?"auto":"100%"},children:[t.jsx("input",{id:r.name+i+c,type:"checkbox",name:r.name,onClick:h,defaultValue:s.id,defaultChecked:o(s),"data-label":N(s.value)}),t.jsx("label",{htmlFor:r.name+i+c,children:s.value})]},i+c))}):t.jsx("div",{className:"checkbox-group empty "+r.name,children:t.jsx(ie,{data:{text:"Nenhuma opção disponível para seleção."}})})}return l()}function Dt(e){var n=e.data;return t.jsx(t.Fragment,{children:t.jsx("select",{className:"form-control",id:n.name,name:n.name,"data-label":N(n.label),defaultValue:n.value,style:ae,children:n.choices.map(a=>t.jsx("option",{value:a.id,children:a.value},Math.random()))})})}function Rt(e){const n=Math.random(),a=e.data.value[0],i=a.fields?a.fields[0]:a.fieldsets[0].fields[0][0];function r(){return!e.data.required&&t.jsx("div",{id:"info-"+n,children:t.jsxs(ie,{data:{text:"Esta informação é opcional. Controle seu preenchimento com o botão ao lado."},children:[t.jsx(F,{primary:!0,icon:"pen-clip",onClick:()=>o(!0),id:"show-"+n,display:i.value?"none":"inline"}),t.jsx(F,{primary:!0,icon:"trash",onClick:()=>o(!1),id:"hide-"+n,display:i.value?"inline":"none"})]})})}function o(s){const c=document.querySelector("input[name="+i.name+"]"),d=document.getElementById("inline-form-"+n),u=document.getElementById("show-"+n),m=document.getElementById("hide-"+n);d.style.display=s?"block":"none",u.style.display=s?"none":"inline",m.style.display=s?"inline":"none",s?c.value===""?c.value=0:c.value=-parseInt(c.value):parseInt(c.value)==0?c.value="":c.value=-parseInt(c.value)}function h(){const s={display:i.value?"block":"none"};return e.data.required&&(s.display="block",i.value===""&&(i.value=0)),t.jsx("div",{className:"fieldset-inline-forms",style:s,id:"inline-form-"+n,children:e.data.value.map(function(c){return t.jsx(ye,{data:c},Math.random())})})}function l(){const s={margin:0};return t.jsxs("div",{className:"form-fieldset "+e.data.name,children:[t.jsx("h2",{style:s,"data-label":N(e.data.label),children:e.data.label}),r(),h()]})}return l()}function Ot(e){var n=0;const a=Math.random();e.data.template==null&&(e.data.template=e.data.value.pop());function i(d,u){const m=n;return n+=1,t.jsxs("div",{style:{display:"block"},id:"form-"+m+"-"+a,children:[t.jsx(ye,{data:d}),t.jsxs("div",{style:{textAlign:"center",marginTop:10,marginBottom:10},children:[t.jsx(F,{primary:!0,icon:"plus",onClick:()=>o(),id:"extra-add-"+m+"-",display:u}),t.jsx(F,{primary:!0,icon:"trash",onClick:()=>h(m),display:"inline"})]})]},Math.random())}function r(){const d=l(),u=d.length>0?"none":"inline";document.getElementById("add-"+a).style.display=u;for(var m=0;m<n;m++){var g=document.getElementById("extra-add-"+m+"-");g.style.display="none"}if(d.length>0){var g=document.getElementById("extra-add-"+d[d.length-1]+"-");g.style.display="inline"}}function o(){r();var d=JSON.parse(JSON.stringify(e.data.template));d.fields?(d.fields.map(function(u){u.name=u.name.replace("__n__","__"+n+"__")}),d.fields[0].value=0):d.fieldsets.map(function(u){u.fields.map(function(m){m.map(function(g){g.name=g.name.replace("__n__","__"+n+"__")}),m[0].value=0})}),Y.createRoot(document.getElementById(a).appendChild(document.createElement("div"))).render(i(d,"inline")),setTimeout(r,100)}function h(d){const u=e.data.template,g=(u.fields?u.fields[0]:u.fieldsets[0].fields[0][0]).name.replace("__n__","__"+d+"__"),y=document.querySelector("input[name="+g+"]");parseInt(y.value)==0?y.value="":y.value=-parseInt(y.value),document.getElementById("form-"+d+"-"+a).style.display="none",r()}function l(){for(var d=[],u=0;u<n;u++)document.getElementById("form-"+u+"-"+a).style.display=="block"&&d.push(u);return d}function s(){return t.jsx("div",{id:"info-"+a,children:t.jsx(ie,{data:{text:'Clique no botão com o ícone de "+" para adicionar e com o ícone da "lixeira" para remover.'},children:t.jsx(F,{primary:!0,icon:"add",onClick:()=>o(),id:"add-"+a,display:e.data.value.length>0?"none":"inline"})})})}function c(){const d={margin:0};return t.jsxs("div",{className:"form-fieldset "+e.data.name,children:[t.jsx("h2",{style:d,"data-label":N(e.data.label),children:e.data.label}),t.jsx("div",{children:!1}),t.jsxs("div",{id:a,className:"fieldset-inline-forms",children:[s(),e.data.value.map(function(u,m){return i(u,m==e.data.value.length-1?"inline":"none")})]})]})}return c()}function ye(e){I.useEffect(()=>{e.data.controls&&qe(e.data.controls)},[]);function n(i){return i.type=="inline"?i.max==i.min==1?t.jsx(Rt,{data:i},Math.random()):t.jsx(Ot,{data:i},Math.random()):t.jsx(le,{data:i},Math.random())}function a(){return e.data.fields?e.data.fields.length>0?t.jsx("div",{className:"form-fields default-fieldset",children:e.data.fields.map(i=>n(i))}):null:e.data.fieldsets.map(i=>t.jsx("div",{className:"form-fieldset "+i.name,children:i.type=="inline"?n(i):t.jsxs(t.Fragment,{children:[t.jsx("h2",{"data-label":N(i.title),style:{margin:0},children:i.title}),i.fields.map(r=>t.jsx("div",{children:r.map(o=>t.jsx("div",{className:"form-field "+o.name,style:{verticalAlign:"bottom",width:(window.innerWidth>600?100/r.length:100)+"%",display:o.type=="hidden"?"none":"inline-block"},children:n(o)},Math.random()))},Math.random()))]})},Math.random()))}return a()}function _t(e){const n=Math.random();I.useEffect(()=>{e.data.autosubmit&&setInterval(u,e.data.autosubmit*1e3)},[]);function a(){const m={margin:0,color:T.colors.primary};return t.jsx("h1",{style:m,children:e.data.title})}function i(){return e.data.info&&t.jsx(K,{data:{text:e.data.info}})}function r(){if(e.data.display)return t.jsxs(t.Fragment,{children:[e.data.display.map(m=>t.jsx(x,{data:m},Math.random())),t.jsx("div",{style:{marginTop:30}})]})}function o(){return t.jsx(ye,{data:e.data})}function h(){return t.jsxs("div",{style:{marginTop:20,textAlign:"right"},children:[t.jsx(F,{onClick:d,label:"Cancelar",default:!0,display:"inline"}),t.jsx(F,{onClick:u,label:e.data.submit_label,primary:!0,display:"inline",icon:e.data.submit_icon,spin:!0})]})}function l(){return t.jsx("div",{id:"output",style:{marginTop:30}})}function s(){if(e.data.image)return t.jsx("div",{style:{margin:"auto",width:"100%",textAlign:"center"},children:t.jsx("img",{src:e.data.image})})}function c(){return t.jsxs("form",{id:n,className:e.data.key,action:e.data.url,style:{margin:"auto"},method:e.data.method,children:[t.jsx("div",{children:!1}),t.jsxs("div",{style:{padding:5},children:[a(),s(),i(),r(),o(),h(),l()]})]})}function d(){document.getElementsByTagName("dialog").length>0?Z():history.back()}function u(m){m&&m.preventDefault();var g=e.data.url,y=document.getElementById(n),w=new FormData(y);if(y.method.toUpperCase()=="GET"){const B=g.indexOf("?")>=0?"&":"?";g=g+B+"form="+e.data.key+"&"+new URLSearchParams(w).toString(),w=null}e.data.autosubmit&&m==null&&(g+="&autosubmit=1"),O(y.method.toUpperCase(),g,function(j){if(y.querySelectorAll(".error").forEach(M=>M.style.display="none"),m&&m.target.dataset.spinning&&(m.target.querySelector("i.fa-spin").style.display="none",m.target.querySelector("i.fa-"+m.target.dataset.spinning).style.display="inline-block"),j.type=="response")if(j.store&&Me(j.store),j.redirect&&j.redirect.length>2)j.message&&localStorage.setItem("message",j.message),document.location.href=$(j.redirect);else if(j.message&&G(j.message),j.task){let M=function(){O("GET","/api/job/progress/"+j.task+"/",function(E){E==null||E.progress==100?m.target.innerHTML=v:(m.target.innerHTML="Aguarde... ("+(E.progress||0)+"%)",setTimeout(M,5e3))})};const v=m.target.innerHTML;m.target.innerHTML="Aguarde... (0%)",M()}else j.redirect==".."&&(document.getElementsByTagName("dialog").length==0?history.back():Z()),j.redirect=="."&&(document.getElementsByTagName("dialog").length==0?y.reset():Z()),j.dispose&&(y.style.display="none"),dt();else if(j.type=="error"){var z=j.text;console.log(j),Object.keys(j.errors).map(function(M){if(M=="__all__")z=j.errors[M];else{const v=y.querySelector("#"+M+"_error");v==null?z=M+":"+j.errors[M]:(v.querySelector("span").innerHTML=j.errors[M],v.style.display="block")}}),G(z,!0)}else if(j.type!="redirect"){const M=document.querySelector("#output");M.innerHTML="",Y.createRoot(M.appendChild(document.createElement("div"))).render(t.jsx(x,{data:j}))}},w)}return c()}function Wt(e){_(`
147
147
  .calendar table{
148
148
  width: 100%;
149
149
  border-spacing: 0px;
@@ -246,7 +246,7 @@ import{j as t,r as I,c as Y,R as Re}from"./react.min.js";const T={colors:{primar
246
246
  background-color: var(--default-background);
247
247
  }
248
248
 
249
- `),e.data.id==null&&(e.data.id=Math.random());const[n,a]=I.useState(e.data);var i=!1;function r(){return n.attrname?t.jsx("h2",{"data-label":N(n.title),children:n.title}):t.jsxs("h1",{"data-label":N(n.title),children:[n.title," ",n.total>10&&"("+n.total+")"]})}function o(){return t.jsxs("div",{className:"title",children:[r(),t.jsx("i",{id:"loader-"+e.data.id,className:"fa-solid fa-circle-notch fa-spin fa-1x"})]})}function h(b){const S=document.getElementById("loader-"+e.data.id);S&&(S.style.display=b?"block":"none")}function l(){return n.subsets&&t.jsx("div",{className:"tabs",children:n.subsets.map(function(b,S){var f=n.subset===b.name||!n.subset&&S==0;return t.jsxs(P,{href:"#",style:{borderBottom:f?"solid 3px #2670e8":0,color:"#0c326f"},onClick:function(C){C.preventDefault(),s(b.name)},dataLabel:N(b.label),children:[b.label," ",t.jsx(zt,{total:b.count})]},Math.random())})})}function s(b){const S=document.getElementById("subset-"+e.data.id);S.value=b||"",p()}function c(b,S,f){const C=document.getElementById("form-"+e.data.id);C.querySelector("input[name="+n.calendar.field+"__day]").value=b||"",C.querySelector("input[name="+n.calendar.field+"__month]").value=S||"",C.querySelector("input[name="+n.calendar.field+"__year]").value=f||"",w(1)}function d(){if(n.calendar)return t.jsx(Wt,{data:n.calendar,onChange:c})}function u(b){const S={textAlign:"left",verticalAlign:"top",lineHeight:"1.2rem",color:"var(--default-color)",padding:5};if(!(window.innerWidth<800))return t.jsxs("tr",{children:[b.map(function(f){return f.label!="ID"&&t.jsx("th",{style:S,className:"bold",children:f.label},Math.random())}),t.jsx("th",{style:S})]})}function m(b){const S=b.style,f={borderBottom:"var(--input-border)",padding:5},C={borderBottom:"var(--input-border)",lineHeight:"3rem",textAlign:"right"};return window.innerWidth<800?t.jsxs("tr",{className:S||"",children:[t.jsx("td",{style:f,children:b.title},Math.random()),t.jsx("td",{style:C,children:t.jsx("div",{style:{verticalAlign:"center"},children:t.jsx(k,{icon:"chevron-right",onClick:()=>Pe(b.actions),style:{cursor:"pointer",marginRight:20}})})})]},Math.random()):t.jsxs("tr",{className:S||"",children:[b.data.map(function(A){return A.label!="ID"&&t.jsx("td",{style:f,children:V(A.value)},Math.random())}),t.jsx("td",{style:C,children:t.jsx("div",{style:{verticalAlign:"center"},children:b.actions.map(function(A){return t.jsx(U,{data:A,default:!0},Math.random())})})})]},Math.random())}function g(){return n.data.length>0?(n.render==null&&window.innerWidth<800&&(n.renderer="rows"),n.renderer?n.renderer=="cards"?t.jsx(X,{width:300,alignItems:"start",children:n.data.map(function(b){return b.type=n.renderer,t.jsx(x,{data:b},Math.random())})}):t.jsx("div",{style:{marginBottom:15},children:n.data.map(function(b){return b.type=n.renderer,t.jsx(x,{data:b},Math.random())})}):y()):t.jsx(ie,{data:{text:"Nenhum registro encontrado."}})}function y(){const b={width:"100%",overflowX:"auto"},S={width:"100%",lineHeight:"2rem",borderSpacing:0};return t.jsx("div",{style:b,children:t.jsxs("table",{style:S,children:[t.jsx("thead",{children:u(n.data[0].data)}),t.jsx("tbody",{children:n.data.map(function(f){return m(f)})})]})})}function w(b){const f=document.getElementById("form-"+e.data.id).querySelector("input[name=page]");f&&(f.value=b),p(),z()}function B(){const b=document.getElementById("form-"+e.data.id);if(b){const S=b.querySelector("input[name=page]");S&&(S.value=n.pagination.page.current)}return t.jsx(Ft,{data:n.pagination,onChange:w,total:n.total})}function j(){return n.actions.length>0&&t.jsxs("div",{align:"right",style:{marginTop:20,marginBottom:20},children:[n.actions.map(function(b){return t.jsx(U,{data:b,primary:!0},Math.random())}),n.xlsx&&t.jsx(F,{onClick:v,label:"Exportar",icon:"file-excel",display:"inline-block"})]})}function z(){const b=document.getElementById(e.data.id).getBoundingClientRect().top+window.scrollY;window.scrollTo({top:b,behavior:"smooth"})}function M(){const b={backgroundColor:"var(--auxiliary-background)",marginBottom:10,padding:10,borderRadius:"var(--border-radius)"},S=n.search.length>0,f=n.filters.length>0;if((n.bi||e.data.data.length>=0)&&(S||f)){const C={name:"q",mask:null,type:"text",label:"Palavras-chaves",value:n.q};return t.jsxs("div",{style:b,children:[t.jsxs(X,{width:250,children:[S&&t.jsx("div",{children:t.jsx(le,{data:C})}),f&&n.filters.map(function(A){return A.type!="hidden"&&t.jsx("div",{children:t.jsx(le,{data:A})},Math.random())}),t.jsx("div",{children:t.jsx(F,{onClick:p,label:"Filtrar",icon:"filter"})})]}),f&&n.filters.map(function(A){return A.type=="hidden"&&t.jsx("div",{children:t.jsx(le,{data:A})},Math.random())})]})}}function v(){i=!0,p()}function p(){var b;const S=new URLSearchParams(new FormData(document.getElementById("form-"+e.data.id))).toString();e.data.url.indexOf("?")>0?b=e.data.url+"&"+S:b=e.data.url+"?"+S,i?(b+="&xlsx=1",i=!1):h(!0),O("GET",b,function(f){a(f),h(!1)})}function E(){const b={color:"var(--default-color)"};return e.data.reloadable&&t.jsxs("div",{align:"center",children:[t.jsxs("i",{children:["Ultima atualização em ",new Date().toLocaleTimeString()]}),t.jsx("div",{children:t.jsx(P,{style:b,onClick:S=>{S.preventDefault(),p()},children:"Atualizar agora"})})]})}function D(){return n.bi?t.jsxs(t.Fragment,{children:[M(),n.bi.map(function(b){return t.jsx(X,{width:300,alignItems:"start",children:b.map(function(S){return t.jsx("div",{children:t.jsx(x,{data:S})},Math.random())})},Math.random())})]}):t.jsxs("div",{className:"content",children:[W(),E(),j(),l(),M(),d(),g(),B()]})}function W(){return n.info&&t.jsx(K,{data:{text:n.info}})}function q(){window[e.data.id]=()=>p();const b={backgroundColor:"white",padding:20};return t.jsx("div",{className:"reloadable queryset",id:e.data.id,sytle:b,children:t.jsxs("form",{id:"form-"+e.data.id,children:[t.jsx("div",{children:!1}),t.jsx("input",{type:"hidden",name:"subset",id:"subset-"+e.data.id}),o(),D()]})})}return q()}function ce(e){var n=Math.random();function a(){var i=document.getElementById(n);if(i){var r=echarts.init(i);r.setOption(e.option)}else setTimeout(a,1e3)}return setTimeout(a,1e3),t.jsx("div",{id:n,style:{width:"100%",height:300}})}function be(e){var n=[["70%","78%"],["60%","68%"],["50%","58%"],["40%","48%"],["30%","48%"],["20%","28%"],["10%","18%"]];function a(){return e.headers?e.headers.slice(1).map(function(r,o){return{name:r,type:"pie",radius:n[o],emphasis:{label:{show:!0,formatter:function(h){return h.value.toLocaleString("pt-BR")},fontWeight:"bold"}},roseType:null,data:e.rows.map(function(h){return{name:h[0],value:h[o+1]}})}}):{name:null,type:"pie",radius:e.donut?["25%","65%"]:["0%","75%"],emphasis:{label:{show:!0,formatter:function(r){return r.value.toLocaleString("pt-BR")},fontWeight:"bold"}},roseType:e.area?"area":null,data:e.rows.map(function(r,o){return console.log(r),{name:r[0],value:r[1],itemStyle:{color:r[2]}}})}}function i(){var r={tooltip:{trigger:"item",formatter:function(o){return`${o.name}: <b>${o.data.value.toLocaleString("pt-BR")}</b> (${o.percent.toLocaleString("pt-BR")}%)`}},legend:{},label:{show:!0,formatter(o){return o.name+" ("+o.percent.toLocaleString("pt-BR")+"%)"}},series:a()};return t.jsx(ce,{option:r})}return i()}function Pt(e){return t.jsx(be,{donut:!0,headers:e.headers,rows:e.rows})}function Ut(e){return t.jsx(be,{area:!0,headers:e.headers,rows:e.rows})}function J(e){var n=e.invert||!1,a=e.type||"bar",i=e.stack,r={type:"value"},o={show:!0,feature:{mark:{show:!0},saveAsImage:{show:!0}}},h=e.area?{}:null;function l(){return e.headers?{type:"category",data:e.headers.slice(1)}:{type:"category",data:e.rows.map(function(d){return d[0]})}}function s(){return e.headers?e.rows.map(function(d){return{name:d[0],data:d.slice(1),type:a,stack:i,areaStyle:h}}):[{name:null,data:e.rows.map(function(d){return{value:d[1],itemStyle:{color:d[2]}}}),type:a,stack:i,areaStyle:h}]}function c(){var d={toolbox:o,tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(u){return`${u[0].name}: <b>${u[0].value.toLocaleString("pt-BR")}</b>`}},legend:{},label:{show:!0,formatter:function(u){return u.value.toLocaleString("pt-BR")}},xAxis:n?r:l(),yAxis:n?l():r,series:s()};return t.jsx(ce,{option:d})}return c()}function Gt(e){return t.jsx(J,{headers:e.headers,rows:e.rows})}function Vt(e){return t.jsx(J,{type:"line",headers:e.headers,rows:e.rows})}function Yt(e){return t.jsx(J,{area:!0,type:"line",headers:e.headers,rows:e.rows})}function Xt(e){return t.jsx(J,{stack:"1",headers:e.headers,rows:e.rows})}function $t(e){return t.jsx(J,{invert:!0,headers:e.headers,rows:e.rows})}function Jt(e){return t.jsx(J,{invert:!0,stack:"1",headers:e.headers,rows:e.rows})}function Qt(e){function n(){return e.headers?[{type:"treemap",roam:"move",nodeClick:!0,data:e.headers.slice(1).map(function(i,r){return{name:i,type:"pie",children:e.rows.map(function(o){return{name:o[0],value:o[r+1]}})}})}]:[{type:"treemap",roam:"move",nodeClick:!1,data:e.rows.map(function(i){return{name:i[0],value:i[1]}})}]}function a(){var i={tooltip:{trigger:"item"},legend:{},label:{show:!0,formatter(r){return r.name+" ("+r.value.toLocaleString("pt-BR")+")"}},series:n()};return t.jsx(ce,{option:i})}return a()}function Zt(e){function n(){var a={series:[{type:"gauge",startAngle:0,endAngle:360,min:0,max:100,progress:{show:!0,width:38},pointer:null,axisTick:null,splitLine:{length:0},axisLine:{lineStyle:{width:38}},axisLabel:null,detail:{backgroundColor:"#fff",fontSize:"2.5rem",width:"60%",lineHeight:40,height:40,borderRadius:8,offsetCenter:[0,"0%"],valueAnimation:!0,formatter:function(i){return i.toFixed(0)+"%"}},data:[{value:e.value}]}]};return t.jsx(ce,{option:a})}return n()}function Ce(e){function n(){switch(e.type){case"pie":return t.jsx(be,{headers:e.headers,rows:e.rows});case"polar":return t.jsx(Ut,{headers:e.headers,rows:e.rows});case"donut":return t.jsx(Pt,{headers:e.headers,rows:e.rows});case"bar":return t.jsx(Gt,{headers:e.headers,rows:e.rows});case"stacked_bar":return t.jsx(Xt,{headers:e.headers,rows:e.rows});case"column":return t.jsx($t,{headers:e.headers,rows:e.rows});case"stacked_column":return t.jsx(Jt,{headers:e.headers,rows:e.rows});case"tree_map":return t.jsx(Qt,{headers:e.headers,rows:e.rows});case"line":return t.jsx(Vt,{headers:e.headers,rows:e.rows});case"area":return t.jsx(Yt,{headers:e.headers,rows:e.rows});case"progress":return t.jsx(Zt,{headers:e.headers,rows:e.rows});default:return t.jsx(J,{headers:e.headers,rows:e.rows})}}function a(){return t.jsxs("div",{style:{width:"100%",margin:"auto"},children:[e.title&&t.jsx("h2",{className:"title",children:e.title}),n()]})}return a()}function Kt(e){_(`
249
+ `),e.data.id==null&&(e.data.id=Math.random());const[n,a]=I.useState(e.data);var i=!1;function r(){return n.attrname?t.jsx("h2",{"data-label":N(n.title),children:n.title}):t.jsxs("h1",{"data-label":N(n.title),children:[n.title," ",n.total>10&&"("+n.total+")"]})}function o(){return t.jsxs("div",{className:"title",children:[r(),t.jsx("i",{id:"loader-"+e.data.id,className:"fa-solid fa-circle-notch fa-spin fa-1x"})]})}function h(b){const S=document.getElementById("loader-"+e.data.id);S&&(S.style.display=b?"block":"none")}function l(){return n.subsets&&t.jsx("div",{className:"tabs",children:n.subsets.map(function(b,S){var f=n.subset===b.name||!n.subset&&S==0;return t.jsxs(P,{href:"#",style:{borderBottom:f?"solid 3px #2670e8":0,color:"#0c326f"},onClick:function(C){C.preventDefault(),s(b.name)},dataLabel:N(b.label),children:[b.label," ",t.jsx(zt,{total:b.count})]},Math.random())})})}function s(b){const S=document.getElementById("subset-"+e.data.id);S.value=b||"",p()}function c(b,S,f){const C=document.getElementById("form-"+e.data.id);C.querySelector("input[name="+n.calendar.field+"__day]").value=b||"",C.querySelector("input[name="+n.calendar.field+"__month]").value=S||"",C.querySelector("input[name="+n.calendar.field+"__year]").value=f||"",w(1)}function d(){if(n.calendar)return t.jsx(Wt,{data:n.calendar,onChange:c})}function u(b){const S={textAlign:"left",verticalAlign:"top",lineHeight:"1.2rem",color:"var(--default-color)",padding:5};if(!(window.innerWidth<800))return t.jsxs("tr",{children:[b.map(function(f){return f.label!="ID"&&t.jsx("th",{style:S,className:"bold",children:f.label},Math.random())}),t.jsx("th",{style:S})]})}function m(b){const S=b.style,f={borderBottom:"var(--input-border)",padding:5},C={borderBottom:"var(--input-border)",lineHeight:"3rem",textAlign:"right"};return window.innerWidth<800?t.jsxs("tr",{className:S||"",children:[t.jsx("td",{style:f,children:b.title},Math.random()),t.jsx("td",{style:C,children:t.jsx("div",{style:{verticalAlign:"center"},children:t.jsx(k,{icon:"chevron-right",onClick:()=>Pe(b.actions),style:{cursor:"pointer",marginRight:20}})})})]},Math.random()):t.jsxs("tr",{className:S||"",children:[b.data.map(function(A){return A.label!="ID"&&t.jsx("td",{style:f,children:V(A.value)},Math.random())}),t.jsx("td",{style:C,children:t.jsx("div",{style:{verticalAlign:"center"},children:b.actions.map(function(A){return t.jsx(U,{data:A,default:!0},Math.random())})})})]},Math.random())}function g(){return n.data.length>0?(n.render==null&&window.innerWidth<800&&(n.renderer="rows"),n.renderer?n.renderer=="cards"?t.jsx(X,{width:300,alignItems:"start",children:n.data.map(function(b){return b.type=n.renderer,t.jsx(x,{data:b},Math.random())})}):t.jsx("div",{style:{marginBottom:15},children:n.data.map(function(b){return b.type=n.renderer,t.jsx(x,{data:b},Math.random())})}):y()):t.jsx(ie,{data:{text:"Nenhum registro encontrado."}})}function y(){const b={width:"100%",overflowX:"auto"},S={width:"100%",lineHeight:"2rem",borderSpacing:0};return t.jsx("div",{style:b,children:t.jsxs("table",{style:S,children:[t.jsx("thead",{children:u(n.data[0].data)}),t.jsx("tbody",{children:n.data.map(function(f){return m(f)})})]})})}function w(b){const f=document.getElementById("form-"+e.data.id).querySelector("input[name=page]");f&&(f.value=b),p(),z()}function B(){const b=document.getElementById("form-"+e.data.id);if(b){const S=b.querySelector("input[name=page]");S&&(S.value=n.pagination.page.current)}return t.jsx(Ft,{data:n.pagination,onChange:w,total:n.total})}function j(){return(n.xlsx||n.actions.length>0)&&t.jsxs("div",{align:"right",style:{marginTop:20,marginBottom:20},children:[n.actions.map(function(b){return t.jsx(U,{data:b,primary:!0},Math.random())}),n.xlsx&&t.jsx(F,{onClick:v,label:"Exportar",icon:"file-excel",display:"inline-block"})]})}function z(){const b=document.getElementById(e.data.id).getBoundingClientRect().top+window.scrollY;window.scrollTo({top:b,behavior:"smooth"})}function M(){const b={backgroundColor:"var(--auxiliary-background)",marginBottom:10,padding:10,borderRadius:"var(--border-radius)"},S=n.search.length>0,f=n.filters.length>0;if((n.bi||e.data.data.length>=0)&&(S||f)){const C={name:"q",mask:null,type:"text",label:"Palavras-chaves",value:n.q};return t.jsxs("div",{style:b,children:[t.jsxs(X,{width:250,children:[S&&t.jsx("div",{children:t.jsx(le,{data:C})}),f&&n.filters.map(function(A){return A.type!="hidden"&&t.jsx("div",{children:t.jsx(le,{data:A})},Math.random())}),t.jsx("div",{children:t.jsx(F,{onClick:p,label:"Filtrar",icon:"filter"})})]}),f&&n.filters.map(function(A){return A.type=="hidden"&&t.jsx("div",{children:t.jsx(le,{data:A})},Math.random())})]})}}function v(){i=!0,p()}function p(){var b;const S=new URLSearchParams(new FormData(document.getElementById("form-"+e.data.id))).toString();e.data.url.indexOf("?")>0?b=e.data.url+"&"+S:b=e.data.url+"?"+S,i?(b+="&xlsx=1",i=!1):h(!0),O("GET",b,function(f){a(f),h(!1)})}function E(){const b={color:"var(--default-color)"};return e.data.reloadable&&t.jsxs("div",{align:"center",children:[t.jsxs("i",{children:["Ultima atualização em ",new Date().toLocaleTimeString()]}),t.jsx("div",{children:t.jsx(P,{style:b,onClick:S=>{S.preventDefault(),p()},children:"Atualizar agora"})})]})}function D(){return n.bi?t.jsxs(t.Fragment,{children:[M(),n.bi.map(function(b){return t.jsx(X,{width:300,alignItems:"start",children:b.map(function(S){return t.jsx("div",{children:t.jsx(x,{data:S})},Math.random())})},Math.random())})]}):t.jsxs("div",{className:"content",children:[W(),E(),j(),l(),M(),d(),g(),B()]})}function W(){return n.info&&t.jsx(K,{data:{text:n.info}})}function q(){window[e.data.id]=()=>p();const b={backgroundColor:"white",padding:20};return t.jsx("div",{className:"reloadable queryset",id:e.data.id,sytle:b,children:t.jsxs("form",{id:"form-"+e.data.id,children:[t.jsx("div",{children:!1}),t.jsx("input",{type:"hidden",name:"subset",id:"subset-"+e.data.id}),o(),D()]})})}return q()}function ce(e){var n=Math.random();function a(){var i=document.getElementById(n);if(i){var r=echarts.init(i);r.setOption(e.option)}else setTimeout(a,1e3)}return setTimeout(a,1e3),t.jsx("div",{id:n,style:{width:"100%",height:300}})}function be(e){var n=[["70%","78%"],["60%","68%"],["50%","58%"],["40%","48%"],["30%","48%"],["20%","28%"],["10%","18%"]];function a(){return e.headers?e.headers.slice(1).map(function(r,o){return{name:r,type:"pie",radius:n[o],emphasis:{label:{show:!0,formatter:function(h){return h.value.toLocaleString("pt-BR")},fontWeight:"bold"}},roseType:null,data:e.rows.map(function(h){return{name:h[0],value:h[o+1]}})}}):{name:null,type:"pie",radius:e.donut?["25%","65%"]:["0%","75%"],emphasis:{label:{show:!0,formatter:function(r){return r.value.toLocaleString("pt-BR")},fontWeight:"bold"}},roseType:e.area?"area":null,data:e.rows.map(function(r,o){return console.log(r),{name:r[0],value:r[1],itemStyle:{color:r[2]}}})}}function i(){var r={tooltip:{trigger:"item",formatter:function(o){return`${o.name}: <b>${o.data.value.toLocaleString("pt-BR")}</b> (${o.percent.toLocaleString("pt-BR")}%)`}},legend:{},label:{show:!0,formatter(o){return o.name+" ("+o.percent.toLocaleString("pt-BR")+"%)"}},series:a()};return t.jsx(ce,{option:r})}return i()}function Pt(e){return t.jsx(be,{donut:!0,headers:e.headers,rows:e.rows})}function Ut(e){return t.jsx(be,{area:!0,headers:e.headers,rows:e.rows})}function J(e){var n=e.invert||!1,a=e.type||"bar",i=e.stack,r={type:"value"},o={show:!0,feature:{mark:{show:!0},saveAsImage:{show:!0}}},h=e.area?{}:null;function l(){return e.headers?{type:"category",data:e.headers.slice(1)}:{type:"category",data:e.rows.map(function(d){return d[0]})}}function s(){return e.headers?e.rows.map(function(d){return{name:d[0],data:d.slice(1),type:a,stack:i,areaStyle:h}}):[{name:null,data:e.rows.map(function(d){return{value:d[1],itemStyle:{color:d[2]}}}),type:a,stack:i,areaStyle:h}]}function c(){var d={toolbox:o,tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(u){return`${u[0].name}: <b>${u[0].value.toLocaleString("pt-BR")}</b>`}},legend:{},label:{show:!0,formatter:function(u){return u.value.toLocaleString("pt-BR")}},xAxis:n?r:l(),yAxis:n?l():r,series:s()};return t.jsx(ce,{option:d})}return c()}function Gt(e){return t.jsx(J,{headers:e.headers,rows:e.rows})}function Vt(e){return t.jsx(J,{type:"line",headers:e.headers,rows:e.rows})}function Yt(e){return t.jsx(J,{area:!0,type:"line",headers:e.headers,rows:e.rows})}function Xt(e){return t.jsx(J,{stack:"1",headers:e.headers,rows:e.rows})}function $t(e){return t.jsx(J,{invert:!0,headers:e.headers,rows:e.rows})}function Jt(e){return t.jsx(J,{invert:!0,stack:"1",headers:e.headers,rows:e.rows})}function Qt(e){function n(){return e.headers?[{type:"treemap",roam:"move",nodeClick:!0,data:e.headers.slice(1).map(function(i,r){return{name:i,type:"pie",children:e.rows.map(function(o){return{name:o[0],value:o[r+1]}})}})}]:[{type:"treemap",roam:"move",nodeClick:!1,data:e.rows.map(function(i){return{name:i[0],value:i[1]}})}]}function a(){var i={tooltip:{trigger:"item"},legend:{},label:{show:!0,formatter(r){return r.name+" ("+r.value.toLocaleString("pt-BR")+")"}},series:n()};return t.jsx(ce,{option:i})}return a()}function Zt(e){function n(){var a={series:[{type:"gauge",startAngle:0,endAngle:360,min:0,max:100,progress:{show:!0,width:38},pointer:null,axisTick:null,splitLine:{length:0},axisLine:{lineStyle:{width:38}},axisLabel:null,detail:{backgroundColor:"#fff",fontSize:"2.5rem",width:"60%",lineHeight:40,height:40,borderRadius:8,offsetCenter:[0,"0%"],valueAnimation:!0,formatter:function(i){return i.toFixed(0)+"%"}},data:[{value:e.value}]}]};return t.jsx(ce,{option:a})}return n()}function Ce(e){function n(){switch(e.type){case"pie":return t.jsx(be,{headers:e.headers,rows:e.rows});case"polar":return t.jsx(Ut,{headers:e.headers,rows:e.rows});case"donut":return t.jsx(Pt,{headers:e.headers,rows:e.rows});case"bar":return t.jsx(Gt,{headers:e.headers,rows:e.rows});case"stacked_bar":return t.jsx(Xt,{headers:e.headers,rows:e.rows});case"column":return t.jsx($t,{headers:e.headers,rows:e.rows});case"stacked_column":return t.jsx(Jt,{headers:e.headers,rows:e.rows});case"tree_map":return t.jsx(Qt,{headers:e.headers,rows:e.rows});case"line":return t.jsx(Vt,{headers:e.headers,rows:e.rows});case"area":return t.jsx(Yt,{headers:e.headers,rows:e.rows});case"progress":return t.jsx(Zt,{headers:e.headers,rows:e.rows});default:return t.jsx(J,{headers:e.headers,rows:e.rows})}}function a(){return t.jsxs("div",{style:{width:"100%",margin:"auto"},children:[e.title&&t.jsx("h2",{className:"title",children:e.title}),n()]})}return a()}function Kt(e){_(`
250
250
  .statistics .odd {
251
251
  background-color: #EEE;
252
252
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: slthcore
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: API generator based on yml file
5
5
  Home-page: https://github.com/brenokcc
6
6
  Author: Breno Silva
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes