@unvired/turboforms-embed-sdk 2.0.23 → 2.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/turboforms.esm.js +3 -3
- package/dist/turboforms.html +1 -1
- package/dist/turboforms.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,9 +31,9 @@ npm install unvired-forms-sdk
|
|
|
31
31
|
<div id="form-container"></div>
|
|
32
32
|
|
|
33
33
|
<script type="module">
|
|
34
|
-
import {
|
|
34
|
+
import { loadForms } from './dist/unvired-forms-sdk.js';
|
|
35
35
|
|
|
36
|
-
const formInstance =
|
|
36
|
+
const formInstance = loadForms({
|
|
37
37
|
formsData: formTemplateData,
|
|
38
38
|
submissionData: preFillData || {},
|
|
39
39
|
eventCallback: function (event) {
|
|
@@ -71,7 +71,7 @@ npm install unvired-forms-sdk
|
|
|
71
71
|
|
|
72
72
|
```jsx
|
|
73
73
|
import React, { useRef, useEffect } from 'react';
|
|
74
|
-
import {
|
|
74
|
+
import { loadForms } from 'unvired-forms-sdk';
|
|
75
75
|
|
|
76
76
|
const UnviredForm = ({ formData, onSubmit, onBack }) => {
|
|
77
77
|
const containerRef = useRef(null);
|
|
@@ -79,7 +79,7 @@ const UnviredForm = ({ formData, onSubmit, onBack }) => {
|
|
|
79
79
|
|
|
80
80
|
useEffect(() => {
|
|
81
81
|
if (containerRef.current && formData) {
|
|
82
|
-
formInstanceRef.current =
|
|
82
|
+
formInstanceRef.current = loadForms({
|
|
83
83
|
formsData: formData,
|
|
84
84
|
submissionData: {},
|
|
85
85
|
eventCallback: (event) => {
|
|
@@ -119,7 +119,7 @@ export default UnviredForm;
|
|
|
119
119
|
|
|
120
120
|
```typescript
|
|
121
121
|
import { Component, ElementRef, ViewChild, Input, Output, EventEmitter } from '@angular/core';
|
|
122
|
-
import {
|
|
122
|
+
import { loadForms, FormEvent } from 'unvired-forms-sdk';
|
|
123
123
|
|
|
124
124
|
@Component({
|
|
125
125
|
selector: 'app-unvired-form',
|
|
@@ -133,7 +133,7 @@ export class UnviredFormComponent {
|
|
|
133
133
|
|
|
134
134
|
ngOnInit() {
|
|
135
135
|
if (this.formData) {
|
|
136
|
-
|
|
136
|
+
loadForms({
|
|
137
137
|
formsData: this.formData,
|
|
138
138
|
submissionData: {},
|
|
139
139
|
eventCallback: (event: FormEvent) => {
|
|
@@ -165,8 +165,8 @@ export class UnviredFormComponent {
|
|
|
165
165
|
```javascript
|
|
166
166
|
// In your Cordova app's main JavaScript file
|
|
167
167
|
document.addEventListener('deviceready', function() {
|
|
168
|
-
import('./js/unvired-forms-sdk.js').then(({
|
|
169
|
-
const formInstance =
|
|
168
|
+
import('./js/unvired-forms-sdk.js').then(({ loadForms }) => {
|
|
169
|
+
const formInstance = loadForms({
|
|
170
170
|
formsData: formTemplateData,
|
|
171
171
|
submissionData: {},
|
|
172
172
|
eventCallback: function (event) {
|
|
@@ -198,7 +198,7 @@ document.addEventListener('deviceready', function() {
|
|
|
198
198
|
|
|
199
199
|
## 📋 API Reference
|
|
200
200
|
|
|
201
|
-
###
|
|
201
|
+
### loadFormsParams
|
|
202
202
|
|
|
203
203
|
| Property | Type | Required | Description |
|
|
204
204
|
|----------|------|----------|-------------|
|
|
@@ -356,10 +356,10 @@ You can listen for this event in your host application and call `preInitialize()
|
|
|
356
356
|
|
|
357
357
|
## 🔧 Form Instance Methods
|
|
358
358
|
|
|
359
|
-
The `
|
|
359
|
+
The `loadForms` function returns a FormInstance object with the following methods:
|
|
360
360
|
|
|
361
361
|
```javascript
|
|
362
|
-
const formInstance =
|
|
362
|
+
const formInstance = loadForms(params);
|
|
363
363
|
|
|
364
364
|
// Send actions to the form
|
|
365
365
|
formInstance.sendAction({
|
|
@@ -423,7 +423,7 @@ formInstance.sendAction({
|
|
|
423
423
|
The SDK provides comprehensive error handling with specific error codes:
|
|
424
424
|
|
|
425
425
|
```javascript
|
|
426
|
-
|
|
426
|
+
loadForms({
|
|
427
427
|
// ... other params
|
|
428
428
|
eventCallback: function(event) {
|
|
429
429
|
if (event.type === 'ERROR') {
|
package/dist/turboforms.esm.js
CHANGED
|
@@ -25,7 +25,7 @@ function V(t,n,r=!1){if(r||console.log("[Lib:FormUtils] \u25B6 attachNestedForms
|
|
|
25
25
|
<div style="text-align:center;padding:50px;color:#999;">
|
|
26
26
|
<i class="folder open outline icon" style="font-size:40px;"></i>
|
|
27
27
|
<div>No documents available</div>
|
|
28
|
-
</div>`,window.showDynamicModal("App Documents",[{label:"Close",callback:()=>{},className:"btn btn-secondary footer-btn footer-btn-secondary"}],n),window.downloadDocument||(window.downloadDocument=async function(r){let e=(await fe()).find(f=>f.id==r);if(!e){console.log("\u274C Document not found."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 017, Document not found",data:{reason:"Document not found",technicalError:null}});return}console.log("Downloading:",e);let i=e.url||e.data||e.file&&e.file.data,s=null;if(i&&i.startsWith("data:")){let f=i.indexOf(",");if(f===-1){console.log("\u274C Invalid file format."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 018, Invalid file format",data:{reason:"Invalid file format",technicalError:null}});return}let u=i.substring(0,f),p=i.substring(f+1),l=u.match(/:(.*?);/),h=l?l[1]:"application/octet-stream";if(p=p.replace(/\s/g,""),!/^[A-Za-z0-9+/=]+$/.test(p)){console.error("Invalid base64:",p.slice(0,50)),console.log("\u274C File is corrupted (invalid base64)."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 019, File is corrupted (invalid base64)",data:{reason:"File is corrupted (invalid base64)",technicalError:null}});return}try{let g=atob(p),y=new Uint8Array(g.length);for(let m=0;m<g.length;m++)y[m]=g.charCodeAt(m);let v=new Blob([y],{type:h});if(!v.size){console.log("\u274C File is empty."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 020, File is empty",data:{reason:"File is empty",technicalError:null}});return}s=URL.createObjectURL(v)}catch(g){console.error("Base64 decode failed:",g),g.name==="InvalidCharacterError"?(console.log("\u274C File is corrupted (invalid encoding)."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 021, File is corrupted (invalid encoding)",data:{reason:"File is corrupted (invalid encoding)",technicalError:g}})):(console.log("\u274C Failed to process file."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 022, Failed to process file",data:{reason:"Failed to process file",technicalError:g}}));return}}else if(e.file instanceof Blob){if(!e.file.size){console.log("\u274C File is empty."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 023, File is empty",data:{reason:"File is empty",technicalError:null}});return}s=URL.createObjectURL(e.file)}else{console.log("\u274C No downloadable content found."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 024, No downloadable content found",data:{reason:"No downloadable content found",technicalError:null}});return}let a=document.createElement("a");a.href=s,a.download=e.name||"document",document.body.appendChild(a),a.click(),setTimeout(()=>{URL.revokeObjectURL(s),a.remove()},1e4)})}catch(t){console.error("Load failed",t),console.log("\u274C Failed to load documents."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 025, Failed to load documents",data:{reason:"Failed to load documents",technicalError:t}})}}window.openDocumentsModal=xe;var P=!1,pe="form",z=null;async function he(){window.__unviredPrintHandlerInitialized||(window.__unviredPrintHandlerInitialized=!0,console.log("[Print] \u{1F5A8}\uFE0F Print handler initialized"),window.addEventListener("keydown",async t=>{(t.ctrlKey||t.metaKey)&&(t.key==="p"||t.key==="P")&&(t.preventDefault(),await Ce())}),window.addEventListener("afterprint",()=>{P&&Ee()}))}async function Ce(){var p;if(P||!window.formObj||!window.loadTRform)return;console.log("[Print] \u{1F5A8}\uFE0F Print triggered via Ctrl+P"),P=!0,pe=window.FORM_MODE||"form",z=window.formObj.submission.data,console.log("[Print] \u{1F504} Re-rendering form for print...");let n=window.FORM_TEMPLATE,r=window.FORM_THEME_DATA||{},o=window.FORM_LANGUAGE||"en",e=window.FORM_TRASLATIONS||{},i=window.FORM_CONTROL_DATA||{},s=window.FORM_PRIVATE_EXTERNAL,a=window.FORM_PERMISSION,f=window.FORM_ATTACHMENT_FILE_KEYS||[],u=(p=window.__unviredFormsOptions)==null?void 0:p.container;u&&u.classList.add("printing-in-progress","print-mode");try{let l=JSON.parse(JSON.stringify(window.FORM_TEMPLATE||{})),h=g=>{Array.isArray(g)&&g.forEach(y=>{y&&typeof y=="object"&&(y.collapsible&&(y.collapsed=!1),Array.isArray(y.components)&&h(y.components),Array.isArray(y.columns)&&y.columns.forEach(v=>{v&&Array.isArray(v.components)&&h(v.components)}),Array.isArray(y.rows)&&y.rows.forEach(v=>{Array.isArray(v)&&v.forEach(m=>{m&&Array.isArray(m.components)&&h(m.components)})}))})};l.components&&h(l.components),await window.loadTRform(l,z,r,"print",o,e,i,s,a,f),setTimeout(()=>{var y;console.log("[Print] \u{1F4C4} Cleaning up all colors for pure black & white print...");let g=(y=window.__unviredFormsOptions)==null?void 0:y.container;if(g){g.querySelectorAll("*").forEach(b=>{b.style.setProperty("color","#000","important"),b.style.setProperty("background-color","transparent","important"),b.style.setProperty("background-image","none","important"),(window.getComputedStyle(b).borderStyle!=="none"||b.tagName==="TD"||b.tagName==="TH")&&b.style.setProperty("border-color","#000","important"),b.style.minWidth&&b.style.minWidth!=="0px"&&b.style.setProperty("min-width","0px","important"),(b.tagName==="TH"||b.tagName==="TD")&&b.style.width&&b.style.width!=="1%"&&b.style.width!=="auto"&&b.style.setProperty("width","auto","important")}),g.querySelectorAll(".formio-button-add-row, .formio-button-remove-row").forEach(b=>{b.style.setProperty("display","none","important")}),document.querySelectorAll("#sticky-header, #sticky-footer, #form-back-btn, .form-back-btn, .sdk-loader-back-btn, #progress-bar, .progress-container, #sdk-form-loader, #unvired-more-btn, .back-button, .btn-back, [class*='back-btn'], [id*='back-btn']").forEach(b=>{b.style.setProperty("display","none","important"),b.style.setProperty("opacity","0","important"),b.style.setProperty("visibility","hidden","important")});let m=g.querySelector(".formio-wrapper");if(m){let b=g.clientWidth,S=m.scrollWidth;if(m.querySelectorAll("table").forEach(E=>{E.scrollWidth>S&&(S=E.scrollWidth)}),S>b&&b>0){let E=b/S*.98;console.log(`[Print] \u{1F4C4} Auto-scaling form by ${E.toFixed(2)} to fit screen width (${S}px -> ${b}px).`),m.style.setProperty("zoom",E.toString(),"important")}}}console.log("[Print] \u{1F4C4} Opening print dialog..."),window.print()},1500)}catch(l){console.error("[Print] \u274C Failed to render print mode:",l),P=!1,u&&u.classList.remove("printing-in-progress")}}async function Ee(){var f,u,p;if(!P)return;await new Promise(l=>setTimeout(l,500)),console.log("[Print] ?? Restoring original form mode...");let t=window.FORM_TEMPLATE,n=window.FORM_THEME_DATA||{},r=window.FORM_LANGUAGE||"en",o=window.FORM_TRASLATIONS||{},e=window.FORM_CONTROL_DATA||{},i=window.FORM_PRIVATE_EXTERNAL,s=window.FORM_PERMISSION,a=window.FORM_ATTACHMENT_FILE_KEYS||[];if(!t){console.error("[Print] ?? Missing FORM_TEMPLATE, cannot restore."),P=!1;let l=(f=window.__unviredFormsOptions)==null?void 0:f.container;l&&l.classList.remove("printing-in-progress","print-mode","pdf-mode");return}try{let l=(u=window.__unviredFormsOptions)==null?void 0:u.container;if(l&&l.classList.remove("printing-in-progress","print-mode","pdf-mode"),window.formObj&&typeof window.formObj.destroy=="function")try{window.formObj.destroy()}catch(h){console.warn("[Print] ?? Error destroying print form instance:",h)}await window.loadTRform(t,z,n,pe,r,o,e,i,s,a),console.log("[Print] ?? Form restored successfully")}catch(l){console.error("[Print] ?? Failed to restore original mode:",l)}finally{P=!1;let l=(p=window.__unviredFormsOptions)==null?void 0:p.container;l&&l.classList.remove("printing-in-progress")}}var Se=(t,n)=>{if(!t||!n)return;n.primaryColor=n.primaryColor||"#2586c7",n.secondaryColor=n.secondaryColor||"white",n.labelColor=n.labelColor||"#2586c7",n.fontSize=n.fontSize||"14px",n.fontFamily=n.fontFamily||"inherit",n.backgroundColor=n.backgroundColor||"white",n.backgroundImage=n.backgroundImage||"none",n.cardBackground=n.cardBackground||"white",n.headerBackground=n.headerBackground||"white",n.borderColor=n.borderColor||"#c5c5c5";let r={primaryColor:"--tf-primary-color",secondaryColor:"--tf-secondary-color",labelColor:"--tf-app-label-color",fontSize:"--tf-app-font-size-base",fontFamily:"--tf-app-font-family",backgroundColor:"--tf-app-bg-color",backgroundImage:"--tf-app-bg-image",cardBackground:"--tf-app-card-bg",headerBackground:"--tf-app-header-bg",borderColor:"--tf-border-color"};if(Object.keys(r).forEach(o=>{if(n[o]){let e=n[o];(o==="appBackgroundImage"||o==="backgroundImage")&&e&&!e.startsWith("url(")&&e!=="none"&&(e=`url(${e})`),o==="fontSize"&&typeof e=="number"&&(e=`${e}px`),t.style.setProperty(r[o],e,"important")}}),n.primaryColor||n.sdktheme){let o=n.primaryColor||n.sdktheme;if(o.startsWith("#")&&o.length===7){let e=parseInt(o.slice(1,3),16),i=parseInt(o.slice(3,5),16),s=parseInt(o.slice(5,7),16),a=`rgba(${e}, ${i}, ${s}, 0.12)`;t.style.setProperty("--tf-primary-color-transparent",a,"important")}}window.__unviredThemeData=n};async function qe({formsData:t="formIOComponent",submissionData:n,eventCallback:r,container:o,options:e={nestedFormData:[{}],masterData:[{}],mode:"",platform:"",permission:"",language:"",privateExternal:"",title:"the form title entered",descrciption:"the form description entered",translations:{},themeData:{},userData:{},controlData:{},commentsData:[],vobArr:[],appData:[],environmentVariable:[],showComments:!1,showHelp:!1,showBackButton:!1,showLoader:!0,showMoreButton:!0,showFooter:!0,showCompleteAlways:!1,requireCompleteForm:!0}}){var G,Y,K,Z,X,J,Q;window.formdesign=window.formdesign||[];let i=[],s;console.log("[SDK:1] \u25B6 loadForms() started",{title:e==null?void 0:e.title,mode:e==null?void 0:e.mode,permission:e==null?void 0:e.permission,platform:e==null?void 0:e.platform});function a(d){let c=oe(d);typeof r=="function"&&r(c)}try{s=typeof t=="string"?JSON.parse(t):t,console.log("[SDK:2] \u2705 Form JSON parsed",{display:s==null?void 0:s.display,components:(G=s==null?void 0:s.components)==null?void 0:G.length})}catch(d){console.error("[SDK] \u274C Step 2: Failed to parse formsData JSON",d),a({type:"ERROR",errorMessage:"ErrorCode : 001, Invalid formsData JSON",data:{error:d}});return}ae(s,e.appData),console.log("[SDK:3] \u2705 Dynamic values processed. Validating nested forms & master data...");let f=s,u=e.nestedFormData||[],p=e.masterData||[];console.log("-------------------------->>>",e.masterData),console.log("-------------------------->>>",e.nestedFormData);let l=te(s,u);if(l){console.error("[SDK] \u274C Step 3: Nested form validation failed",l),a({type:"ERROR",errorMessage:"ErrorCode : 002, Nested form validation error",data:{technicalError:l}});return}let h=ne(s,p);if(h){console.error("[SDK] \u274C Step 3: Master data validation failed",h),a({type:"ERROR",errorMessage:"ErrorCode : 003, Master data validation error",data:{technicalError:h}});return}if(!(e!=null&&e.userData)){console.error("[SDK] \u274C Step 3: userData not provided"),a({type:"ERROR",errorMessage:"ErrorCode : 004, User Data not Provided",data:{reason:"User Data not Provided"}});return}console.log("[SDK:4] \u2705 Merging nested forms & master data",{nestedForms:u.length,masterDataSets:p.length});let g=V(f,u),y=R(g,p,"dataSrc","masterdata");if(n&&f){console.log("[SDK:5] \u{1F4CE} Validating attachments in submission data...");try{let d=await re(y,n,a);i=d.fileKeys,d.missingFiles.length>0?console.warn("[SDK:5] \u26A0\uFE0F Missing attachment files detected",{missing:d.missingFiles,fileKeys:i}):console.log("[SDK:5] \u2705 Attachments validated",{fileKeys:i})}catch(d){console.warn("[SDK:5] \u26A0\uFE0F Attachment validation skipped (non-fatal)",d)}}else console.log("[SDK:5] \u2139\uFE0F No submission data \u2014 attachment validation skipped");if(e!=null&&e.appData&&((Y=Object.keys(e==null?void 0:e.appData))==null?void 0:Y.length)>0&&N(y,e==null?void 0:e.appData,e),o&&(o.innerHTML="",o.classList.add("tf-formio-sdk"),Se(o,e.themeData)),!document.getElementById("unvired-forms-styles-marker")){let d=document.createElement("meta");d.id="unvired-forms-styles-marker",document.head.appendChild(d),`.r6o-drawing{cursor:none}.r6o-relations-layer.readonly .handle rect{pointer-events:none}.r6o-relations-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.r6o-relations-layer circle{stroke:#515151;stroke-width:.4;fill:#3f3f3f}.r6o-relations-layer path{stroke:#595959;stroke-linecap:round;stroke-linejoin:round;fill:transparent}.r6o-relations-layer path.connection{stroke-width:1.6;stroke-dasharray:2,3}.r6o-relations-layer path.r6o-arrow{stroke-width:1.8;fill:#7f7f7f}.r6o-relations-layer .handle rect{stroke-width:1;stroke:#595959;fill:#fff;pointer-events:auto;cursor:pointer}.r6o-relations-layer .handle text{font-size:10px}.r6o-relations-layer .hover{stroke:#3f3f3fe6;stroke-width:1.4;fill:transparent}.r6o-editor{margin-left:-12px}.r6o-annotation{background-color:#ffa50033;border-bottom:2px solid orange;cursor:pointer}.r6o-selection{background-color:#cfcfffa1;cursor:pointer}.r6o-hide-selection::selection,.r6o-hide-selection ::selection{background:transparent}.r6o-hide-selection::-moz-selection .r6o-hide-selection ::-moz-selection{background:transparent}.r6o-relation-editor{position:absolute;font-family:inherit;font-size:17px;line-height:27px;-webkit-box-shadow:0 1px 14px rgba(0,0,0,.4);-moz-box-shadow:0 1px 14px rgba(0,0,0,.4);box-shadow:0 1px 14px #0006;-webkit-border-radius:3px;-khtml-border-radius:3px;-moz-border-radius:3px;border-radius:3px;transform:translate(-50%,-50%);background-color:#fff}.r6o-relation-editor svg{vertical-align:middle;shape-rendering:geometricPrecision}.r6o-relation-editor *{box-sizing:border-box}.r6o-relation-editor .input-wrapper{height:34px;padding:0 6px;margin-right:68px;font-size:14px;background-color:#ecf0f1;cursor:text;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-radius-topleft:3px;-khtml-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.r6o-relation-editor .input-wrapper .r6o-autocomplete ul{position:relative;left:-6px}.r6o-relation-editor .buttons{position:absolute;display:inline-flex;top:0;right:0}.r6o-relation-editor .buttons span{height:34px;display:inline-block;width:34px;text-align:center;font-size:14px;cursor:pointer;padding:1px 0}.r6o-relation-editor .buttons .delete{background-color:#fff;color:#9ca4b1;border-left:1px solid #e5e5e5}.r6o-relation-editor .buttons .delete:hover{background-color:#f6f6f6}.r6o-relation-editor .buttons .ok{background-color:#4483c4;color:#fff;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-radius-topright:3px;-khtml-border-radius-bottomright:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.r6o-relation-editor .buttons .ok:hover{background-color:#4f92d7}.r6o-btn{background-color:#4483c4;border:1px solid #4483c4;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;margin:0;outline:none;text-decoration:none;white-space:nowrap;padding:6px 18px;min-width:70px;vertical-align:middle;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.r6o-btn *{vertical-align:middle;cursor:pointer}.r6o-btn .r6o-icon{margin-right:4px}.r6o-btn:disabled{border-color:#a3c2e2!important;background-color:#a3c2e2!important}.r6o-btn:hover{background-color:#4f92d7;border-color:#4f92d7}.r6o-btn.outline{border:1px solid #4483c4;color:#4483c4;background-color:transparent;text-shadow:none}.r6o-autocomplete{display:inline;position:relative}.r6o-autocomplete div[role=combobox]{display:inline}.r6o-autocomplete input{outline:none;border:none;width:80px;height:100%;line-height:14px;white-space:pre;box-sizing:border-box;background-color:transparent;font-size:14px;color:#3f3f3f}.r6o-autocomplete ul{position:absolute;margin:0;padding:0;list-style-type:none;background-color:#fff;border-radius:3px;border:1px solid #d6d7d9;box-sizing:border-box;box-shadow:0 0 20px #00000040}.r6o-autocomplete ul:empty{display:none}.r6o-autocomplete li{box-sizing:border-box;padding:2px 12px;width:100%;cursor:pointer}.r6o-editable-text{max-height:120px;overflow:auto;outline:none;min-height:2em;font-size:14px;font-family:inherit}.r6o-editable-text:empty:not(:focus):before{content:attr(data-placeholder);color:#c2c2c2}.r6o-widget.comment{font-size:14px;min-height:3em;background-color:#fff;position:relative}.r6o-widget.comment .r6o-editable-text,.r6o-widget.comment .r6o-readonly-comment{padding:10px;width:100%;box-sizing:border-box;outline:none;border:none;background-color:transparent;resize:none}.r6o-widget.comment .r6o-readonly-comment{white-space:pre}.r6o-widget.comment .r6o-editable-text::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text::-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-ms-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-lastmodified{border:1px solid #e5e5e5;display:inline-block;border-radius:2px;margin:0 10px 8px;padding:4px 5px;line-height:100%;font-size:12px}.r6o-widget.comment .r6o-lastmodified .r6o-lastmodified-at{color:#757575;padding-left:3px}.r6o-widget.comment .r6o-arrow-down{position:absolute;height:20px;width:20px;top:9px;right:9px;line-height:22px;background-color:#fff;text-align:center;-webkit-font-smoothing:antialiased;border:1px solid #e5e5e5;cursor:pointer;-webkit-border-radius:1px;-khtml-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.r6o-widget.comment .r6o-arrow-down.r6o-menu-open{border-color:#4483c4}.r6o-widget.comment .r6o-comment-dropdown-menu{position:absolute;top:32px;right:8px;background-color:#fff;border:1px solid #e5e5e5;list-style-type:none;margin:0;padding:5px 0;z-index:9999;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px #0003}.r6o-widget.comment .r6o-comment-dropdown-menu li{padding:0 15px;cursor:pointer}.r6o-widget.comment .r6o-comment-dropdown-menu li:hover{background-color:#ecf0f1}.r6o-widget.comment .r6o-purposedropdown{position:relative;z-index:2}.r6o-widget.comment.editable{background-color:#ecf0f1}.r6o-widget.r6o-tag:empty{display:none}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.r6o-widget.tag .r6o-taglist li{height:27px}.r6o-widget.tag .r6o-taglist li .r6o-delete-wrapper .r6o-delete{position:relative;top:-4px}}.r6o-widget.r6o-tag{background-color:#ecf0f1;border-bottom:1px solid #e5e5e5;padding:1px 3px;display:flex}.r6o-widget.r6o-tag ul{margin:0;padding:0;list-style-type:none;z-index:1}.r6o-widget.r6o-tag ul.r6o-taglist{flex:0;white-space:nowrap}.r6o-widget.r6o-tag ul.r6o-taglist li{display:inline-block;margin:1px 1px 1px 0;padding:0;vertical-align:middle;overflow:hidden;font-size:12px;background-color:#fff;border:1px solid #d6d7d9;cursor:pointer;position:relative;line-height:180%;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 4px rgba(0,0,0,.1);-moz-box-shadow:0 0 4px rgba(0,0,0,.1);box-shadow:0 0 4px #0000001a}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-label{padding:2px 8px;display:inline-block}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper{display:inline-block;padding:2px 0;color:#fff;width:0;height:100%;background-color:#4483c4;-webkit-border-top-right-radius:2px;-webkit-border-bottom-right-radius:2px;-khtml-border-radius-topright:2px;-khtml-border-radius-bottomright:2px;-moz-border-radius-topright:2px;-moz-border-radius-bottomright:2px;border-top-right-radius:2px;border-bottom-right-radius:2px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper .r6o-delete{padding:2px 6px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper svg{vertical-align:text-top}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-active{width:24px;transition:width .2s}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-done,.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit-active{width:0;transition:width .2s}.r6o-widget.r6o-tag .r6o-autocomplete{flex:1;position:relative}.r6o-widget.r6o-tag .r6o-autocomplete li{font-size:14px}.r6o-widget.r6o-tag input{width:100%;padding:0 3px;min-width:80px;outline:none;border:none;line-height:170%;background-color:transparent;color:#3f3f3f}.r6o-widget.r6o-tag input::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input::-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-ms-input-placeholder{color:#c2c2c2}.r6o-editor{position:absolute;z-index:99999;width:400px;color:#3f3f3f;opacity:0;font-family:inherit;font-size:17px;line-height:27px;-webkit-transition:opacity .2s ease-in;-moz-transition:opacity .2s ease-in;transition:opacity .2s ease-in}.r6o-editor .r6o-arrow{position:absolute;overflow:hidden;top:-12px;left:12px;width:28px;height:12px;display:none}.r6o-editor .r6o-arrow:after{content:"";position:absolute;top:5px;left:5px;width:18px;height:18px;background-color:#fff;-webkit-backface-visibility:hidden;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.r6o-editor .r6o-editor-inner{background-color:#fff;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:2px 2px 42px rgba(0,0,0,.4);-moz-box-shadow:2px 2px 42px rgba(0,0,0,.4);box-shadow:2px 2px 42px #0006}.r6o-editor .r6o-editor-inner .r6o-widget:first-child{-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-khtml-border-radius-topleft:2px;-khtml-border-radius-topright:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}.r6o-editor .r6o-editor-inner .r6o-widget{border-bottom:1px solid #e5e5e5}.r6o-editor .r6o-footer{position:relative;text-align:right;padding:8px 0}.r6o-editor .r6o-footer .r6o-btn{margin-right:8px}.r6o-editor .r6o-footer .r6o-btn.delete-annotation{position:absolute;top:7px;left:7px;background-color:transparent;border:none;color:#4483c4;width:32px;height:32px;min-width:0;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center;-webkit-transition:all .1s ease-in;-moz-transition:all .1s ease-in;-o-transition:all .1s ease-in;transition:all .1s ease-in}.r6o-editor .r6o-footer .r6o-btn.delete-annotation:hover{color:#fff;background-color:#ef352c}@media (max-width: 640px){.r6o-editor{width:260px}}.r6o-editor.r6o-arrow-top .r6o-arrow{display:block}.r6o-editor.r6o-arrow-right{margin-left:8px}.r6o-editor.r6o-arrow-right .r6o-arrow{left:auto;right:12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow{display:block;top:auto;bottom:-12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow:after{top:-11px;box-shadow:none}.r6o-editor.pushed .r6o-arrow,.r6o-editor.dragged .r6o-arrow{display:none}.r6o-editor .r6o-draggable{cursor:move}.r6o-purposedropdown{width:150px;display:inline-block}.r6o-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
|
28
|
+
</div>`,window.showDynamicModal("App Documents",[{label:"Close",callback:()=>{},className:"btn btn-secondary footer-btn footer-btn-secondary"}],n),window.downloadDocument||(window.downloadDocument=async function(r){let e=(await fe()).find(f=>f.id==r);if(!e){console.log("\u274C Document not found."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 017, Document not found",data:{reason:"Document not found",technicalError:null}});return}console.log("Downloading:",e);let i=e.url||e.data||e.file&&e.file.data,s=null;if(i&&i.startsWith("data:")){let f=i.indexOf(",");if(f===-1){console.log("\u274C Invalid file format."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 018, Invalid file format",data:{reason:"Invalid file format",technicalError:null}});return}let u=i.substring(0,f),p=i.substring(f+1),l=u.match(/:(.*?);/),h=l?l[1]:"application/octet-stream";if(p=p.replace(/\s/g,""),!/^[A-Za-z0-9+/=]+$/.test(p)){console.error("Invalid base64:",p.slice(0,50)),console.log("\u274C File is corrupted (invalid base64)."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 019, File is corrupted (invalid base64)",data:{reason:"File is corrupted (invalid base64)",technicalError:null}});return}try{let g=atob(p),y=new Uint8Array(g.length);for(let m=0;m<g.length;m++)y[m]=g.charCodeAt(m);let v=new Blob([y],{type:h});if(!v.size){console.log("\u274C File is empty."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 020, File is empty",data:{reason:"File is empty",technicalError:null}});return}s=URL.createObjectURL(v)}catch(g){console.error("Base64 decode failed:",g),g.name==="InvalidCharacterError"?(console.log("\u274C File is corrupted (invalid encoding)."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 021, File is corrupted (invalid encoding)",data:{reason:"File is corrupted (invalid encoding)",technicalError:g}})):(console.log("\u274C Failed to process file."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 022, Failed to process file",data:{reason:"Failed to process file",technicalError:g}}));return}}else if(e.file instanceof Blob){if(!e.file.size){console.log("\u274C File is empty."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 023, File is empty",data:{reason:"File is empty",technicalError:null}});return}s=URL.createObjectURL(e.file)}else{console.log("\u274C No downloadable content found."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 024, No downloadable content found",data:{reason:"No downloadable content found",technicalError:null}});return}let a=document.createElement("a");a.href=s,a.download=e.name||"document",document.body.appendChild(a),a.click(),setTimeout(()=>{URL.revokeObjectURL(s),a.remove()},1e4)})}catch(t){console.error("Load failed",t),console.log("\u274C Failed to load documents."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 025, Failed to load documents",data:{reason:"Failed to load documents",technicalError:t}})}}window.openDocumentsModal=xe;var P=!1,pe="form",z=null;async function he(){window.__unviredPrintHandlerInitialized||(window.__unviredPrintHandlerInitialized=!0,console.log("[Print] \u{1F5A8}\uFE0F Print handler initialized"),window.addEventListener("keydown",async t=>{(t.ctrlKey||t.metaKey)&&(t.key==="p"||t.key==="P")&&(t.preventDefault(),await Ce())}),window.addEventListener("afterprint",()=>{P&&Ee()}))}async function Ce(){var p;if(P||!window.formObj||!window.loadTRform)return;console.log("[Print] \u{1F5A8}\uFE0F Print triggered via Ctrl+P"),P=!0,pe=window.FORM_MODE||"form",z=window.formObj.submission.data,console.log("[Print] \u{1F504} Re-rendering form for print...");let n=window.FORM_TEMPLATE,r=window.FORM_THEME_DATA||{},o=window.FORM_LANGUAGE||"en",e=window.FORM_TRASLATIONS||{},i=window.FORM_CONTROL_DATA||{},s=window.FORM_PRIVATE_EXTERNAL,a=window.FORM_PERMISSION,f=window.FORM_ATTACHMENT_FILE_KEYS||[],u=(p=window.__unviredFormsOptions)==null?void 0:p.container;u&&u.classList.add("printing-in-progress","print-mode");try{let l=JSON.parse(JSON.stringify(window.FORM_TEMPLATE||{})),h=g=>{Array.isArray(g)&&g.forEach(y=>{y&&typeof y=="object"&&(y.collapsible&&(y.collapsed=!1),Array.isArray(y.components)&&h(y.components),Array.isArray(y.columns)&&y.columns.forEach(v=>{v&&Array.isArray(v.components)&&h(v.components)}),Array.isArray(y.rows)&&y.rows.forEach(v=>{Array.isArray(v)&&v.forEach(m=>{m&&Array.isArray(m.components)&&h(m.components)})}))})};l.components&&h(l.components),await window.loadTRform(l,z,r,"print",o,e,i,s,a,f),setTimeout(()=>{var y;console.log("[Print] \u{1F4C4} Cleaning up all colors for pure black & white print...");let g=(y=window.__unviredFormsOptions)==null?void 0:y.container;if(g){g.querySelectorAll("*").forEach(b=>{b.style.setProperty("color","#000","important"),b.style.setProperty("background-color","transparent","important"),b.style.setProperty("background-image","none","important"),(window.getComputedStyle(b).borderStyle!=="none"||b.tagName==="TD"||b.tagName==="TH")&&b.style.setProperty("border-color","#000","important"),b.style.minWidth&&b.style.minWidth!=="0px"&&b.style.setProperty("min-width","0px","important"),(b.tagName==="TH"||b.tagName==="TD")&&b.style.width&&b.style.width!=="1%"&&b.style.width!=="auto"&&b.style.setProperty("width","auto","important")}),g.querySelectorAll(".formio-button-add-row, .formio-button-remove-row").forEach(b=>{b.style.setProperty("display","none","important")}),document.querySelectorAll("#sticky-header, #sticky-footer, #form-back-btn, .form-back-btn, .sdk-loader-back-btn, #progress-bar, .progress-container, #sdk-form-loader, #unvired-more-btn, .back-button, .btn-back, [class*='back-btn'], [id*='back-btn']").forEach(b=>{b.style.setProperty("display","none","important"),b.style.setProperty("opacity","0","important"),b.style.setProperty("visibility","hidden","important")});let m=g.querySelector(".formio-wrapper");if(m){let b=g.clientWidth,S=m.scrollWidth;if(m.querySelectorAll("table").forEach(E=>{E.scrollWidth>S&&(S=E.scrollWidth)}),S>b&&b>0){let E=b/S*.98;console.log(`[Print] \u{1F4C4} Auto-scaling form by ${E.toFixed(2)} to fit screen width (${S}px -> ${b}px).`),m.style.setProperty("zoom",E.toString(),"important")}}}console.log("[Print] \u{1F4C4} Opening print dialog..."),window.print()},1500)}catch(l){console.error("[Print] \u274C Failed to render print mode:",l),P=!1,u&&u.classList.remove("printing-in-progress")}}async function Ee(){var f,u,p;if(!P)return;await new Promise(l=>setTimeout(l,500)),console.log("[Print] ?? Restoring original form mode...");let t=window.FORM_TEMPLATE,n=window.FORM_THEME_DATA||{},r=window.FORM_LANGUAGE||"en",o=window.FORM_TRASLATIONS||{},e=window.FORM_CONTROL_DATA||{},i=window.FORM_PRIVATE_EXTERNAL,s=window.FORM_PERMISSION,a=window.FORM_ATTACHMENT_FILE_KEYS||[];if(!t){console.error("[Print] ?? Missing FORM_TEMPLATE, cannot restore."),P=!1;let l=(f=window.__unviredFormsOptions)==null?void 0:f.container;l&&l.classList.remove("printing-in-progress","print-mode","pdf-mode");return}try{let l=(u=window.__unviredFormsOptions)==null?void 0:u.container;if(l&&l.classList.remove("printing-in-progress","print-mode","pdf-mode"),window.formObj&&typeof window.formObj.destroy=="function")try{window.formObj.destroy()}catch(h){console.warn("[Print] ?? Error destroying print form instance:",h)}await window.loadTRform(t,z,n,pe,r,o,e,i,s,a),console.log("[Print] ?? Form restored successfully")}catch(l){console.error("[Print] ?? Failed to restore original mode:",l)}finally{P=!1;let l=(p=window.__unviredFormsOptions)==null?void 0:p.container;l&&l.classList.remove("printing-in-progress")}}var Se=(t,n)=>{if(!t||!n)return;n.primaryColor=n.primaryColor||"#2586c7",n.secondaryColor=n.secondaryColor||"white",n.labelColor=n.labelColor||"#2586c7",n.fontSize=n.fontSize||"14px",n.fontFamily=n.fontFamily||"inherit",n.backgroundColor=n.backgroundColor||"white",n.backgroundImage=n.backgroundImage||"none",n.cardBackground=n.cardBackground||"white",n.headerBackground=n.headerBackground||"white",n.borderColor=n.borderColor||"#c5c5c5";let r={primaryColor:"--tf-primary-color",secondaryColor:"--tf-secondary-color",labelColor:"--tf-app-label-color",fontSize:"--tf-app-font-size-base",fontFamily:"--tf-app-font-family",backgroundColor:"--tf-app-bg-color",backgroundImage:"--tf-app-bg-image",cardBackground:"--tf-app-card-bg",headerBackground:"--tf-app-header-bg",borderColor:"--tf-border-color"};if(Object.keys(r).forEach(o=>{if(n[o]){let e=n[o];(o==="appBackgroundImage"||o==="backgroundImage")&&e&&!e.startsWith("url(")&&e!=="none"&&(e=`url(${e})`),o==="fontSize"&&typeof e=="number"&&(e=`${e}px`),t.style.setProperty(r[o],e,"important")}}),n.primaryColor||n.sdktheme){let o=n.primaryColor||n.sdktheme;if(o.startsWith("#")&&o.length===7){let e=parseInt(o.slice(1,3),16),i=parseInt(o.slice(3,5),16),s=parseInt(o.slice(5,7),16),a=`rgba(${e}, ${i}, ${s}, 0.12)`;t.style.setProperty("--tf-primary-color-transparent",a,"important")}}window.__unviredThemeData=n};async function ke({formsData:t="formIOComponent",submissionData:n,eventCallback:r,container:o,options:e={nestedFormData:[{}],masterData:[{}],mode:"",platform:"",permission:"",language:"",privateExternal:"",title:"the form title entered",descrciption:"the form description entered",translations:{},themeData:{},userData:{},controlData:{},commentsData:[],vobArr:[],appData:[],environmentVariable:[],showComments:!1,showHelp:!1,showBackButton:!1,showLoader:!0,showMoreButton:!0,showFooter:!0,showCompleteAlways:!1,requireCompleteForm:!0}}){var G,Y,K,Z,X,J,Q;window.formdesign=window.formdesign||[];let i=[],s;console.log("[SDK:1] \u25B6 loadForms() started",{title:e==null?void 0:e.title,mode:e==null?void 0:e.mode,permission:e==null?void 0:e.permission,platform:e==null?void 0:e.platform});function a(d){let c=oe(d);typeof r=="function"&&r(c)}try{s=typeof t=="string"?JSON.parse(t):t,console.log("[SDK:2] \u2705 Form JSON parsed",{display:s==null?void 0:s.display,components:(G=s==null?void 0:s.components)==null?void 0:G.length})}catch(d){console.error("[SDK] \u274C Step 2: Failed to parse formsData JSON",d),a({type:"ERROR",errorMessage:"ErrorCode : 001, Invalid formsData JSON",data:{error:d}});return}ae(s,e.appData),console.log("[SDK:3] \u2705 Dynamic values processed. Validating nested forms & master data...");let f=s,u=e.nestedFormData||[],p=e.masterData||[];console.log("-------------------------->>>",e.masterData),console.log("-------------------------->>>",e.nestedFormData);let l=te(s,u);if(l){console.error("[SDK] \u274C Step 3: Nested form validation failed",l),a({type:"ERROR",errorMessage:"ErrorCode : 002, Nested form validation error",data:{technicalError:l}});return}let h=ne(s,p);if(h){console.error("[SDK] \u274C Step 3: Master data validation failed",h),a({type:"ERROR",errorMessage:"ErrorCode : 003, Master data validation error",data:{technicalError:h}});return}if(!(e!=null&&e.userData)){console.error("[SDK] \u274C Step 3: userData not provided"),a({type:"ERROR",errorMessage:"ErrorCode : 004, User Data not Provided",data:{reason:"User Data not Provided"}});return}console.log("[SDK:4] \u2705 Merging nested forms & master data",{nestedForms:u.length,masterDataSets:p.length});let g=V(f,u),y=R(g,p,"dataSrc","masterdata");if(n&&f){console.log("[SDK:5] \u{1F4CE} Validating attachments in submission data...");try{let d=await re(y,n,a);i=d.fileKeys,d.missingFiles.length>0?console.warn("[SDK:5] \u26A0\uFE0F Missing attachment files detected",{missing:d.missingFiles,fileKeys:i}):console.log("[SDK:5] \u2705 Attachments validated",{fileKeys:i})}catch(d){console.warn("[SDK:5] \u26A0\uFE0F Attachment validation skipped (non-fatal)",d)}}else console.log("[SDK:5] \u2139\uFE0F No submission data \u2014 attachment validation skipped");if(e!=null&&e.appData&&((Y=Object.keys(e==null?void 0:e.appData))==null?void 0:Y.length)>0&&N(y,e==null?void 0:e.appData,e),o&&(o.innerHTML="",o.classList.add("tf-formio-sdk"),Se(o,e.themeData)),!document.getElementById("unvired-forms-styles-marker")){let d=document.createElement("meta");d.id="unvired-forms-styles-marker",document.head.appendChild(d),`.r6o-drawing{cursor:none}.r6o-relations-layer.readonly .handle rect{pointer-events:none}.r6o-relations-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.r6o-relations-layer circle{stroke:#515151;stroke-width:.4;fill:#3f3f3f}.r6o-relations-layer path{stroke:#595959;stroke-linecap:round;stroke-linejoin:round;fill:transparent}.r6o-relations-layer path.connection{stroke-width:1.6;stroke-dasharray:2,3}.r6o-relations-layer path.r6o-arrow{stroke-width:1.8;fill:#7f7f7f}.r6o-relations-layer .handle rect{stroke-width:1;stroke:#595959;fill:#fff;pointer-events:auto;cursor:pointer}.r6o-relations-layer .handle text{font-size:10px}.r6o-relations-layer .hover{stroke:#3f3f3fe6;stroke-width:1.4;fill:transparent}.r6o-editor{margin-left:-12px}.r6o-annotation{background-color:#ffa50033;border-bottom:2px solid orange;cursor:pointer}.r6o-selection{background-color:#cfcfffa1;cursor:pointer}.r6o-hide-selection::selection,.r6o-hide-selection ::selection{background:transparent}.r6o-hide-selection::-moz-selection .r6o-hide-selection ::-moz-selection{background:transparent}.r6o-relation-editor{position:absolute;font-family:inherit;font-size:17px;line-height:27px;-webkit-box-shadow:0 1px 14px rgba(0,0,0,.4);-moz-box-shadow:0 1px 14px rgba(0,0,0,.4);box-shadow:0 1px 14px #0006;-webkit-border-radius:3px;-khtml-border-radius:3px;-moz-border-radius:3px;border-radius:3px;transform:translate(-50%,-50%);background-color:#fff}.r6o-relation-editor svg{vertical-align:middle;shape-rendering:geometricPrecision}.r6o-relation-editor *{box-sizing:border-box}.r6o-relation-editor .input-wrapper{height:34px;padding:0 6px;margin-right:68px;font-size:14px;background-color:#ecf0f1;cursor:text;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-radius-topleft:3px;-khtml-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.r6o-relation-editor .input-wrapper .r6o-autocomplete ul{position:relative;left:-6px}.r6o-relation-editor .buttons{position:absolute;display:inline-flex;top:0;right:0}.r6o-relation-editor .buttons span{height:34px;display:inline-block;width:34px;text-align:center;font-size:14px;cursor:pointer;padding:1px 0}.r6o-relation-editor .buttons .delete{background-color:#fff;color:#9ca4b1;border-left:1px solid #e5e5e5}.r6o-relation-editor .buttons .delete:hover{background-color:#f6f6f6}.r6o-relation-editor .buttons .ok{background-color:#4483c4;color:#fff;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-radius-topright:3px;-khtml-border-radius-bottomright:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.r6o-relation-editor .buttons .ok:hover{background-color:#4f92d7}.r6o-btn{background-color:#4483c4;border:1px solid #4483c4;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;margin:0;outline:none;text-decoration:none;white-space:nowrap;padding:6px 18px;min-width:70px;vertical-align:middle;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.r6o-btn *{vertical-align:middle;cursor:pointer}.r6o-btn .r6o-icon{margin-right:4px}.r6o-btn:disabled{border-color:#a3c2e2!important;background-color:#a3c2e2!important}.r6o-btn:hover{background-color:#4f92d7;border-color:#4f92d7}.r6o-btn.outline{border:1px solid #4483c4;color:#4483c4;background-color:transparent;text-shadow:none}.r6o-autocomplete{display:inline;position:relative}.r6o-autocomplete div[role=combobox]{display:inline}.r6o-autocomplete input{outline:none;border:none;width:80px;height:100%;line-height:14px;white-space:pre;box-sizing:border-box;background-color:transparent;font-size:14px;color:#3f3f3f}.r6o-autocomplete ul{position:absolute;margin:0;padding:0;list-style-type:none;background-color:#fff;border-radius:3px;border:1px solid #d6d7d9;box-sizing:border-box;box-shadow:0 0 20px #00000040}.r6o-autocomplete ul:empty{display:none}.r6o-autocomplete li{box-sizing:border-box;padding:2px 12px;width:100%;cursor:pointer}.r6o-editable-text{max-height:120px;overflow:auto;outline:none;min-height:2em;font-size:14px;font-family:inherit}.r6o-editable-text:empty:not(:focus):before{content:attr(data-placeholder);color:#c2c2c2}.r6o-widget.comment{font-size:14px;min-height:3em;background-color:#fff;position:relative}.r6o-widget.comment .r6o-editable-text,.r6o-widget.comment .r6o-readonly-comment{padding:10px;width:100%;box-sizing:border-box;outline:none;border:none;background-color:transparent;resize:none}.r6o-widget.comment .r6o-readonly-comment{white-space:pre}.r6o-widget.comment .r6o-editable-text::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text::-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-ms-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-lastmodified{border:1px solid #e5e5e5;display:inline-block;border-radius:2px;margin:0 10px 8px;padding:4px 5px;line-height:100%;font-size:12px}.r6o-widget.comment .r6o-lastmodified .r6o-lastmodified-at{color:#757575;padding-left:3px}.r6o-widget.comment .r6o-arrow-down{position:absolute;height:20px;width:20px;top:9px;right:9px;line-height:22px;background-color:#fff;text-align:center;-webkit-font-smoothing:antialiased;border:1px solid #e5e5e5;cursor:pointer;-webkit-border-radius:1px;-khtml-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.r6o-widget.comment .r6o-arrow-down.r6o-menu-open{border-color:#4483c4}.r6o-widget.comment .r6o-comment-dropdown-menu{position:absolute;top:32px;right:8px;background-color:#fff;border:1px solid #e5e5e5;list-style-type:none;margin:0;padding:5px 0;z-index:9999;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px #0003}.r6o-widget.comment .r6o-comment-dropdown-menu li{padding:0 15px;cursor:pointer}.r6o-widget.comment .r6o-comment-dropdown-menu li:hover{background-color:#ecf0f1}.r6o-widget.comment .r6o-purposedropdown{position:relative;z-index:2}.r6o-widget.comment.editable{background-color:#ecf0f1}.r6o-widget.r6o-tag:empty{display:none}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.r6o-widget.tag .r6o-taglist li{height:27px}.r6o-widget.tag .r6o-taglist li .r6o-delete-wrapper .r6o-delete{position:relative;top:-4px}}.r6o-widget.r6o-tag{background-color:#ecf0f1;border-bottom:1px solid #e5e5e5;padding:1px 3px;display:flex}.r6o-widget.r6o-tag ul{margin:0;padding:0;list-style-type:none;z-index:1}.r6o-widget.r6o-tag ul.r6o-taglist{flex:0;white-space:nowrap}.r6o-widget.r6o-tag ul.r6o-taglist li{display:inline-block;margin:1px 1px 1px 0;padding:0;vertical-align:middle;overflow:hidden;font-size:12px;background-color:#fff;border:1px solid #d6d7d9;cursor:pointer;position:relative;line-height:180%;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 4px rgba(0,0,0,.1);-moz-box-shadow:0 0 4px rgba(0,0,0,.1);box-shadow:0 0 4px #0000001a}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-label{padding:2px 8px;display:inline-block}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper{display:inline-block;padding:2px 0;color:#fff;width:0;height:100%;background-color:#4483c4;-webkit-border-top-right-radius:2px;-webkit-border-bottom-right-radius:2px;-khtml-border-radius-topright:2px;-khtml-border-radius-bottomright:2px;-moz-border-radius-topright:2px;-moz-border-radius-bottomright:2px;border-top-right-radius:2px;border-bottom-right-radius:2px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper .r6o-delete{padding:2px 6px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper svg{vertical-align:text-top}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-active{width:24px;transition:width .2s}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-done,.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit-active{width:0;transition:width .2s}.r6o-widget.r6o-tag .r6o-autocomplete{flex:1;position:relative}.r6o-widget.r6o-tag .r6o-autocomplete li{font-size:14px}.r6o-widget.r6o-tag input{width:100%;padding:0 3px;min-width:80px;outline:none;border:none;line-height:170%;background-color:transparent;color:#3f3f3f}.r6o-widget.r6o-tag input::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input::-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-ms-input-placeholder{color:#c2c2c2}.r6o-editor{position:absolute;z-index:99999;width:400px;color:#3f3f3f;opacity:0;font-family:inherit;font-size:17px;line-height:27px;-webkit-transition:opacity .2s ease-in;-moz-transition:opacity .2s ease-in;transition:opacity .2s ease-in}.r6o-editor .r6o-arrow{position:absolute;overflow:hidden;top:-12px;left:12px;width:28px;height:12px;display:none}.r6o-editor .r6o-arrow:after{content:"";position:absolute;top:5px;left:5px;width:18px;height:18px;background-color:#fff;-webkit-backface-visibility:hidden;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.r6o-editor .r6o-editor-inner{background-color:#fff;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:2px 2px 42px rgba(0,0,0,.4);-moz-box-shadow:2px 2px 42px rgba(0,0,0,.4);box-shadow:2px 2px 42px #0006}.r6o-editor .r6o-editor-inner .r6o-widget:first-child{-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-khtml-border-radius-topleft:2px;-khtml-border-radius-topright:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}.r6o-editor .r6o-editor-inner .r6o-widget{border-bottom:1px solid #e5e5e5}.r6o-editor .r6o-footer{position:relative;text-align:right;padding:8px 0}.r6o-editor .r6o-footer .r6o-btn{margin-right:8px}.r6o-editor .r6o-footer .r6o-btn.delete-annotation{position:absolute;top:7px;left:7px;background-color:transparent;border:none;color:#4483c4;width:32px;height:32px;min-width:0;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center;-webkit-transition:all .1s ease-in;-moz-transition:all .1s ease-in;-o-transition:all .1s ease-in;transition:all .1s ease-in}.r6o-editor .r6o-footer .r6o-btn.delete-annotation:hover{color:#fff;background-color:#ef352c}@media (max-width: 640px){.r6o-editor{width:260px}}.r6o-editor.r6o-arrow-top .r6o-arrow{display:block}.r6o-editor.r6o-arrow-right{margin-left:8px}.r6o-editor.r6o-arrow-right .r6o-arrow{left:auto;right:12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow{display:block;top:auto;bottom:-12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow:after{top:-11px;box-shadow:none}.r6o-editor.pushed .r6o-arrow,.r6o-editor.dragged .r6o-arrow{display:none}.r6o-editor .r6o-draggable{cursor:move}.r6o-purposedropdown{width:150px;display:inline-block}.r6o-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
|
29
29
|
|
|
30
30
|
/* === STYLE_SEPARATOR === */
|
|
31
31
|
|
|
@@ -185,7 +185,7 @@ function V(t,n,r=!1){if(r||console.log("[Lib:FormUtils] \u25B6 attachNestedForms
|
|
|
185
185
|
</div>
|
|
186
186
|
${(J=e.themeData)!=null&&J.isCard?"</div>":""}
|
|
187
187
|
<div id="sticky-footer" class="${e.showFooter===!1?"footer-hidden":""}">
|
|
188
|
-
<div class="build-version">SDK v2.0.
|
|
188
|
+
<div class="build-version">SDK v2.0.24</div>
|
|
189
189
|
|
|
190
190
|
<button class="footer-btn footer-btn-secondary" id="prevBtn" style="display:none" onclick="FormOnPrevious()">
|
|
191
191
|
<i class="bi bi-chevron-left"></i> Previous
|
|
@@ -248,4 +248,4 @@ function V(t,n,r=!1){if(r||console.log("[Lib:FormUtils] \u25B6 attachNestedForms
|
|
|
248
248
|
|
|
249
249
|
// === SCRIPT_SEPARATOR ===
|
|
250
250
|
|
|
251
|
-
`);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,console.log("[SDK:10] \u{1F527} Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let d=c=>{if(v){let w=v.querySelector(".sdk-loader-text");w&&(w.textContent=c)}};if(d("Loading Core Components..."),m[0]&&m[0].trim()){let c=document.createElement("script");c.textContent=m[0],c.setAttribute("data-unvired-script","jquery"),document.head.appendChild(c)}if(m[4]&&m[4].trim()){let c=document.createElement("script");c.textContent=m[4],c.setAttribute("data-unvired-script","choices"),document.head.appendChild(c)}if(d("Loading Formio Library..."),m[5]&&m[5].trim()){let c=document.createElement("script");c.textContent=m[5],c.setAttribute("data-unvired-script","formio"),document.head.appendChild(c),console.log("[SDK:10.2] \u2705 Bundled Formio library injected.")}if(e.showComments){d("Loading Annotation Tools...");for(let c=1;c<=2;c++)if(m[c]&&m[c].trim()){let w=document.createElement("script");w.textContent=m[c],w.setAttribute("data-unvired-script",`recogito-${c}`),document.head.appendChild(w),await new Promise(x=>setTimeout(x,0))}}else console.log("[SDK:10.3] \u26A1 Skipping Recogito (comments disabled, optimized load)");if(d("Initializing Engine..."),m[3]&&m[3].trim()){let c=document.createElement("script");c.textContent=m[3],c.setAttribute("data-unvired-script","less"),document.head.appendChild(c)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){console.warn("Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),d("Initializing Components...");for(let c=6;c<m.length;c++){let w=m[c];if(w&&w.trim()){let x=document.createElement("script");x.textContent=w,x.setAttribute("data-unvired-script",`script-${c}`),document.head.appendChild(x),c%5===0&&await new Promise(I=>setTimeout(I,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,console.log("[SDK:10.6] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(c){let w=document.getElementById("unvired-more-btn"),x=document.getElementById("moreTooltip");w&&x&&!w.contains(c.target)&&!x.contains(c.target)&&(x.style.display="none")})}else if(window.__unviredSdkScriptsLoading)window.__unviredSdkScriptsLoaded||(console.warn("\u26A0\uFE0F Scripts marked as loading but not yet loaded - waiting..."),window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1);else{if(console.log("[SDK:10] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let d="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw console.error("[SDK:10.7] \u274C",d),v&&v.classList.add("hidden"),a({type:"ERROR",errorMessage:d,data:{technicalError:new Error(d),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(d)}console.log("[SDK:10] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=y,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.vobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=i,window.sendEventCallback=a,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED"};let b=o.querySelector("#form-back-btn"),S=o.querySelector("#unvired-more-btn");b&&(e.showBackButton?b.style.setProperty("display","flex","important"):b.style.setProperty("display","none","important")),S&&!e.showMoreButton&&S.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let M={};if(((Q=e.environmentVariable)==null?void 0:Q.length)>0)for(let d of e.environmentVariable)for(let c in d)M[c]=d[c];Object.keys(M).length>0&&(window.env=M);let E=o.querySelector("#sticky-header"),D=o.querySelector("#sticky-footer"),H=o.querySelector("#formio-wrapper"),W=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),H&&H.classList.add(`${e.mode}-mode`),E&&(E.style.display="none"),D&&(D.style.display="none")):(E&&(E.style.display="flex"),D&&(D.style.display="flex")),W&&(W.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let q=n;if(n&&(console.log("[SDK:13] \u{1F517} Processing file IDs in submission data (fetching from IndexedDB)..."),q=await ie(n,a,i),console.log("[SDK:13] \u2705 File IDs processed \u2014 handing off to form renderer")),v){let d=v.querySelector(".sdk-loader-text");d&&(d.textContent="Initializing Form...")}return typeof window.loadTRform!="function"?(console.log("[SDK:14] \u23F3 loadTRform not ready yet \u2014 waiting for web-turbo-formio.js to signal..."),await new Promise(d=>{let c=()=>{document.removeEventListener("LoadRNformReady",c),console.log("[SDK:14] \u2705 loadTRform is now ready (LoadRNformReady event received)"),d()};document.addEventListener("LoadRNformReady",c),typeof window.loadTRform=="function"&&c()})):console.log("[SDK:14] \u2705 loadTRform already available \u2014 invoking immediately"),console.log("[SDK:14] \u{1F680} Handing off to loadTRform (web-turbo-formio.js)..."),await window.loadTRform(y,q,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,i),he(),{sendAction:d=>{var c;d.type==="SET_IMAGE_DATA"&&((c=window.setImageData)==null||c.call(window,d.imageData,d.controlId,d.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),r=await U();t.style.display=r?"block":"none",n&&(n.style.display=r?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await le(t),console.log("[AppDocument] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await ce(t),console.log("[AppDocument] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to delete document",n),!1}};window.getAllDocuments=se;window.hasDocuments=U;function
|
|
251
|
+
`);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,console.log("[SDK:10] \u{1F527} Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let d=c=>{if(v){let w=v.querySelector(".sdk-loader-text");w&&(w.textContent=c)}};if(d("Loading Core Components..."),m[0]&&m[0].trim()){let c=document.createElement("script");c.textContent=m[0],c.setAttribute("data-unvired-script","jquery"),document.head.appendChild(c)}if(m[4]&&m[4].trim()){let c=document.createElement("script");c.textContent=m[4],c.setAttribute("data-unvired-script","choices"),document.head.appendChild(c)}if(d("Loading Formio Library..."),m[5]&&m[5].trim()){let c=document.createElement("script");c.textContent=m[5],c.setAttribute("data-unvired-script","formio"),document.head.appendChild(c),console.log("[SDK:10.2] \u2705 Bundled Formio library injected.")}if(e.showComments){d("Loading Annotation Tools...");for(let c=1;c<=2;c++)if(m[c]&&m[c].trim()){let w=document.createElement("script");w.textContent=m[c],w.setAttribute("data-unvired-script",`recogito-${c}`),document.head.appendChild(w),await new Promise(x=>setTimeout(x,0))}}else console.log("[SDK:10.3] \u26A1 Skipping Recogito (comments disabled, optimized load)");if(d("Initializing Engine..."),m[3]&&m[3].trim()){let c=document.createElement("script");c.textContent=m[3],c.setAttribute("data-unvired-script","less"),document.head.appendChild(c)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){console.warn("Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),d("Initializing Components...");for(let c=6;c<m.length;c++){let w=m[c];if(w&&w.trim()){let x=document.createElement("script");x.textContent=w,x.setAttribute("data-unvired-script",`script-${c}`),document.head.appendChild(x),c%5===0&&await new Promise(I=>setTimeout(I,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,console.log("[SDK:10.6] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(c){let w=document.getElementById("unvired-more-btn"),x=document.getElementById("moreTooltip");w&&x&&!w.contains(c.target)&&!x.contains(c.target)&&(x.style.display="none")})}else if(window.__unviredSdkScriptsLoading)window.__unviredSdkScriptsLoaded||(console.warn("\u26A0\uFE0F Scripts marked as loading but not yet loaded - waiting..."),window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1);else{if(console.log("[SDK:10] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let d="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw console.error("[SDK:10.7] \u274C",d),v&&v.classList.add("hidden"),a({type:"ERROR",errorMessage:d,data:{technicalError:new Error(d),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(d)}console.log("[SDK:10] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=y,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.vobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=i,window.sendEventCallback=a,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED"};let b=o.querySelector("#form-back-btn"),S=o.querySelector("#unvired-more-btn");b&&(e.showBackButton?b.style.setProperty("display","flex","important"):b.style.setProperty("display","none","important")),S&&!e.showMoreButton&&S.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let M={};if(((Q=e.environmentVariable)==null?void 0:Q.length)>0)for(let d of e.environmentVariable)for(let c in d)M[c]=d[c];Object.keys(M).length>0&&(window.env=M);let E=o.querySelector("#sticky-header"),D=o.querySelector("#sticky-footer"),H=o.querySelector("#formio-wrapper"),W=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),H&&H.classList.add(`${e.mode}-mode`),E&&(E.style.display="none"),D&&(D.style.display="none")):(E&&(E.style.display="flex"),D&&(D.style.display="flex")),W&&(W.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let q=n;if(n&&(console.log("[SDK:13] \u{1F517} Processing file IDs in submission data (fetching from IndexedDB)..."),q=await ie(n,a,i),console.log("[SDK:13] \u2705 File IDs processed \u2014 handing off to form renderer")),v){let d=v.querySelector(".sdk-loader-text");d&&(d.textContent="Initializing Form...")}return typeof window.loadTRform!="function"?(console.log("[SDK:14] \u23F3 loadTRform not ready yet \u2014 waiting for web-turbo-formio.js to signal..."),await new Promise(d=>{let c=()=>{document.removeEventListener("LoadRNformReady",c),console.log("[SDK:14] \u2705 loadTRform is now ready (LoadRNformReady event received)"),d()};document.addEventListener("LoadRNformReady",c),typeof window.loadTRform=="function"&&c()})):console.log("[SDK:14] \u2705 loadTRform already available \u2014 invoking immediately"),console.log("[SDK:14] \u{1F680} Handing off to loadTRform (web-turbo-formio.js)..."),await window.loadTRform(y,q,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,i),he(),{sendAction:d=>{var c;d.type==="SET_IMAGE_DATA"&&((c=window.setImageData)==null||c.call(window,d.imageData,d.controlId,d.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),r=await U();t.style.display=r?"block":"none",n&&(n.style.display=r?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await le(t),console.log("[AppDocument] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await ce(t),console.log("[AppDocument] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to delete document",n),!1}};window.getAllDocuments=se;window.hasDocuments=U;function Ae(){return"2.0.24"}function me(t){let n=typeof t=="string"?document.getElementById(t):t;n||(n=document.querySelector(".tf-formio-sdk")||document.body);let r=n.querySelectorAll("table"),o=0,e=null;return r.forEach(i=>{let s=i.getBoundingClientRect().width;s>o&&(o=s,e=i)}),{maxWidth:o,widestTable:e}}window.getMaxTableWidth=me;typeof window!="undefined"&&(window.TurboForms=window.TurboForms||{loadForms:ke,getBuildVersion:Ae,getMaxTableWidth:me});export{Ae as getBuildVersion,me as getMaxTableWidth,ke as loadForms};
|
package/dist/turboforms.html
CHANGED
|
@@ -42662,7 +42662,7 @@ window.CommentOnBack = CommentOnBack;
|
|
|
42662
42662
|
|
|
42663
42663
|
|
|
42664
42664
|
<div id="sticky-footer">
|
|
42665
|
-
<div class="build-version">SDK v2.0.
|
|
42665
|
+
<div class="build-version">SDK v2.0.24</div>
|
|
42666
42666
|
<div class="relative-position">
|
|
42667
42667
|
<button id="unvired-more-btn" class="ui button primary dataGrid-addRow" onclick="toggleTooltip()">
|
|
42668
42668
|
<i class="icon options"></i>
|
package/dist/turboforms.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var TurboForms=(()=>{var V=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var we=Object.prototype.hasOwnProperty;var xe=(t,n)=>{for(var r in n)V(t,r,{get:n[r],enumerable:!0})},Ce=(t,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of ye(n))!we.call(t,e)&&e!==r&&V(t,e,{get:()=>n[e],enumerable:!(o=ve(n,e))||o.enumerable});return t};var Ee=t=>Ce(V({},"__esModule",{value:!0}),t);var Re={};xe(Re,{getBuildVersion:()=>ge,getMaxTableWidth:()=>W,loadUnviredForms:()=>De});function U(t,n,r=!1){if(r||console.log("[Lib:FormUtils] \u25B6 attachNestedFormsToMainForm() called"),!t||typeof t!="object")return t;for(let o in t)if(typeof t[o]=="object")U(t[o],n,!0);else if(o==="nestedFormComponenttype"&&t.nestedFormComponenttype==="smartNestedForm"){let e=t.selNestedFormVersion,i=t.selectedNestedFormId;if(e&&i){let s=n.filter(a=>a.formId==i&&a.version==e);if(s.length>0){let a=s[0].formDesign||s[0].formData;if(typeof a=="string")try{a=JSON.parse(a)}catch(f){console.warn("[Lib:FormUtils] Failed to parse nested form design",f)}t.formDesign=a,t.formdesign=a,a&&typeof a=="object"&&a.components&&(t.components=a.components,t.display=a.display||"form")}}}return t}function R(t,n,r="dataSrc",o="masterdata",e=!1){if(e||console.log("[Lib:FormUtils] \u25B6 attachMasterDataToForm() called"),!t||typeof t!="object")return t;if(Array.isArray(t))return t.forEach(i=>R(i,n,r,o,!0)),t;for(let i in t)if(t.hasOwnProperty(i)){if(typeof t[i]=="object")R(t[i],n,r,o,!0);else if(i===r&&t[i]===o)if(console.log("[FormUtils] Found masterdata component:",t.key,"selMasterdataId:",t.selMasterdataId),Array.isArray(n)){let s=[];if(t.selMasterdataId){let a=n.find(f=>f.masterdataId===t.selMasterdataId);s=a?a.submissionData||[]:[]}else s=n.flatMap(a=>a.submissionData||[]);t.masterdata=s,console.log("[FormUtils] Attached masterdata length:",s.length)}else n&&Array.isArray(n.submissionData)?t.masterdata=n.submissionData:t.masterdata=[]}return t}function A(t,n){if(Array.isArray(t))for(let r of t)n(r),Array.isArray(r.components)&&A(r.components,n),Array.isArray(r.columns)&&r.columns.forEach(o=>A(o.components,n)),Array.isArray(r.rows)&&r.rows.forEach(o=>{Array.isArray(o)&&o.forEach(e=>{e&&e.components&&A(e.components,n)})}),Array.isArray(r.fieldSet)&&A(r.fieldSet,n)}function oe(t,n){console.log("[Lib:FormValidation] \u25B6 validateNestedForms() called");let r=null,o=!1;return A(t==null?void 0:t.components,e=>{if(e.selectedNestedFormId&&e.selNestedFormVersion&&e.nestedFormComponenttype==="smartNestedForm"){if(o=!0,!Array.isArray(n)||n.length===0){r="Nested Form Data must be a non-empty array when a component with selectedNestedFormId, selNestedFormVersion, and nestedFormComponenttype='smartNestedForm' is present in the form.";return}if(!n.find(s=>s.formId==e.selectedNestedFormId&&s.version==e.selNestedFormVersion)){let s=n.find(a=>a.formId==e.selectedNestedFormId);s?r=`Version is wrong for selectedNestedFormId: ${e.selectedNestedFormId}. Expected version: ${s.version}, got: ${e.selNestedFormVersion}`:r=`ID is wrong. No nested form found for selectedNestedFormId: ${e.selectedNestedFormId}`}}}),Array.isArray(n)&&n.length>0&&!o&&(r="Nested Form Data is provided but no component with selectedNestedFormId, selNestedFormVersion, and nestedFormComponenttype='smartNestedForm' exists in the form."),r}function re(t,n){console.log("[Lib:FormValidation] \u25B6 validateMasterdata() called");let r=null,o=!1;return A(t.components,e=>{e.dataSrc==="masterdata"&&(o=!0)}),o&&(!Array.isArray(n)||n.length===0)?(r="Master Data must be a non-empty array when a component with dataSrc='masterdata' is present in the form.",r):(Array.isArray(n)&&n.length>0&&!o&&(r="Master Data is provided but no component with dataSrc='masterdata' exists in the form."),r)}function ie({type:t,message:n="",errorMessage:r="",data:o={}}){let e;return t==="ERROR"?e={type:"ERROR",errorMessage:r+", contact your admin or tech team",data:o}:e={type:t,message:n,data:o},e}function N(t,n,r){if(Array.isArray(t))t.forEach(o=>N(o,n,r));else if(t&&typeof t=="object")for(let o in t){if(typeof t[o]=="string"){let e=!1;if(/^@\s*title\s*@\s*$/.test(t[o])||/^\[\s*title\s*\]$/.test(t[o])?r&&r.title&&(t[o]=r.title,e=!0):(/^@\s*description\s*@\s*$/.test(t[o])||/^\[\s*description\s*\]$/.test(t[o]))&&r&&r.description&&(t[o]=r.description,e=!0),!e)for(let i in n){let s=new RegExp(`^@\\s*${i}\\s*@\\s*$`),a=new RegExp(`^\\[\\s*${i}\\s*\\]$`);if(s.test(t[o])||a.test(t[o])){t[o]=n[i],e=!0;break}}if(!e){let i=/^@\s*([^@\s]+)\s*@\s*$/,s=/^\[\s*([^\]\s]+)\s*\]$/;(i.test(t[o])||s.test(t[o]))&&(t[o]="")}}N(t[o],n,r)}}async function ae(t,n,r){if(console.log("[Lib:AttachmentValidation] \u25B6 validateAttachments() called"),!n||typeof n!="object")return{missingFiles:[],fileKeys:[]};let o=[];function e(u,p=[]){if(!Array.isArray(u))return p;for(let l of u)l.type==="file"&&l.key&&p.push(l.key),Array.isArray(l.components)?e(l.components,p):Array.isArray(l.columns)?l.columns.forEach(h=>e(h.components,p)):Array.isArray(l.rows)?l.rows.forEach(h=>h.forEach(g=>e(g.components,p))):l.tabs&&Array.isArray(l.tabs)&&l.tabs.forEach(h=>e(h.components,p));return p}let i=e((t==null?void 0:t.components)||[]),s=new Set(i),a=new WeakSet;async function f(u){if(!(!u||typeof u!="object"||a.has(u))){a.add(u);for(let p of Object.keys(u)){let l=u[p];s.has(p)&&Array.isArray(l)&&await Promise.all(l.map(async h=>{if(typeof h=="string"&&h.trim())try{let g=await Se(h);(!g||!g.id||!g.data&&!g.url)&&o.push({fileId:h,field:p,reason:g?"Incomplete file record (missing id/data/url)":"File not found in IndexedDB"})}catch(g){o.push({fileId:h,field:p,reason:"IndexedDB not initialized"})}})),typeof l=="object"&&l!==null&&await f(l)}}}return await f(n),o.length>0&&(r==null||r({type:"GET_ATTACHMENT",message:"Requesting missing attachments from middleware",data:{missingFiles:o}})),{missingFiles:o,fileKeys:i}}var T=null;function Se(t){return console.log("[Lib:AttachmentValidation] \u{1F50D} getFileFromIndexedDB() called",{fileId:t}),"indexedDB"in window?(T||(T=new Promise((n,r)=>{let o=indexedDB.open("Forms-Attachments",3);o.onupgradeneeded=e=>{let i=e.target.result;i.objectStoreNames.contains("Files")||i.createObjectStore("Files")},o.onsuccess=e=>{let i=e.target.result;if(!i.objectStoreNames.contains("Files")){T=null,r(new Error("Missing Files store"));return}n(i)},o.onerror=()=>{T=null,r(new Error("Failed to open IndexedDB"))}})),T.then(n=>new Promise(r=>{let o=n.transaction("Files","readonly");o.onerror=()=>r(null);let i=o.objectStore("Files").get(t);i.onsuccess=()=>r(i.result||null),i.onerror=()=>r(null)}))):Promise.resolve(null)}async function se(t,n,r=[]){if(console.log("[Lib:FileProcessor] \u25B6 processFileIds() called"),!t||typeof t!="object")return t;let o=new Set(r),e=JSON.parse(JSON.stringify(t)),i=new WeakSet;async function s(a){if(!(!a||typeof a!="object"||i.has(a))){i.add(a);for(let f of Object.keys(a)){let u=a[f];if(o.has(f)&&Array.isArray(u)){let p=[];for(let l=0;l<u.length;l++)if(typeof u[l]=="string"){let h=await ke(u[l]);h?p.push({name:h.name,originalName:h.name,size:h.size,storage:"SmartStorage",type:h.type,url:h.url,key:f,uid:u[l],mode:h.mode||"G"}):console.warn(`[Lib:FileProcessor] \u26A0\uFE0F File not found in IndexedDB: ${u[l]} - removing from submission data`)}else typeof u[l]=="object"&&u[l]!==null&&await s(u[l]),p.push(u[l]);a[f]=p}else typeof u=="object"&&u!==null&&await s(u)}}}return await s(e),e}var _=null;async function ke(t){if(console.log("[Lib:FileProcessor] \u{1F50D} getFileFromIndexedDB() called",{fileId:t}),!("indexedDB"in window))return null;_||(_=new Promise(r=>{let o=indexedDB.open("Forms-Attachments",3);o.onupgradeneeded=e=>{let i=e.target.result;i.objectStoreNames.contains("Files")||i.createObjectStore("Files")},o.onsuccess=e=>{let i=e.target.result;if(!i.objectStoreNames.contains("Files")){console.warn("[Lib:FileProcessor] \u26A0\uFE0F Files store not found"),_=null,r(null);return}r(i)},o.onerror=()=>{_=null,r(null)}}));let n=await _;return n?new Promise(r=>{let o=n.transaction(["Files"],"readonly");o.onerror=()=>r(null);let i=o.objectStore("Files").get(t);i.onsuccess=()=>r(i.result||null),i.onerror=()=>r(null)}):null}function le(t,n){if(console.log("[Lib:DynamicValueProcessor] \u25B6 processDynamicValues() called"),!t||!t.components)return null;let r={},o=n&&(Array.isArray(n)&&n.length>0||!Array.isArray(n)&&Object.keys(n).length>0);o&&(Array.isArray(n)?n.forEach(i=>{i.key&&(r[i.key]=i.value)}):r=n||{});function e(i){if(!i||!Array.isArray(i))return null;for(let s of i){if(typeof s.defaultValue=="string"&&s.defaultValue.trim().startsWith("{{")&&s.defaultValue.trim().endsWith("}}")){let f=s.defaultValue.trim();o&&r[f]!==void 0&&(s.defaultValue=r[f])}let a;if(s.components&&(a=e(s.components),a))return a;if(s.columns&&Array.isArray(s.columns)){for(let f of s.columns)if(a=e(f.components),a)return a}if(s.rows&&Array.isArray(s.rows)){for(let f of s.rows)if(Array.isArray(f)){for(let u of f)if(a=e(u.components),a)return a}}}return null}return e(t.components)}var F="AppDocuments",C="documents",O="documnets";function L(t){return t?new Promise((n,r)=>{let o=indexedDB.open(F,t);o.onupgradeneeded=e=>{let i=e.target.result;!i.objectStoreNames.contains(C)&&!i.objectStoreNames.contains(O)&&i.createObjectStore(C,{keyPath:"id",autoIncrement:!0})},o.onsuccess=e=>n(e.target.result),o.onerror=e=>{console.error("[Lib:AppDocuments] \u274C DB error:",e.target.error),r(e.target.error)}}):typeof window!="undefined"&&window.indexedDBUtils&&window.indexedDBUtils.openDynamicDB?window.indexedDBUtils.openDynamicDB(F,C,O):new Promise((n,r)=>{let o=indexedDB.open(F);o.onupgradeneeded=e=>{let i=e.target.result;!i.objectStoreNames.contains(C)&&!i.objectStoreNames.contains(O)&&i.createObjectStore(C,{keyPath:"id",autoIncrement:!0})},o.onsuccess=e=>{let i=e.target.result;if(i.objectStoreNames.contains(C)||i.objectStoreNames.contains(O)){n(i);return}let a=i.version+1;i.close();let f=indexedDB.open(F,a);f.onupgradeneeded=u=>{let p=u.target.result;p.objectStoreNames.contains(C)||p.createObjectStore(C,{keyPath:"id",autoIncrement:!0})},f.onsuccess=u=>n(u.target.result),f.onerror=u=>{console.error("[Lib:AppDocuments] \u274C DB Upgrade failed:",u),r(u)}},o.onerror=e=>{console.error("[Lib:AppDocuments] \u274C DB Open failed:",e),r(e.target.error)}})}function j(t){return t.objectStoreNames.contains(C)?C:t.objectStoreNames.contains(O)?O:null}async function z(){try{let t=await L(),n=j(t);return n?new Promise(r=>{let i=t.transaction([n],"readonly").objectStore(n).count();i.onsuccess=()=>{t.close(),r(i.result>0)},i.onerror=s=>{console.error("[Lib:AppDocuments] \u274C Error counting:",s),t.close(),r(!1)}}):(console.warn(`[Lib:AppDocuments] \u26A0\uFE0F Store missing \u2014 no '${C}' or '${O}' found`),t.close(),!1)}catch(t){return console.error("[Lib:AppDocuments] \u274C Error checking documents:",t),!1}}async function ce(){try{let t=await L(),n=j(t);return n?new Promise(r=>{let i=t.transaction([n],"readonly").objectStore(n).getAll();i.onsuccess=()=>{t.close(),r(i.result)},i.onerror=()=>{t.close(),r([])}}):(t.close(),[])}catch(t){return console.error("[Lib:AppDocuments] \u274C Error getting documents:",t),[]}}async function ue(t){try{let n=await L(),r=j(n);if(!r)throw n.close(),new Error("Failed to open database with valid store.");return new Promise((o,e)=>{let a=n.transaction([r],"readwrite").objectStore(r).add(t);a.onsuccess=()=>{n.close(),o(a.result)},a.onerror=f=>{n.close(),e(f.target.error)}})}catch(n){throw console.error("[Lib:AppDocuments] \u274C Error inserting document:",n),n}}async function de(t){try{let n=await L(),r=j(n);if(!r){n.close(),console.error("No valid document store found for deletion");return}return new Promise((o,e)=>{let a=n.transaction([r],"readwrite").objectStore(r).delete(t);a.onsuccess=()=>{n.close(),o()},a.onerror=f=>{n.close(),e(f.target.error)}})}catch(n){throw console.error("[Lib:AppDocuments] \u274C Error deleting document:",n),n}}var Ae="AppDocuments",fe="documents",pe="documnets";function Oe(){return new Promise((t,n)=>{let r=indexedDB.open(Ae);r.onsuccess=o=>t(o.target.result),r.onerror=o=>n(o.target.error)})}function Pe(t){return t.objectStoreNames.contains(fe)?fe:t.objectStoreNames.contains(pe)?pe:null}async function he(){try{let t=await Oe(),n=Pe(t);return n?new Promise(r=>{let i=t.transaction([n],"readonly").objectStore(n).getAll();i.onsuccess=()=>{t.close(),r(i.result)},i.onerror=()=>{t.close(),r([])}}):(t.close(),[])}catch(t){return console.warn("Error reading AppDocuments DB:",t),[]}}async function Ie(){if(typeof window.showDynamicModal!="function"){console.error("showDynamicModal is not defined.");return}window.showDynamicModal("App Documents",[],`
|
|
1
|
+
var TurboForms=(()=>{var V=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var xe=Object.prototype.hasOwnProperty;var Ce=(t,n)=>{for(var r in n)V(t,r,{get:n[r],enumerable:!0})},Ee=(t,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of we(n))!xe.call(t,e)&&e!==r&&V(t,e,{get:()=>n[e],enumerable:!(o=ye(n,e))||o.enumerable});return t};var Se=t=>Ee(V({},"__esModule",{value:!0}),t);var Re={};Ce(Re,{getBuildVersion:()=>ve,getMaxTableWidth:()=>W,loadForms:()=>ge});function U(t,n,r=!1){if(r||console.log("[Lib:FormUtils] \u25B6 attachNestedFormsToMainForm() called"),!t||typeof t!="object")return t;for(let o in t)if(typeof t[o]=="object")U(t[o],n,!0);else if(o==="nestedFormComponenttype"&&t.nestedFormComponenttype==="smartNestedForm"){let e=t.selNestedFormVersion,i=t.selectedNestedFormId;if(e&&i){let s=n.filter(a=>a.formId==i&&a.version==e);if(s.length>0){let a=s[0].formDesign||s[0].formData;if(typeof a=="string")try{a=JSON.parse(a)}catch(f){console.warn("[Lib:FormUtils] Failed to parse nested form design",f)}t.formDesign=a,t.formdesign=a,a&&typeof a=="object"&&a.components&&(t.components=a.components,t.display=a.display||"form")}}}return t}function R(t,n,r="dataSrc",o="masterdata",e=!1){if(e||console.log("[Lib:FormUtils] \u25B6 attachMasterDataToForm() called"),!t||typeof t!="object")return t;if(Array.isArray(t))return t.forEach(i=>R(i,n,r,o,!0)),t;for(let i in t)if(t.hasOwnProperty(i)){if(typeof t[i]=="object")R(t[i],n,r,o,!0);else if(i===r&&t[i]===o)if(console.log("[FormUtils] Found masterdata component:",t.key,"selMasterdataId:",t.selMasterdataId),Array.isArray(n)){let s=[];if(t.selMasterdataId){let a=n.find(f=>f.masterdataId===t.selMasterdataId);s=a?a.submissionData||[]:[]}else s=n.flatMap(a=>a.submissionData||[]);t.masterdata=s,console.log("[FormUtils] Attached masterdata length:",s.length)}else n&&Array.isArray(n.submissionData)?t.masterdata=n.submissionData:t.masterdata=[]}return t}function A(t,n){if(Array.isArray(t))for(let r of t)n(r),Array.isArray(r.components)&&A(r.components,n),Array.isArray(r.columns)&&r.columns.forEach(o=>A(o.components,n)),Array.isArray(r.rows)&&r.rows.forEach(o=>{Array.isArray(o)&&o.forEach(e=>{e&&e.components&&A(e.components,n)})}),Array.isArray(r.fieldSet)&&A(r.fieldSet,n)}function oe(t,n){console.log("[Lib:FormValidation] \u25B6 validateNestedForms() called");let r=null,o=!1;return A(t==null?void 0:t.components,e=>{if(e.selectedNestedFormId&&e.selNestedFormVersion&&e.nestedFormComponenttype==="smartNestedForm"){if(o=!0,!Array.isArray(n)||n.length===0){r="Nested Form Data must be a non-empty array when a component with selectedNestedFormId, selNestedFormVersion, and nestedFormComponenttype='smartNestedForm' is present in the form.";return}if(!n.find(s=>s.formId==e.selectedNestedFormId&&s.version==e.selNestedFormVersion)){let s=n.find(a=>a.formId==e.selectedNestedFormId);s?r=`Version is wrong for selectedNestedFormId: ${e.selectedNestedFormId}. Expected version: ${s.version}, got: ${e.selNestedFormVersion}`:r=`ID is wrong. No nested form found for selectedNestedFormId: ${e.selectedNestedFormId}`}}}),Array.isArray(n)&&n.length>0&&!o&&(r="Nested Form Data is provided but no component with selectedNestedFormId, selNestedFormVersion, and nestedFormComponenttype='smartNestedForm' exists in the form."),r}function re(t,n){console.log("[Lib:FormValidation] \u25B6 validateMasterdata() called");let r=null,o=!1;return A(t.components,e=>{e.dataSrc==="masterdata"&&(o=!0)}),o&&(!Array.isArray(n)||n.length===0)?(r="Master Data must be a non-empty array when a component with dataSrc='masterdata' is present in the form.",r):(Array.isArray(n)&&n.length>0&&!o&&(r="Master Data is provided but no component with dataSrc='masterdata' exists in the form."),r)}function ie({type:t,message:n="",errorMessage:r="",data:o={}}){let e;return t==="ERROR"?e={type:"ERROR",errorMessage:r+", contact your admin or tech team",data:o}:e={type:t,message:n,data:o},e}function N(t,n,r){if(Array.isArray(t))t.forEach(o=>N(o,n,r));else if(t&&typeof t=="object")for(let o in t){if(typeof t[o]=="string"){let e=!1;if(/^@\s*title\s*@\s*$/.test(t[o])||/^\[\s*title\s*\]$/.test(t[o])?r&&r.title&&(t[o]=r.title,e=!0):(/^@\s*description\s*@\s*$/.test(t[o])||/^\[\s*description\s*\]$/.test(t[o]))&&r&&r.description&&(t[o]=r.description,e=!0),!e)for(let i in n){let s=new RegExp(`^@\\s*${i}\\s*@\\s*$`),a=new RegExp(`^\\[\\s*${i}\\s*\\]$`);if(s.test(t[o])||a.test(t[o])){t[o]=n[i],e=!0;break}}if(!e){let i=/^@\s*([^@\s]+)\s*@\s*$/,s=/^\[\s*([^\]\s]+)\s*\]$/;(i.test(t[o])||s.test(t[o]))&&(t[o]="")}}N(t[o],n,r)}}async function ae(t,n,r){if(console.log("[Lib:AttachmentValidation] \u25B6 validateAttachments() called"),!n||typeof n!="object")return{missingFiles:[],fileKeys:[]};let o=[];function e(u,p=[]){if(!Array.isArray(u))return p;for(let l of u)l.type==="file"&&l.key&&p.push(l.key),Array.isArray(l.components)?e(l.components,p):Array.isArray(l.columns)?l.columns.forEach(h=>e(h.components,p)):Array.isArray(l.rows)?l.rows.forEach(h=>h.forEach(g=>e(g.components,p))):l.tabs&&Array.isArray(l.tabs)&&l.tabs.forEach(h=>e(h.components,p));return p}let i=e((t==null?void 0:t.components)||[]),s=new Set(i),a=new WeakSet;async function f(u){if(!(!u||typeof u!="object"||a.has(u))){a.add(u);for(let p of Object.keys(u)){let l=u[p];s.has(p)&&Array.isArray(l)&&await Promise.all(l.map(async h=>{if(typeof h=="string"&&h.trim())try{let g=await ke(h);(!g||!g.id||!g.data&&!g.url)&&o.push({fileId:h,field:p,reason:g?"Incomplete file record (missing id/data/url)":"File not found in IndexedDB"})}catch(g){o.push({fileId:h,field:p,reason:"IndexedDB not initialized"})}})),typeof l=="object"&&l!==null&&await f(l)}}}return await f(n),o.length>0&&(r==null||r({type:"GET_ATTACHMENT",message:"Requesting missing attachments from middleware",data:{missingFiles:o}})),{missingFiles:o,fileKeys:i}}var T=null;function ke(t){return console.log("[Lib:AttachmentValidation] \u{1F50D} getFileFromIndexedDB() called",{fileId:t}),"indexedDB"in window?(T||(T=new Promise((n,r)=>{let o=indexedDB.open("Forms-Attachments",3);o.onupgradeneeded=e=>{let i=e.target.result;i.objectStoreNames.contains("Files")||i.createObjectStore("Files")},o.onsuccess=e=>{let i=e.target.result;if(!i.objectStoreNames.contains("Files")){T=null,r(new Error("Missing Files store"));return}n(i)},o.onerror=()=>{T=null,r(new Error("Failed to open IndexedDB"))}})),T.then(n=>new Promise(r=>{let o=n.transaction("Files","readonly");o.onerror=()=>r(null);let i=o.objectStore("Files").get(t);i.onsuccess=()=>r(i.result||null),i.onerror=()=>r(null)}))):Promise.resolve(null)}async function se(t,n,r=[]){if(console.log("[Lib:FileProcessor] \u25B6 processFileIds() called"),!t||typeof t!="object")return t;let o=new Set(r),e=JSON.parse(JSON.stringify(t)),i=new WeakSet;async function s(a){if(!(!a||typeof a!="object"||i.has(a))){i.add(a);for(let f of Object.keys(a)){let u=a[f];if(o.has(f)&&Array.isArray(u)){let p=[];for(let l=0;l<u.length;l++)if(typeof u[l]=="string"){let h=await Ae(u[l]);h?p.push({name:h.name,originalName:h.name,size:h.size,storage:"SmartStorage",type:h.type,url:h.url,key:f,uid:u[l],mode:h.mode||"G"}):console.warn(`[Lib:FileProcessor] \u26A0\uFE0F File not found in IndexedDB: ${u[l]} - removing from submission data`)}else typeof u[l]=="object"&&u[l]!==null&&await s(u[l]),p.push(u[l]);a[f]=p}else typeof u=="object"&&u!==null&&await s(u)}}}return await s(e),e}var _=null;async function Ae(t){if(console.log("[Lib:FileProcessor] \u{1F50D} getFileFromIndexedDB() called",{fileId:t}),!("indexedDB"in window))return null;_||(_=new Promise(r=>{let o=indexedDB.open("Forms-Attachments",3);o.onupgradeneeded=e=>{let i=e.target.result;i.objectStoreNames.contains("Files")||i.createObjectStore("Files")},o.onsuccess=e=>{let i=e.target.result;if(!i.objectStoreNames.contains("Files")){console.warn("[Lib:FileProcessor] \u26A0\uFE0F Files store not found"),_=null,r(null);return}r(i)},o.onerror=()=>{_=null,r(null)}}));let n=await _;return n?new Promise(r=>{let o=n.transaction(["Files"],"readonly");o.onerror=()=>r(null);let i=o.objectStore("Files").get(t);i.onsuccess=()=>r(i.result||null),i.onerror=()=>r(null)}):null}function le(t,n){if(console.log("[Lib:DynamicValueProcessor] \u25B6 processDynamicValues() called"),!t||!t.components)return null;let r={},o=n&&(Array.isArray(n)&&n.length>0||!Array.isArray(n)&&Object.keys(n).length>0);o&&(Array.isArray(n)?n.forEach(i=>{i.key&&(r[i.key]=i.value)}):r=n||{});function e(i){if(!i||!Array.isArray(i))return null;for(let s of i){if(typeof s.defaultValue=="string"&&s.defaultValue.trim().startsWith("{{")&&s.defaultValue.trim().endsWith("}}")){let f=s.defaultValue.trim();o&&r[f]!==void 0&&(s.defaultValue=r[f])}let a;if(s.components&&(a=e(s.components),a))return a;if(s.columns&&Array.isArray(s.columns)){for(let f of s.columns)if(a=e(f.components),a)return a}if(s.rows&&Array.isArray(s.rows)){for(let f of s.rows)if(Array.isArray(f)){for(let u of f)if(a=e(u.components),a)return a}}}return null}return e(t.components)}var F="AppDocuments",C="documents",O="documnets";function L(t){return t?new Promise((n,r)=>{let o=indexedDB.open(F,t);o.onupgradeneeded=e=>{let i=e.target.result;!i.objectStoreNames.contains(C)&&!i.objectStoreNames.contains(O)&&i.createObjectStore(C,{keyPath:"id",autoIncrement:!0})},o.onsuccess=e=>n(e.target.result),o.onerror=e=>{console.error("[Lib:AppDocuments] \u274C DB error:",e.target.error),r(e.target.error)}}):typeof window!="undefined"&&window.indexedDBUtils&&window.indexedDBUtils.openDynamicDB?window.indexedDBUtils.openDynamicDB(F,C,O):new Promise((n,r)=>{let o=indexedDB.open(F);o.onupgradeneeded=e=>{let i=e.target.result;!i.objectStoreNames.contains(C)&&!i.objectStoreNames.contains(O)&&i.createObjectStore(C,{keyPath:"id",autoIncrement:!0})},o.onsuccess=e=>{let i=e.target.result;if(i.objectStoreNames.contains(C)||i.objectStoreNames.contains(O)){n(i);return}let a=i.version+1;i.close();let f=indexedDB.open(F,a);f.onupgradeneeded=u=>{let p=u.target.result;p.objectStoreNames.contains(C)||p.createObjectStore(C,{keyPath:"id",autoIncrement:!0})},f.onsuccess=u=>n(u.target.result),f.onerror=u=>{console.error("[Lib:AppDocuments] \u274C DB Upgrade failed:",u),r(u)}},o.onerror=e=>{console.error("[Lib:AppDocuments] \u274C DB Open failed:",e),r(e.target.error)}})}function j(t){return t.objectStoreNames.contains(C)?C:t.objectStoreNames.contains(O)?O:null}async function z(){try{let t=await L(),n=j(t);return n?new Promise(r=>{let i=t.transaction([n],"readonly").objectStore(n).count();i.onsuccess=()=>{t.close(),r(i.result>0)},i.onerror=s=>{console.error("[Lib:AppDocuments] \u274C Error counting:",s),t.close(),r(!1)}}):(console.warn(`[Lib:AppDocuments] \u26A0\uFE0F Store missing \u2014 no '${C}' or '${O}' found`),t.close(),!1)}catch(t){return console.error("[Lib:AppDocuments] \u274C Error checking documents:",t),!1}}async function ce(){try{let t=await L(),n=j(t);return n?new Promise(r=>{let i=t.transaction([n],"readonly").objectStore(n).getAll();i.onsuccess=()=>{t.close(),r(i.result)},i.onerror=()=>{t.close(),r([])}}):(t.close(),[])}catch(t){return console.error("[Lib:AppDocuments] \u274C Error getting documents:",t),[]}}async function ue(t){try{let n=await L(),r=j(n);if(!r)throw n.close(),new Error("Failed to open database with valid store.");return new Promise((o,e)=>{let a=n.transaction([r],"readwrite").objectStore(r).add(t);a.onsuccess=()=>{n.close(),o(a.result)},a.onerror=f=>{n.close(),e(f.target.error)}})}catch(n){throw console.error("[Lib:AppDocuments] \u274C Error inserting document:",n),n}}async function de(t){try{let n=await L(),r=j(n);if(!r){n.close(),console.error("No valid document store found for deletion");return}return new Promise((o,e)=>{let a=n.transaction([r],"readwrite").objectStore(r).delete(t);a.onsuccess=()=>{n.close(),o()},a.onerror=f=>{n.close(),e(f.target.error)}})}catch(n){throw console.error("[Lib:AppDocuments] \u274C Error deleting document:",n),n}}var Oe="AppDocuments",fe="documents",pe="documnets";function Pe(){return new Promise((t,n)=>{let r=indexedDB.open(Oe);r.onsuccess=o=>t(o.target.result),r.onerror=o=>n(o.target.error)})}function Ie(t){return t.objectStoreNames.contains(fe)?fe:t.objectStoreNames.contains(pe)?pe:null}async function he(){try{let t=await Pe(),n=Ie(t);return n?new Promise(r=>{let i=t.transaction([n],"readonly").objectStore(n).getAll();i.onsuccess=()=>{t.close(),r(i.result)},i.onerror=()=>{t.close(),r([])}}):(t.close(),[])}catch(t){return console.warn("Error reading AppDocuments DB:",t),[]}}async function Te(){if(typeof window.showDynamicModal!="function"){console.error("showDynamicModal is not defined.");return}window.showDynamicModal("App Documents",[],`
|
|
2
2
|
<div style="text-align: center; padding: 40px;">
|
|
3
3
|
<div class="spinner-border text-primary" role="status">
|
|
4
4
|
<span class="visually-hidden">Loading...</span>
|
|
@@ -25,7 +25,7 @@ var TurboForms=(()=>{var V=Object.defineProperty;var ve=Object.getOwnPropertyDes
|
|
|
25
25
|
<div style="text-align:center;padding:50px;color:#999;">
|
|
26
26
|
<i class="folder open outline icon" style="font-size:40px;"></i>
|
|
27
27
|
<div>No documents available</div>
|
|
28
|
-
</div>`,window.showDynamicModal("App Documents",[{label:"Close",callback:()=>{},className:"btn btn-secondary footer-btn footer-btn-secondary"}],n),window.downloadDocument||(window.downloadDocument=async function(r){let e=(await he()).find(f=>f.id==r);if(!e){console.log("\u274C Document not found."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 017, Document not found",data:{reason:"Document not found",technicalError:null}});return}console.log("Downloading:",e);let i=e.url||e.data||e.file&&e.file.data,s=null;if(i&&i.startsWith("data:")){let f=i.indexOf(",");if(f===-1){console.log("\u274C Invalid file format."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 018, Invalid file format",data:{reason:"Invalid file format",technicalError:null}});return}let u=i.substring(0,f),p=i.substring(f+1),l=u.match(/:(.*?);/),h=l?l[1]:"application/octet-stream";if(p=p.replace(/\s/g,""),!/^[A-Za-z0-9+/=]+$/.test(p)){console.error("Invalid base64:",p.slice(0,50)),console.log("\u274C File is corrupted (invalid base64)."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 019, File is corrupted (invalid base64)",data:{reason:"File is corrupted (invalid base64)",technicalError:null}});return}try{let g=atob(p),y=new Uint8Array(g.length);for(let m=0;m<g.length;m++)y[m]=g.charCodeAt(m);let v=new Blob([y],{type:h});if(!v.size){console.log("\u274C File is empty."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 020, File is empty",data:{reason:"File is empty",technicalError:null}});return}s=URL.createObjectURL(v)}catch(g){console.error("Base64 decode failed:",g),g.name==="InvalidCharacterError"?(console.log("\u274C File is corrupted (invalid encoding)."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 021, File is corrupted (invalid encoding)",data:{reason:"File is corrupted (invalid encoding)",technicalError:g}})):(console.log("\u274C Failed to process file."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 022, Failed to process file",data:{reason:"Failed to process file",technicalError:g}}));return}}else if(e.file instanceof Blob){if(!e.file.size){console.log("\u274C File is empty."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 023, File is empty",data:{reason:"File is empty",technicalError:null}});return}s=URL.createObjectURL(e.file)}else{console.log("\u274C No downloadable content found."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 024, No downloadable content found",data:{reason:"No downloadable content found",technicalError:null}});return}let a=document.createElement("a");a.href=s,a.download=e.name||"document",document.body.appendChild(a),a.click(),setTimeout(()=>{URL.revokeObjectURL(s),a.remove()},1e4)})}catch(t){console.error("Load failed",t),console.log("\u274C Failed to load documents."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 025, Failed to load documents",data:{reason:"Failed to load documents",technicalError:t}})}}window.openDocumentsModal=Ie;var P=!1,me="form",H=null;async function be(){window.__unviredPrintHandlerInitialized||(window.__unviredPrintHandlerInitialized=!0,console.log("[Print] \u{1F5A8}\uFE0F Print handler initialized"),window.addEventListener("keydown",async t=>{(t.ctrlKey||t.metaKey)&&(t.key==="p"||t.key==="P")&&(t.preventDefault(),await Te())}),window.addEventListener("afterprint",()=>{P&&_e()}))}async function Te(){var p;if(P||!window.formObj||!window.loadTRform)return;console.log("[Print] \u{1F5A8}\uFE0F Print triggered via Ctrl+P"),P=!0,me=window.FORM_MODE||"form",H=window.formObj.submission.data,console.log("[Print] \u{1F504} Re-rendering form for print...");let n=window.FORM_TEMPLATE,r=window.FORM_THEME_DATA||{},o=window.FORM_LANGUAGE||"en",e=window.FORM_TRASLATIONS||{},i=window.FORM_CONTROL_DATA||{},s=window.FORM_PRIVATE_EXTERNAL,a=window.FORM_PERMISSION,f=window.FORM_ATTACHMENT_FILE_KEYS||[],u=(p=window.__unviredFormsOptions)==null?void 0:p.container;u&&u.classList.add("printing-in-progress","print-mode");try{let l=JSON.parse(JSON.stringify(window.FORM_TEMPLATE||{})),h=g=>{Array.isArray(g)&&g.forEach(y=>{y&&typeof y=="object"&&(y.collapsible&&(y.collapsed=!1),Array.isArray(y.components)&&h(y.components),Array.isArray(y.columns)&&y.columns.forEach(v=>{v&&Array.isArray(v.components)&&h(v.components)}),Array.isArray(y.rows)&&y.rows.forEach(v=>{Array.isArray(v)&&v.forEach(m=>{m&&Array.isArray(m.components)&&h(m.components)})}))})};l.components&&h(l.components),await window.loadTRform(l,H,r,"print",o,e,i,s,a,f),setTimeout(()=>{var y;console.log("[Print] \u{1F4C4} Cleaning up all colors for pure black & white print...");let g=(y=window.__unviredFormsOptions)==null?void 0:y.container;if(g){g.querySelectorAll("*").forEach(b=>{b.style.setProperty("color","#000","important"),b.style.setProperty("background-color","transparent","important"),b.style.setProperty("background-image","none","important"),(window.getComputedStyle(b).borderStyle!=="none"||b.tagName==="TD"||b.tagName==="TH")&&b.style.setProperty("border-color","#000","important"),b.style.minWidth&&b.style.minWidth!=="0px"&&b.style.setProperty("min-width","0px","important"),(b.tagName==="TH"||b.tagName==="TD")&&b.style.width&&b.style.width!=="1%"&&b.style.width!=="auto"&&b.style.setProperty("width","auto","important")}),g.querySelectorAll(".formio-button-add-row, .formio-button-remove-row").forEach(b=>{b.style.setProperty("display","none","important")}),document.querySelectorAll("#sticky-header, #sticky-footer, #form-back-btn, .form-back-btn, .sdk-loader-back-btn, #progress-bar, .progress-container, #sdk-form-loader, #unvired-more-btn, .back-button, .btn-back, [class*='back-btn'], [id*='back-btn']").forEach(b=>{b.style.setProperty("display","none","important"),b.style.setProperty("opacity","0","important"),b.style.setProperty("visibility","hidden","important")});let m=g.querySelector(".formio-wrapper");if(m){let b=g.clientWidth,S=m.scrollWidth;if(m.querySelectorAll("table").forEach(E=>{E.scrollWidth>S&&(S=E.scrollWidth)}),S>b&&b>0){let E=b/S*.98;console.log(`[Print] \u{1F4C4} Auto-scaling form by ${E.toFixed(2)} to fit screen width (${S}px -> ${b}px).`),m.style.setProperty("zoom",E.toString(),"important")}}}console.log("[Print] \u{1F4C4} Opening print dialog..."),window.print()},1500)}catch(l){console.error("[Print] \u274C Failed to render print mode:",l),P=!1,u&&u.classList.remove("printing-in-progress")}}async function _e(){var f,u,p;if(!P)return;await new Promise(l=>setTimeout(l,500)),console.log("[Print] ?? Restoring original form mode...");let t=window.FORM_TEMPLATE,n=window.FORM_THEME_DATA||{},r=window.FORM_LANGUAGE||"en",o=window.FORM_TRASLATIONS||{},e=window.FORM_CONTROL_DATA||{},i=window.FORM_PRIVATE_EXTERNAL,s=window.FORM_PERMISSION,a=window.FORM_ATTACHMENT_FILE_KEYS||[];if(!t){console.error("[Print] ?? Missing FORM_TEMPLATE, cannot restore."),P=!1;let l=(f=window.__unviredFormsOptions)==null?void 0:f.container;l&&l.classList.remove("printing-in-progress","print-mode","pdf-mode");return}try{let l=(u=window.__unviredFormsOptions)==null?void 0:u.container;if(l&&l.classList.remove("printing-in-progress","print-mode","pdf-mode"),window.formObj&&typeof window.formObj.destroy=="function")try{window.formObj.destroy()}catch(h){console.warn("[Print] ?? Error destroying print form instance:",h)}await window.loadTRform(t,H,n,me,r,o,e,i,s,a),console.log("[Print] ?? Form restored successfully")}catch(l){console.error("[Print] ?? Failed to restore original mode:",l)}finally{P=!1;let l=(p=window.__unviredFormsOptions)==null?void 0:p.container;l&&l.classList.remove("printing-in-progress")}}var Me=(t,n)=>{if(!t||!n)return;n.primaryColor=n.primaryColor||"#2586c7",n.secondaryColor=n.secondaryColor||"white",n.labelColor=n.labelColor||"#2586c7",n.fontSize=n.fontSize||"14px",n.fontFamily=n.fontFamily||"inherit",n.backgroundColor=n.backgroundColor||"white",n.backgroundImage=n.backgroundImage||"none",n.cardBackground=n.cardBackground||"white",n.headerBackground=n.headerBackground||"white",n.borderColor=n.borderColor||"#c5c5c5";let r={primaryColor:"--tf-primary-color",secondaryColor:"--tf-secondary-color",labelColor:"--tf-app-label-color",fontSize:"--tf-app-font-size-base",fontFamily:"--tf-app-font-family",backgroundColor:"--tf-app-bg-color",backgroundImage:"--tf-app-bg-image",cardBackground:"--tf-app-card-bg",headerBackground:"--tf-app-header-bg",borderColor:"--tf-border-color"};if(Object.keys(r).forEach(o=>{if(n[o]){let e=n[o];(o==="appBackgroundImage"||o==="backgroundImage")&&e&&!e.startsWith("url(")&&e!=="none"&&(e=`url(${e})`),o==="fontSize"&&typeof e=="number"&&(e=`${e}px`),t.style.setProperty(r[o],e,"important")}}),n.primaryColor||n.sdktheme){let o=n.primaryColor||n.sdktheme;if(o.startsWith("#")&&o.length===7){let e=parseInt(o.slice(1,3),16),i=parseInt(o.slice(3,5),16),s=parseInt(o.slice(5,7),16),a=`rgba(${e}, ${i}, ${s}, 0.12)`;t.style.setProperty("--tf-primary-color-transparent",a,"important")}}window.__unviredThemeData=n};async function De({formsData:t="formIOComponent",submissionData:n,eventCallback:r,container:o,options:e={nestedFormData:[{}],masterData:[{}],mode:"",platform:"",permission:"",language:"",privateExternal:"",title:"the form title entered",descrciption:"the form description entered",translations:{},themeData:{},userData:{},controlData:{},commentsData:[],vobArr:[],appData:[],environmentVariable:[],showComments:!1,showHelp:!1,showBackButton:!1,showLoader:!0,showMoreButton:!0,showFooter:!0,showCompleteAlways:!1,requireCompleteForm:!0}}){var K,Z,X,J,Q,ee,te;window.formdesign=window.formdesign||[];let i=[],s;console.log("[SDK:1] \u25B6 loadForms() started",{title:e==null?void 0:e.title,mode:e==null?void 0:e.mode,permission:e==null?void 0:e.permission,platform:e==null?void 0:e.platform});function a(d){let c=ie(d);typeof r=="function"&&r(c)}try{s=typeof t=="string"?JSON.parse(t):t,console.log("[SDK:2] \u2705 Form JSON parsed",{display:s==null?void 0:s.display,components:(K=s==null?void 0:s.components)==null?void 0:K.length})}catch(d){console.error("[SDK] \u274C Step 2: Failed to parse formsData JSON",d),a({type:"ERROR",errorMessage:"ErrorCode : 001, Invalid formsData JSON",data:{error:d}});return}le(s,e.appData),console.log("[SDK:3] \u2705 Dynamic values processed. Validating nested forms & master data...");let f=s,u=e.nestedFormData||[],p=e.masterData||[];console.log("-------------------------->>>",e.masterData),console.log("-------------------------->>>",e.nestedFormData);let l=oe(s,u);if(l){console.error("[SDK] \u274C Step 3: Nested form validation failed",l),a({type:"ERROR",errorMessage:"ErrorCode : 002, Nested form validation error",data:{technicalError:l}});return}let h=re(s,p);if(h){console.error("[SDK] \u274C Step 3: Master data validation failed",h),a({type:"ERROR",errorMessage:"ErrorCode : 003, Master data validation error",data:{technicalError:h}});return}if(!(e!=null&&e.userData)){console.error("[SDK] \u274C Step 3: userData not provided"),a({type:"ERROR",errorMessage:"ErrorCode : 004, User Data not Provided",data:{reason:"User Data not Provided"}});return}console.log("[SDK:4] \u2705 Merging nested forms & master data",{nestedForms:u.length,masterDataSets:p.length});let g=U(f,u),y=R(g,p,"dataSrc","masterdata");if(n&&f){console.log("[SDK:5] \u{1F4CE} Validating attachments in submission data...");try{let d=await ae(y,n,a);i=d.fileKeys,d.missingFiles.length>0?console.warn("[SDK:5] \u26A0\uFE0F Missing attachment files detected",{missing:d.missingFiles,fileKeys:i}):console.log("[SDK:5] \u2705 Attachments validated",{fileKeys:i})}catch(d){console.warn("[SDK:5] \u26A0\uFE0F Attachment validation skipped (non-fatal)",d)}}else console.log("[SDK:5] \u2139\uFE0F No submission data \u2014 attachment validation skipped");if(e!=null&&e.appData&&((Z=Object.keys(e==null?void 0:e.appData))==null?void 0:Z.length)>0&&N(y,e==null?void 0:e.appData,e),o&&(o.innerHTML="",o.classList.add("tf-formio-sdk"),Me(o,e.themeData)),!document.getElementById("unvired-forms-styles-marker")){let d=document.createElement("meta");d.id="unvired-forms-styles-marker",document.head.appendChild(d),`.r6o-drawing{cursor:none}.r6o-relations-layer.readonly .handle rect{pointer-events:none}.r6o-relations-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.r6o-relations-layer circle{stroke:#515151;stroke-width:.4;fill:#3f3f3f}.r6o-relations-layer path{stroke:#595959;stroke-linecap:round;stroke-linejoin:round;fill:transparent}.r6o-relations-layer path.connection{stroke-width:1.6;stroke-dasharray:2,3}.r6o-relations-layer path.r6o-arrow{stroke-width:1.8;fill:#7f7f7f}.r6o-relations-layer .handle rect{stroke-width:1;stroke:#595959;fill:#fff;pointer-events:auto;cursor:pointer}.r6o-relations-layer .handle text{font-size:10px}.r6o-relations-layer .hover{stroke:#3f3f3fe6;stroke-width:1.4;fill:transparent}.r6o-editor{margin-left:-12px}.r6o-annotation{background-color:#ffa50033;border-bottom:2px solid orange;cursor:pointer}.r6o-selection{background-color:#cfcfffa1;cursor:pointer}.r6o-hide-selection::selection,.r6o-hide-selection ::selection{background:transparent}.r6o-hide-selection::-moz-selection .r6o-hide-selection ::-moz-selection{background:transparent}.r6o-relation-editor{position:absolute;font-family:inherit;font-size:17px;line-height:27px;-webkit-box-shadow:0 1px 14px rgba(0,0,0,.4);-moz-box-shadow:0 1px 14px rgba(0,0,0,.4);box-shadow:0 1px 14px #0006;-webkit-border-radius:3px;-khtml-border-radius:3px;-moz-border-radius:3px;border-radius:3px;transform:translate(-50%,-50%);background-color:#fff}.r6o-relation-editor svg{vertical-align:middle;shape-rendering:geometricPrecision}.r6o-relation-editor *{box-sizing:border-box}.r6o-relation-editor .input-wrapper{height:34px;padding:0 6px;margin-right:68px;font-size:14px;background-color:#ecf0f1;cursor:text;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-radius-topleft:3px;-khtml-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.r6o-relation-editor .input-wrapper .r6o-autocomplete ul{position:relative;left:-6px}.r6o-relation-editor .buttons{position:absolute;display:inline-flex;top:0;right:0}.r6o-relation-editor .buttons span{height:34px;display:inline-block;width:34px;text-align:center;font-size:14px;cursor:pointer;padding:1px 0}.r6o-relation-editor .buttons .delete{background-color:#fff;color:#9ca4b1;border-left:1px solid #e5e5e5}.r6o-relation-editor .buttons .delete:hover{background-color:#f6f6f6}.r6o-relation-editor .buttons .ok{background-color:#4483c4;color:#fff;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-radius-topright:3px;-khtml-border-radius-bottomright:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.r6o-relation-editor .buttons .ok:hover{background-color:#4f92d7}.r6o-btn{background-color:#4483c4;border:1px solid #4483c4;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;margin:0;outline:none;text-decoration:none;white-space:nowrap;padding:6px 18px;min-width:70px;vertical-align:middle;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.r6o-btn *{vertical-align:middle;cursor:pointer}.r6o-btn .r6o-icon{margin-right:4px}.r6o-btn:disabled{border-color:#a3c2e2!important;background-color:#a3c2e2!important}.r6o-btn:hover{background-color:#4f92d7;border-color:#4f92d7}.r6o-btn.outline{border:1px solid #4483c4;color:#4483c4;background-color:transparent;text-shadow:none}.r6o-autocomplete{display:inline;position:relative}.r6o-autocomplete div[role=combobox]{display:inline}.r6o-autocomplete input{outline:none;border:none;width:80px;height:100%;line-height:14px;white-space:pre;box-sizing:border-box;background-color:transparent;font-size:14px;color:#3f3f3f}.r6o-autocomplete ul{position:absolute;margin:0;padding:0;list-style-type:none;background-color:#fff;border-radius:3px;border:1px solid #d6d7d9;box-sizing:border-box;box-shadow:0 0 20px #00000040}.r6o-autocomplete ul:empty{display:none}.r6o-autocomplete li{box-sizing:border-box;padding:2px 12px;width:100%;cursor:pointer}.r6o-editable-text{max-height:120px;overflow:auto;outline:none;min-height:2em;font-size:14px;font-family:inherit}.r6o-editable-text:empty:not(:focus):before{content:attr(data-placeholder);color:#c2c2c2}.r6o-widget.comment{font-size:14px;min-height:3em;background-color:#fff;position:relative}.r6o-widget.comment .r6o-editable-text,.r6o-widget.comment .r6o-readonly-comment{padding:10px;width:100%;box-sizing:border-box;outline:none;border:none;background-color:transparent;resize:none}.r6o-widget.comment .r6o-readonly-comment{white-space:pre}.r6o-widget.comment .r6o-editable-text::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text::-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-ms-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-lastmodified{border:1px solid #e5e5e5;display:inline-block;border-radius:2px;margin:0 10px 8px;padding:4px 5px;line-height:100%;font-size:12px}.r6o-widget.comment .r6o-lastmodified .r6o-lastmodified-at{color:#757575;padding-left:3px}.r6o-widget.comment .r6o-arrow-down{position:absolute;height:20px;width:20px;top:9px;right:9px;line-height:22px;background-color:#fff;text-align:center;-webkit-font-smoothing:antialiased;border:1px solid #e5e5e5;cursor:pointer;-webkit-border-radius:1px;-khtml-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.r6o-widget.comment .r6o-arrow-down.r6o-menu-open{border-color:#4483c4}.r6o-widget.comment .r6o-comment-dropdown-menu{position:absolute;top:32px;right:8px;background-color:#fff;border:1px solid #e5e5e5;list-style-type:none;margin:0;padding:5px 0;z-index:9999;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px #0003}.r6o-widget.comment .r6o-comment-dropdown-menu li{padding:0 15px;cursor:pointer}.r6o-widget.comment .r6o-comment-dropdown-menu li:hover{background-color:#ecf0f1}.r6o-widget.comment .r6o-purposedropdown{position:relative;z-index:2}.r6o-widget.comment.editable{background-color:#ecf0f1}.r6o-widget.r6o-tag:empty{display:none}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.r6o-widget.tag .r6o-taglist li{height:27px}.r6o-widget.tag .r6o-taglist li .r6o-delete-wrapper .r6o-delete{position:relative;top:-4px}}.r6o-widget.r6o-tag{background-color:#ecf0f1;border-bottom:1px solid #e5e5e5;padding:1px 3px;display:flex}.r6o-widget.r6o-tag ul{margin:0;padding:0;list-style-type:none;z-index:1}.r6o-widget.r6o-tag ul.r6o-taglist{flex:0;white-space:nowrap}.r6o-widget.r6o-tag ul.r6o-taglist li{display:inline-block;margin:1px 1px 1px 0;padding:0;vertical-align:middle;overflow:hidden;font-size:12px;background-color:#fff;border:1px solid #d6d7d9;cursor:pointer;position:relative;line-height:180%;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 4px rgba(0,0,0,.1);-moz-box-shadow:0 0 4px rgba(0,0,0,.1);box-shadow:0 0 4px #0000001a}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-label{padding:2px 8px;display:inline-block}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper{display:inline-block;padding:2px 0;color:#fff;width:0;height:100%;background-color:#4483c4;-webkit-border-top-right-radius:2px;-webkit-border-bottom-right-radius:2px;-khtml-border-radius-topright:2px;-khtml-border-radius-bottomright:2px;-moz-border-radius-topright:2px;-moz-border-radius-bottomright:2px;border-top-right-radius:2px;border-bottom-right-radius:2px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper .r6o-delete{padding:2px 6px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper svg{vertical-align:text-top}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-active{width:24px;transition:width .2s}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-done,.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit-active{width:0;transition:width .2s}.r6o-widget.r6o-tag .r6o-autocomplete{flex:1;position:relative}.r6o-widget.r6o-tag .r6o-autocomplete li{font-size:14px}.r6o-widget.r6o-tag input{width:100%;padding:0 3px;min-width:80px;outline:none;border:none;line-height:170%;background-color:transparent;color:#3f3f3f}.r6o-widget.r6o-tag input::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input::-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-ms-input-placeholder{color:#c2c2c2}.r6o-editor{position:absolute;z-index:99999;width:400px;color:#3f3f3f;opacity:0;font-family:inherit;font-size:17px;line-height:27px;-webkit-transition:opacity .2s ease-in;-moz-transition:opacity .2s ease-in;transition:opacity .2s ease-in}.r6o-editor .r6o-arrow{position:absolute;overflow:hidden;top:-12px;left:12px;width:28px;height:12px;display:none}.r6o-editor .r6o-arrow:after{content:"";position:absolute;top:5px;left:5px;width:18px;height:18px;background-color:#fff;-webkit-backface-visibility:hidden;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.r6o-editor .r6o-editor-inner{background-color:#fff;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:2px 2px 42px rgba(0,0,0,.4);-moz-box-shadow:2px 2px 42px rgba(0,0,0,.4);box-shadow:2px 2px 42px #0006}.r6o-editor .r6o-editor-inner .r6o-widget:first-child{-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-khtml-border-radius-topleft:2px;-khtml-border-radius-topright:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}.r6o-editor .r6o-editor-inner .r6o-widget{border-bottom:1px solid #e5e5e5}.r6o-editor .r6o-footer{position:relative;text-align:right;padding:8px 0}.r6o-editor .r6o-footer .r6o-btn{margin-right:8px}.r6o-editor .r6o-footer .r6o-btn.delete-annotation{position:absolute;top:7px;left:7px;background-color:transparent;border:none;color:#4483c4;width:32px;height:32px;min-width:0;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center;-webkit-transition:all .1s ease-in;-moz-transition:all .1s ease-in;-o-transition:all .1s ease-in;transition:all .1s ease-in}.r6o-editor .r6o-footer .r6o-btn.delete-annotation:hover{color:#fff;background-color:#ef352c}@media (max-width: 640px){.r6o-editor{width:260px}}.r6o-editor.r6o-arrow-top .r6o-arrow{display:block}.r6o-editor.r6o-arrow-right{margin-left:8px}.r6o-editor.r6o-arrow-right .r6o-arrow{left:auto;right:12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow{display:block;top:auto;bottom:-12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow:after{top:-11px;box-shadow:none}.r6o-editor.pushed .r6o-arrow,.r6o-editor.dragged .r6o-arrow{display:none}.r6o-editor .r6o-draggable{cursor:move}.r6o-purposedropdown{width:150px;display:inline-block}.r6o-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
|
28
|
+
</div>`,window.showDynamicModal("App Documents",[{label:"Close",callback:()=>{},className:"btn btn-secondary footer-btn footer-btn-secondary"}],n),window.downloadDocument||(window.downloadDocument=async function(r){let e=(await he()).find(f=>f.id==r);if(!e){console.log("\u274C Document not found."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 017, Document not found",data:{reason:"Document not found",technicalError:null}});return}console.log("Downloading:",e);let i=e.url||e.data||e.file&&e.file.data,s=null;if(i&&i.startsWith("data:")){let f=i.indexOf(",");if(f===-1){console.log("\u274C Invalid file format."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 018, Invalid file format",data:{reason:"Invalid file format",technicalError:null}});return}let u=i.substring(0,f),p=i.substring(f+1),l=u.match(/:(.*?);/),h=l?l[1]:"application/octet-stream";if(p=p.replace(/\s/g,""),!/^[A-Za-z0-9+/=]+$/.test(p)){console.error("Invalid base64:",p.slice(0,50)),console.log("\u274C File is corrupted (invalid base64)."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 019, File is corrupted (invalid base64)",data:{reason:"File is corrupted (invalid base64)",technicalError:null}});return}try{let g=atob(p),y=new Uint8Array(g.length);for(let m=0;m<g.length;m++)y[m]=g.charCodeAt(m);let v=new Blob([y],{type:h});if(!v.size){console.log("\u274C File is empty."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 020, File is empty",data:{reason:"File is empty",technicalError:null}});return}s=URL.createObjectURL(v)}catch(g){console.error("Base64 decode failed:",g),g.name==="InvalidCharacterError"?(console.log("\u274C File is corrupted (invalid encoding)."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 021, File is corrupted (invalid encoding)",data:{reason:"File is corrupted (invalid encoding)",technicalError:g}})):(console.log("\u274C Failed to process file."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 022, Failed to process file",data:{reason:"Failed to process file",technicalError:g}}));return}}else if(e.file instanceof Blob){if(!e.file.size){console.log("\u274C File is empty."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 023, File is empty",data:{reason:"File is empty",technicalError:null}});return}s=URL.createObjectURL(e.file)}else{console.log("\u274C No downloadable content found."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 024, No downloadable content found",data:{reason:"No downloadable content found",technicalError:null}});return}let a=document.createElement("a");a.href=s,a.download=e.name||"document",document.body.appendChild(a),a.click(),setTimeout(()=>{URL.revokeObjectURL(s),a.remove()},1e4)})}catch(t){console.error("Load failed",t),console.log("\u274C Failed to load documents."),window.sendEventCallback&&window.sendEventCallback({type:"ERROR",errorMessage:"ErrorCode : 025, Failed to load documents",data:{reason:"Failed to load documents",technicalError:t}})}}window.openDocumentsModal=Te;var P=!1,me="form",H=null;async function be(){window.__unviredPrintHandlerInitialized||(window.__unviredPrintHandlerInitialized=!0,console.log("[Print] \u{1F5A8}\uFE0F Print handler initialized"),window.addEventListener("keydown",async t=>{(t.ctrlKey||t.metaKey)&&(t.key==="p"||t.key==="P")&&(t.preventDefault(),await _e())}),window.addEventListener("afterprint",()=>{P&&Me()}))}async function _e(){var p;if(P||!window.formObj||!window.loadTRform)return;console.log("[Print] \u{1F5A8}\uFE0F Print triggered via Ctrl+P"),P=!0,me=window.FORM_MODE||"form",H=window.formObj.submission.data,console.log("[Print] \u{1F504} Re-rendering form for print...");let n=window.FORM_TEMPLATE,r=window.FORM_THEME_DATA||{},o=window.FORM_LANGUAGE||"en",e=window.FORM_TRASLATIONS||{},i=window.FORM_CONTROL_DATA||{},s=window.FORM_PRIVATE_EXTERNAL,a=window.FORM_PERMISSION,f=window.FORM_ATTACHMENT_FILE_KEYS||[],u=(p=window.__unviredFormsOptions)==null?void 0:p.container;u&&u.classList.add("printing-in-progress","print-mode");try{let l=JSON.parse(JSON.stringify(window.FORM_TEMPLATE||{})),h=g=>{Array.isArray(g)&&g.forEach(y=>{y&&typeof y=="object"&&(y.collapsible&&(y.collapsed=!1),Array.isArray(y.components)&&h(y.components),Array.isArray(y.columns)&&y.columns.forEach(v=>{v&&Array.isArray(v.components)&&h(v.components)}),Array.isArray(y.rows)&&y.rows.forEach(v=>{Array.isArray(v)&&v.forEach(m=>{m&&Array.isArray(m.components)&&h(m.components)})}))})};l.components&&h(l.components),await window.loadTRform(l,H,r,"print",o,e,i,s,a,f),setTimeout(()=>{var y;console.log("[Print] \u{1F4C4} Cleaning up all colors for pure black & white print...");let g=(y=window.__unviredFormsOptions)==null?void 0:y.container;if(g){g.querySelectorAll("*").forEach(b=>{b.style.setProperty("color","#000","important"),b.style.setProperty("background-color","transparent","important"),b.style.setProperty("background-image","none","important"),(window.getComputedStyle(b).borderStyle!=="none"||b.tagName==="TD"||b.tagName==="TH")&&b.style.setProperty("border-color","#000","important"),b.style.minWidth&&b.style.minWidth!=="0px"&&b.style.setProperty("min-width","0px","important"),(b.tagName==="TH"||b.tagName==="TD")&&b.style.width&&b.style.width!=="1%"&&b.style.width!=="auto"&&b.style.setProperty("width","auto","important")}),g.querySelectorAll(".formio-button-add-row, .formio-button-remove-row").forEach(b=>{b.style.setProperty("display","none","important")}),document.querySelectorAll("#sticky-header, #sticky-footer, #form-back-btn, .form-back-btn, .sdk-loader-back-btn, #progress-bar, .progress-container, #sdk-form-loader, #unvired-more-btn, .back-button, .btn-back, [class*='back-btn'], [id*='back-btn']").forEach(b=>{b.style.setProperty("display","none","important"),b.style.setProperty("opacity","0","important"),b.style.setProperty("visibility","hidden","important")});let m=g.querySelector(".formio-wrapper");if(m){let b=g.clientWidth,S=m.scrollWidth;if(m.querySelectorAll("table").forEach(E=>{E.scrollWidth>S&&(S=E.scrollWidth)}),S>b&&b>0){let E=b/S*.98;console.log(`[Print] \u{1F4C4} Auto-scaling form by ${E.toFixed(2)} to fit screen width (${S}px -> ${b}px).`),m.style.setProperty("zoom",E.toString(),"important")}}}console.log("[Print] \u{1F4C4} Opening print dialog..."),window.print()},1500)}catch(l){console.error("[Print] \u274C Failed to render print mode:",l),P=!1,u&&u.classList.remove("printing-in-progress")}}async function Me(){var f,u,p;if(!P)return;await new Promise(l=>setTimeout(l,500)),console.log("[Print] ?? Restoring original form mode...");let t=window.FORM_TEMPLATE,n=window.FORM_THEME_DATA||{},r=window.FORM_LANGUAGE||"en",o=window.FORM_TRASLATIONS||{},e=window.FORM_CONTROL_DATA||{},i=window.FORM_PRIVATE_EXTERNAL,s=window.FORM_PERMISSION,a=window.FORM_ATTACHMENT_FILE_KEYS||[];if(!t){console.error("[Print] ?? Missing FORM_TEMPLATE, cannot restore."),P=!1;let l=(f=window.__unviredFormsOptions)==null?void 0:f.container;l&&l.classList.remove("printing-in-progress","print-mode","pdf-mode");return}try{let l=(u=window.__unviredFormsOptions)==null?void 0:u.container;if(l&&l.classList.remove("printing-in-progress","print-mode","pdf-mode"),window.formObj&&typeof window.formObj.destroy=="function")try{window.formObj.destroy()}catch(h){console.warn("[Print] ?? Error destroying print form instance:",h)}await window.loadTRform(t,H,n,me,r,o,e,i,s,a),console.log("[Print] ?? Form restored successfully")}catch(l){console.error("[Print] ?? Failed to restore original mode:",l)}finally{P=!1;let l=(p=window.__unviredFormsOptions)==null?void 0:p.container;l&&l.classList.remove("printing-in-progress")}}var De=(t,n)=>{if(!t||!n)return;n.primaryColor=n.primaryColor||"#2586c7",n.secondaryColor=n.secondaryColor||"white",n.labelColor=n.labelColor||"#2586c7",n.fontSize=n.fontSize||"14px",n.fontFamily=n.fontFamily||"inherit",n.backgroundColor=n.backgroundColor||"white",n.backgroundImage=n.backgroundImage||"none",n.cardBackground=n.cardBackground||"white",n.headerBackground=n.headerBackground||"white",n.borderColor=n.borderColor||"#c5c5c5";let r={primaryColor:"--tf-primary-color",secondaryColor:"--tf-secondary-color",labelColor:"--tf-app-label-color",fontSize:"--tf-app-font-size-base",fontFamily:"--tf-app-font-family",backgroundColor:"--tf-app-bg-color",backgroundImage:"--tf-app-bg-image",cardBackground:"--tf-app-card-bg",headerBackground:"--tf-app-header-bg",borderColor:"--tf-border-color"};if(Object.keys(r).forEach(o=>{if(n[o]){let e=n[o];(o==="appBackgroundImage"||o==="backgroundImage")&&e&&!e.startsWith("url(")&&e!=="none"&&(e=`url(${e})`),o==="fontSize"&&typeof e=="number"&&(e=`${e}px`),t.style.setProperty(r[o],e,"important")}}),n.primaryColor||n.sdktheme){let o=n.primaryColor||n.sdktheme;if(o.startsWith("#")&&o.length===7){let e=parseInt(o.slice(1,3),16),i=parseInt(o.slice(3,5),16),s=parseInt(o.slice(5,7),16),a=`rgba(${e}, ${i}, ${s}, 0.12)`;t.style.setProperty("--tf-primary-color-transparent",a,"important")}}window.__unviredThemeData=n};async function ge({formsData:t="formIOComponent",submissionData:n,eventCallback:r,container:o,options:e={nestedFormData:[{}],masterData:[{}],mode:"",platform:"",permission:"",language:"",privateExternal:"",title:"the form title entered",descrciption:"the form description entered",translations:{},themeData:{},userData:{},controlData:{},commentsData:[],vobArr:[],appData:[],environmentVariable:[],showComments:!1,showHelp:!1,showBackButton:!1,showLoader:!0,showMoreButton:!0,showFooter:!0,showCompleteAlways:!1,requireCompleteForm:!0}}){var K,Z,X,J,Q,ee,te;window.formdesign=window.formdesign||[];let i=[],s;console.log("[SDK:1] \u25B6 loadForms() started",{title:e==null?void 0:e.title,mode:e==null?void 0:e.mode,permission:e==null?void 0:e.permission,platform:e==null?void 0:e.platform});function a(d){let c=ie(d);typeof r=="function"&&r(c)}try{s=typeof t=="string"?JSON.parse(t):t,console.log("[SDK:2] \u2705 Form JSON parsed",{display:s==null?void 0:s.display,components:(K=s==null?void 0:s.components)==null?void 0:K.length})}catch(d){console.error("[SDK] \u274C Step 2: Failed to parse formsData JSON",d),a({type:"ERROR",errorMessage:"ErrorCode : 001, Invalid formsData JSON",data:{error:d}});return}le(s,e.appData),console.log("[SDK:3] \u2705 Dynamic values processed. Validating nested forms & master data...");let f=s,u=e.nestedFormData||[],p=e.masterData||[];console.log("-------------------------->>>",e.masterData),console.log("-------------------------->>>",e.nestedFormData);let l=oe(s,u);if(l){console.error("[SDK] \u274C Step 3: Nested form validation failed",l),a({type:"ERROR",errorMessage:"ErrorCode : 002, Nested form validation error",data:{technicalError:l}});return}let h=re(s,p);if(h){console.error("[SDK] \u274C Step 3: Master data validation failed",h),a({type:"ERROR",errorMessage:"ErrorCode : 003, Master data validation error",data:{technicalError:h}});return}if(!(e!=null&&e.userData)){console.error("[SDK] \u274C Step 3: userData not provided"),a({type:"ERROR",errorMessage:"ErrorCode : 004, User Data not Provided",data:{reason:"User Data not Provided"}});return}console.log("[SDK:4] \u2705 Merging nested forms & master data",{nestedForms:u.length,masterDataSets:p.length});let g=U(f,u),y=R(g,p,"dataSrc","masterdata");if(n&&f){console.log("[SDK:5] \u{1F4CE} Validating attachments in submission data...");try{let d=await ae(y,n,a);i=d.fileKeys,d.missingFiles.length>0?console.warn("[SDK:5] \u26A0\uFE0F Missing attachment files detected",{missing:d.missingFiles,fileKeys:i}):console.log("[SDK:5] \u2705 Attachments validated",{fileKeys:i})}catch(d){console.warn("[SDK:5] \u26A0\uFE0F Attachment validation skipped (non-fatal)",d)}}else console.log("[SDK:5] \u2139\uFE0F No submission data \u2014 attachment validation skipped");if(e!=null&&e.appData&&((Z=Object.keys(e==null?void 0:e.appData))==null?void 0:Z.length)>0&&N(y,e==null?void 0:e.appData,e),o&&(o.innerHTML="",o.classList.add("tf-formio-sdk"),De(o,e.themeData)),!document.getElementById("unvired-forms-styles-marker")){let d=document.createElement("meta");d.id="unvired-forms-styles-marker",document.head.appendChild(d),`.r6o-drawing{cursor:none}.r6o-relations-layer.readonly .handle rect{pointer-events:none}.r6o-relations-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.r6o-relations-layer circle{stroke:#515151;stroke-width:.4;fill:#3f3f3f}.r6o-relations-layer path{stroke:#595959;stroke-linecap:round;stroke-linejoin:round;fill:transparent}.r6o-relations-layer path.connection{stroke-width:1.6;stroke-dasharray:2,3}.r6o-relations-layer path.r6o-arrow{stroke-width:1.8;fill:#7f7f7f}.r6o-relations-layer .handle rect{stroke-width:1;stroke:#595959;fill:#fff;pointer-events:auto;cursor:pointer}.r6o-relations-layer .handle text{font-size:10px}.r6o-relations-layer .hover{stroke:#3f3f3fe6;stroke-width:1.4;fill:transparent}.r6o-editor{margin-left:-12px}.r6o-annotation{background-color:#ffa50033;border-bottom:2px solid orange;cursor:pointer}.r6o-selection{background-color:#cfcfffa1;cursor:pointer}.r6o-hide-selection::selection,.r6o-hide-selection ::selection{background:transparent}.r6o-hide-selection::-moz-selection .r6o-hide-selection ::-moz-selection{background:transparent}.r6o-relation-editor{position:absolute;font-family:inherit;font-size:17px;line-height:27px;-webkit-box-shadow:0 1px 14px rgba(0,0,0,.4);-moz-box-shadow:0 1px 14px rgba(0,0,0,.4);box-shadow:0 1px 14px #0006;-webkit-border-radius:3px;-khtml-border-radius:3px;-moz-border-radius:3px;border-radius:3px;transform:translate(-50%,-50%);background-color:#fff}.r6o-relation-editor svg{vertical-align:middle;shape-rendering:geometricPrecision}.r6o-relation-editor *{box-sizing:border-box}.r6o-relation-editor .input-wrapper{height:34px;padding:0 6px;margin-right:68px;font-size:14px;background-color:#ecf0f1;cursor:text;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-radius-topleft:3px;-khtml-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.r6o-relation-editor .input-wrapper .r6o-autocomplete ul{position:relative;left:-6px}.r6o-relation-editor .buttons{position:absolute;display:inline-flex;top:0;right:0}.r6o-relation-editor .buttons span{height:34px;display:inline-block;width:34px;text-align:center;font-size:14px;cursor:pointer;padding:1px 0}.r6o-relation-editor .buttons .delete{background-color:#fff;color:#9ca4b1;border-left:1px solid #e5e5e5}.r6o-relation-editor .buttons .delete:hover{background-color:#f6f6f6}.r6o-relation-editor .buttons .ok{background-color:#4483c4;color:#fff;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-radius-topright:3px;-khtml-border-radius-bottomright:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.r6o-relation-editor .buttons .ok:hover{background-color:#4f92d7}.r6o-btn{background-color:#4483c4;border:1px solid #4483c4;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;margin:0;outline:none;text-decoration:none;white-space:nowrap;padding:6px 18px;min-width:70px;vertical-align:middle;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.r6o-btn *{vertical-align:middle;cursor:pointer}.r6o-btn .r6o-icon{margin-right:4px}.r6o-btn:disabled{border-color:#a3c2e2!important;background-color:#a3c2e2!important}.r6o-btn:hover{background-color:#4f92d7;border-color:#4f92d7}.r6o-btn.outline{border:1px solid #4483c4;color:#4483c4;background-color:transparent;text-shadow:none}.r6o-autocomplete{display:inline;position:relative}.r6o-autocomplete div[role=combobox]{display:inline}.r6o-autocomplete input{outline:none;border:none;width:80px;height:100%;line-height:14px;white-space:pre;box-sizing:border-box;background-color:transparent;font-size:14px;color:#3f3f3f}.r6o-autocomplete ul{position:absolute;margin:0;padding:0;list-style-type:none;background-color:#fff;border-radius:3px;border:1px solid #d6d7d9;box-sizing:border-box;box-shadow:0 0 20px #00000040}.r6o-autocomplete ul:empty{display:none}.r6o-autocomplete li{box-sizing:border-box;padding:2px 12px;width:100%;cursor:pointer}.r6o-editable-text{max-height:120px;overflow:auto;outline:none;min-height:2em;font-size:14px;font-family:inherit}.r6o-editable-text:empty:not(:focus):before{content:attr(data-placeholder);color:#c2c2c2}.r6o-widget.comment{font-size:14px;min-height:3em;background-color:#fff;position:relative}.r6o-widget.comment .r6o-editable-text,.r6o-widget.comment .r6o-readonly-comment{padding:10px;width:100%;box-sizing:border-box;outline:none;border:none;background-color:transparent;resize:none}.r6o-widget.comment .r6o-readonly-comment{white-space:pre}.r6o-widget.comment .r6o-editable-text::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text::-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-moz-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-editable-text:-ms-input-placeholder{color:#c2c2c2}.r6o-widget.comment .r6o-lastmodified{border:1px solid #e5e5e5;display:inline-block;border-radius:2px;margin:0 10px 8px;padding:4px 5px;line-height:100%;font-size:12px}.r6o-widget.comment .r6o-lastmodified .r6o-lastmodified-at{color:#757575;padding-left:3px}.r6o-widget.comment .r6o-arrow-down{position:absolute;height:20px;width:20px;top:9px;right:9px;line-height:22px;background-color:#fff;text-align:center;-webkit-font-smoothing:antialiased;border:1px solid #e5e5e5;cursor:pointer;-webkit-border-radius:1px;-khtml-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.r6o-widget.comment .r6o-arrow-down.r6o-menu-open{border-color:#4483c4}.r6o-widget.comment .r6o-comment-dropdown-menu{position:absolute;top:32px;right:8px;background-color:#fff;border:1px solid #e5e5e5;list-style-type:none;margin:0;padding:5px 0;z-index:9999;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px #0003}.r6o-widget.comment .r6o-comment-dropdown-menu li{padding:0 15px;cursor:pointer}.r6o-widget.comment .r6o-comment-dropdown-menu li:hover{background-color:#ecf0f1}.r6o-widget.comment .r6o-purposedropdown{position:relative;z-index:2}.r6o-widget.comment.editable{background-color:#ecf0f1}.r6o-widget.r6o-tag:empty{display:none}@media all and (-ms-high-contrast: none),(-ms-high-contrast: active){.r6o-widget.tag .r6o-taglist li{height:27px}.r6o-widget.tag .r6o-taglist li .r6o-delete-wrapper .r6o-delete{position:relative;top:-4px}}.r6o-widget.r6o-tag{background-color:#ecf0f1;border-bottom:1px solid #e5e5e5;padding:1px 3px;display:flex}.r6o-widget.r6o-tag ul{margin:0;padding:0;list-style-type:none;z-index:1}.r6o-widget.r6o-tag ul.r6o-taglist{flex:0;white-space:nowrap}.r6o-widget.r6o-tag ul.r6o-taglist li{display:inline-block;margin:1px 1px 1px 0;padding:0;vertical-align:middle;overflow:hidden;font-size:12px;background-color:#fff;border:1px solid #d6d7d9;cursor:pointer;position:relative;line-height:180%;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 4px rgba(0,0,0,.1);-moz-box-shadow:0 0 4px rgba(0,0,0,.1);box-shadow:0 0 4px #0000001a}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-label{padding:2px 8px;display:inline-block}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper{display:inline-block;padding:2px 0;color:#fff;width:0;height:100%;background-color:#4483c4;-webkit-border-top-right-radius:2px;-webkit-border-bottom-right-radius:2px;-khtml-border-radius-topright:2px;-khtml-border-radius-bottomright:2px;-moz-border-radius-topright:2px;-moz-border-radius-bottomright:2px;border-top-right-radius:2px;border-bottom-right-radius:2px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper .r6o-delete{padding:2px 6px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-wrapper svg{vertical-align:text-top}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-active{width:24px;transition:width .2s}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-enter-done,.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit{width:24px}.r6o-widget.r6o-tag ul.r6o-taglist li .r6o-delete-exit-active{width:0;transition:width .2s}.r6o-widget.r6o-tag .r6o-autocomplete{flex:1;position:relative}.r6o-widget.r6o-tag .r6o-autocomplete li{font-size:14px}.r6o-widget.r6o-tag input{width:100%;padding:0 3px;min-width:80px;outline:none;border:none;line-height:170%;background-color:transparent;color:#3f3f3f}.r6o-widget.r6o-tag input::-webkit-input-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input::-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-moz-placeholder{color:#c2c2c2}.r6o-widget.r6o-tag input:-ms-input-placeholder{color:#c2c2c2}.r6o-editor{position:absolute;z-index:99999;width:400px;color:#3f3f3f;opacity:0;font-family:inherit;font-size:17px;line-height:27px;-webkit-transition:opacity .2s ease-in;-moz-transition:opacity .2s ease-in;transition:opacity .2s ease-in}.r6o-editor .r6o-arrow{position:absolute;overflow:hidden;top:-12px;left:12px;width:28px;height:12px;display:none}.r6o-editor .r6o-arrow:after{content:"";position:absolute;top:5px;left:5px;width:18px;height:18px;background-color:#fff;-webkit-backface-visibility:hidden;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.r6o-editor .r6o-editor-inner{background-color:#fff;-webkit-border-radius:2px;-khtml-border-radius:2px;-moz-border-radius:2px;border-radius:2px;-webkit-box-shadow:2px 2px 42px rgba(0,0,0,.4);-moz-box-shadow:2px 2px 42px rgba(0,0,0,.4);box-shadow:2px 2px 42px #0006}.r6o-editor .r6o-editor-inner .r6o-widget:first-child{-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-khtml-border-radius-topleft:2px;-khtml-border-radius-topright:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}.r6o-editor .r6o-editor-inner .r6o-widget{border-bottom:1px solid #e5e5e5}.r6o-editor .r6o-footer{position:relative;text-align:right;padding:8px 0}.r6o-editor .r6o-footer .r6o-btn{margin-right:8px}.r6o-editor .r6o-footer .r6o-btn.delete-annotation{position:absolute;top:7px;left:7px;background-color:transparent;border:none;color:#4483c4;width:32px;height:32px;min-width:0;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center;-webkit-transition:all .1s ease-in;-moz-transition:all .1s ease-in;-o-transition:all .1s ease-in;transition:all .1s ease-in}.r6o-editor .r6o-footer .r6o-btn.delete-annotation:hover{color:#fff;background-color:#ef352c}@media (max-width: 640px){.r6o-editor{width:260px}}.r6o-editor.r6o-arrow-top .r6o-arrow{display:block}.r6o-editor.r6o-arrow-right{margin-left:8px}.r6o-editor.r6o-arrow-right .r6o-arrow{left:auto;right:12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow{display:block;top:auto;bottom:-12px}.r6o-editor.r6o-arrow-bottom .r6o-arrow:after{top:-11px;box-shadow:none}.r6o-editor.pushed .r6o-arrow,.r6o-editor.dragged .r6o-arrow{display:none}.r6o-editor .r6o-draggable{cursor:move}.r6o-purposedropdown{width:150px;display:inline-block}.r6o-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
|
29
29
|
|
|
30
30
|
/* === STYLE_SEPARATOR === */
|
|
31
31
|
|
|
@@ -185,7 +185,7 @@ var TurboForms=(()=>{var V=Object.defineProperty;var ve=Object.getOwnPropertyDes
|
|
|
185
185
|
</div>
|
|
186
186
|
${(ee=e.themeData)!=null&&ee.isCard?"</div>":""}
|
|
187
187
|
<div id="sticky-footer" class="${e.showFooter===!1?"footer-hidden":""}">
|
|
188
|
-
<div class="build-version">SDK v2.0.
|
|
188
|
+
<div class="build-version">SDK v2.0.24</div>
|
|
189
189
|
|
|
190
190
|
<button class="footer-btn footer-btn-secondary" id="prevBtn" style="display:none" onclick="FormOnPrevious()">
|
|
191
191
|
<i class="bi bi-chevron-left"></i> Previous
|
|
@@ -248,4 +248,4 @@ var TurboForms=(()=>{var V=Object.defineProperty;var ve=Object.getOwnPropertyDes
|
|
|
248
248
|
|
|
249
249
|
// === SCRIPT_SEPARATOR ===
|
|
250
250
|
|
|
251
|
-
`);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,console.log("[SDK:10] \u{1F527} Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let d=c=>{if(v){let w=v.querySelector(".sdk-loader-text");w&&(w.textContent=c)}};if(d("Loading Core Components..."),m[0]&&m[0].trim()){let c=document.createElement("script");c.textContent=m[0],c.setAttribute("data-unvired-script","jquery"),document.head.appendChild(c)}if(m[4]&&m[4].trim()){let c=document.createElement("script");c.textContent=m[4],c.setAttribute("data-unvired-script","choices"),document.head.appendChild(c)}if(d("Loading Formio Library..."),m[5]&&m[5].trim()){let c=document.createElement("script");c.textContent=m[5],c.setAttribute("data-unvired-script","formio"),document.head.appendChild(c),console.log("[SDK:10.2] \u2705 Bundled Formio library injected.")}if(e.showComments){d("Loading Annotation Tools...");for(let c=1;c<=2;c++)if(m[c]&&m[c].trim()){let w=document.createElement("script");w.textContent=m[c],w.setAttribute("data-unvired-script",`recogito-${c}`),document.head.appendChild(w),await new Promise(x=>setTimeout(x,0))}}else console.log("[SDK:10.3] \u26A1 Skipping Recogito (comments disabled, optimized load)");if(d("Initializing Engine..."),m[3]&&m[3].trim()){let c=document.createElement("script");c.textContent=m[3],c.setAttribute("data-unvired-script","less"),document.head.appendChild(c)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){console.warn("Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),d("Initializing Components...");for(let c=6;c<m.length;c++){let w=m[c];if(w&&w.trim()){let x=document.createElement("script");x.textContent=w,x.setAttribute("data-unvired-script",`script-${c}`),document.head.appendChild(x),c%5===0&&await new Promise(I=>setTimeout(I,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,console.log("[SDK:10.6] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(c){let w=document.getElementById("unvired-more-btn"),x=document.getElementById("moreTooltip");w&&x&&!w.contains(c.target)&&!x.contains(c.target)&&(x.style.display="none")})}else if(window.__unviredSdkScriptsLoading)window.__unviredSdkScriptsLoaded||(console.warn("\u26A0\uFE0F Scripts marked as loading but not yet loaded - waiting..."),window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1);else{if(console.log("[SDK:10] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let d="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw console.error("[SDK:10.7] \u274C",d),v&&v.classList.add("hidden"),a({type:"ERROR",errorMessage:d,data:{technicalError:new Error(d),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(d)}console.log("[SDK:10] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=y,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.vobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=i,window.sendEventCallback=a,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED"};let b=o.querySelector("#form-back-btn"),S=o.querySelector("#unvired-more-btn");b&&(e.showBackButton?b.style.setProperty("display","flex","important"):b.style.setProperty("display","none","important")),S&&!e.showMoreButton&&S.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let M={};if(((te=e.environmentVariable)==null?void 0:te.length)>0)for(let d of e.environmentVariable)for(let c in d)M[c]=d[c];Object.keys(M).length>0&&(window.env=M);let E=o.querySelector("#sticky-header"),D=o.querySelector("#sticky-footer"),q=o.querySelector("#formio-wrapper"),G=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),q&&q.classList.add(`${e.mode}-mode`),E&&(E.style.display="none"),D&&(D.style.display="none")):(E&&(E.style.display="flex"),D&&(D.style.display="flex")),G&&(G.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let Y=n;if(n&&(console.log("[SDK:13] \u{1F517} Processing file IDs in submission data (fetching from IndexedDB)..."),Y=await se(n,a,i),console.log("[SDK:13] \u2705 File IDs processed \u2014 handing off to form renderer")),v){let d=v.querySelector(".sdk-loader-text");d&&(d.textContent="Initializing Form...")}return typeof window.loadTRform!="function"?(console.log("[SDK:14] \u23F3 loadTRform not ready yet \u2014 waiting for web-turbo-formio.js to signal..."),await new Promise(d=>{let c=()=>{document.removeEventListener("LoadRNformReady",c),console.log("[SDK:14] \u2705 loadTRform is now ready (LoadRNformReady event received)"),d()};document.addEventListener("LoadRNformReady",c),typeof window.loadTRform=="function"&&c()})):console.log("[SDK:14] \u2705 loadTRform already available \u2014 invoking immediately"),console.log("[SDK:14] \u{1F680} Handing off to loadTRform (web-turbo-formio.js)..."),await window.loadTRform(y,Y,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,i),be(),{sendAction:d=>{var c;d.type==="SET_IMAGE_DATA"&&((c=window.setImageData)==null||c.call(window,d.imageData,d.controlId,d.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),r=await z();t.style.display=r?"block":"none",n&&(n.style.display=r?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await ue(t),console.log("[AppDocument] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await de(t),console.log("[AppDocument] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to delete document",n),!1}};window.getAllDocuments=ce;window.hasDocuments=z;function
|
|
251
|
+
`);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,console.log("[SDK:10] \u{1F527} Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let d=c=>{if(v){let w=v.querySelector(".sdk-loader-text");w&&(w.textContent=c)}};if(d("Loading Core Components..."),m[0]&&m[0].trim()){let c=document.createElement("script");c.textContent=m[0],c.setAttribute("data-unvired-script","jquery"),document.head.appendChild(c)}if(m[4]&&m[4].trim()){let c=document.createElement("script");c.textContent=m[4],c.setAttribute("data-unvired-script","choices"),document.head.appendChild(c)}if(d("Loading Formio Library..."),m[5]&&m[5].trim()){let c=document.createElement("script");c.textContent=m[5],c.setAttribute("data-unvired-script","formio"),document.head.appendChild(c),console.log("[SDK:10.2] \u2705 Bundled Formio library injected.")}if(e.showComments){d("Loading Annotation Tools...");for(let c=1;c<=2;c++)if(m[c]&&m[c].trim()){let w=document.createElement("script");w.textContent=m[c],w.setAttribute("data-unvired-script",`recogito-${c}`),document.head.appendChild(w),await new Promise(x=>setTimeout(x,0))}}else console.log("[SDK:10.3] \u26A1 Skipping Recogito (comments disabled, optimized load)");if(d("Initializing Engine..."),m[3]&&m[3].trim()){let c=document.createElement("script");c.textContent=m[3],c.setAttribute("data-unvired-script","less"),document.head.appendChild(c)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){console.warn("Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),d("Initializing Components...");for(let c=6;c<m.length;c++){let w=m[c];if(w&&w.trim()){let x=document.createElement("script");x.textContent=w,x.setAttribute("data-unvired-script",`script-${c}`),document.head.appendChild(x),c%5===0&&await new Promise(I=>setTimeout(I,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,console.log("[SDK:10.6] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(c){let w=document.getElementById("unvired-more-btn"),x=document.getElementById("moreTooltip");w&&x&&!w.contains(c.target)&&!x.contains(c.target)&&(x.style.display="none")})}else if(window.__unviredSdkScriptsLoading)window.__unviredSdkScriptsLoaded||(console.warn("\u26A0\uFE0F Scripts marked as loading but not yet loaded - waiting..."),window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1);else{if(console.log("[SDK:10] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let d="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw console.error("[SDK:10.7] \u274C",d),v&&v.classList.add("hidden"),a({type:"ERROR",errorMessage:d,data:{technicalError:new Error(d),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(d)}console.log("[SDK:10] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=y,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.vobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=i,window.sendEventCallback=a,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED"};let b=o.querySelector("#form-back-btn"),S=o.querySelector("#unvired-more-btn");b&&(e.showBackButton?b.style.setProperty("display","flex","important"):b.style.setProperty("display","none","important")),S&&!e.showMoreButton&&S.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let M={};if(((te=e.environmentVariable)==null?void 0:te.length)>0)for(let d of e.environmentVariable)for(let c in d)M[c]=d[c];Object.keys(M).length>0&&(window.env=M);let E=o.querySelector("#sticky-header"),D=o.querySelector("#sticky-footer"),q=o.querySelector("#formio-wrapper"),G=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),q&&q.classList.add(`${e.mode}-mode`),E&&(E.style.display="none"),D&&(D.style.display="none")):(E&&(E.style.display="flex"),D&&(D.style.display="flex")),G&&(G.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let Y=n;if(n&&(console.log("[SDK:13] \u{1F517} Processing file IDs in submission data (fetching from IndexedDB)..."),Y=await se(n,a,i),console.log("[SDK:13] \u2705 File IDs processed \u2014 handing off to form renderer")),v){let d=v.querySelector(".sdk-loader-text");d&&(d.textContent="Initializing Form...")}return typeof window.loadTRform!="function"?(console.log("[SDK:14] \u23F3 loadTRform not ready yet \u2014 waiting for web-turbo-formio.js to signal..."),await new Promise(d=>{let c=()=>{document.removeEventListener("LoadRNformReady",c),console.log("[SDK:14] \u2705 loadTRform is now ready (LoadRNformReady event received)"),d()};document.addEventListener("LoadRNformReady",c),typeof window.loadTRform=="function"&&c()})):console.log("[SDK:14] \u2705 loadTRform already available \u2014 invoking immediately"),console.log("[SDK:14] \u{1F680} Handing off to loadTRform (web-turbo-formio.js)..."),await window.loadTRform(y,Y,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,i),be(),{sendAction:d=>{var c;d.type==="SET_IMAGE_DATA"&&((c=window.setImageData)==null||c.call(window,d.imageData,d.controlId,d.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),r=await z();t.style.display=r?"block":"none",n&&(n.style.display=r?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await ue(t),console.log("[AppDocument] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await de(t),console.log("[AppDocument] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return console.error("[AppDocument] \u274C Failed to delete document",n),!1}};window.getAllDocuments=ce;window.hasDocuments=z;function ve(){return"2.0.24"}function W(t){let n=typeof t=="string"?document.getElementById(t):t;n||(n=document.querySelector(".tf-formio-sdk")||document.body);let r=n.querySelectorAll("table"),o=0,e=null;return r.forEach(i=>{let s=i.getBoundingClientRect().width;s>o&&(o=s,e=i)}),{maxWidth:o,widestTable:e}}window.getMaxTableWidth=W;typeof window!="undefined"&&(window.TurboForms=window.TurboForms||{loadForms:ge,getBuildVersion:ve,getMaxTableWidth:W});return Se(Re);})();
|
package/package.json
CHANGED