SiddharthVenba commited on
Commit
73d24ca
·
verified ·
1 Parent(s): 1382f6c

fix: convert multi-line strings to template literals (JS syntax fix)

Browse files
Files changed (1) hide show
  1. js/alt_app.js +13 -9
js/alt_app.js CHANGED
@@ -22,7 +22,8 @@ let mockCases = {
22
  { id: "img_demo_3", filename: "413495119937_accident_6.jpg", blob_url: "images/demo/413495119937_accident_6.jpg" }
23
  ],
24
  analyses: [
25
- { filename: "01a252ba0708_car_8.jpg", raw_analysis: "[AI Observation]
 
26
  Vehicles Involved: 1
27
  Make/Model: 2018 Toyota Highlander (Silver SUV)
28
  License Plate: CA 8XYZ123
@@ -38,7 +39,7 @@ Tyre Condition: Front-Left (Good, 6mm tread), Front-Right (Good, 6mm tread), Rea
38
  - Airbag Deployment: Driver and Passenger front active. Clause 5B (Safety Systems) -> COVERED
39
 
40
  [Summary]
41
- Severe front-end deformation observed consistent with high-speed frontal impact. Airbags deployed. Vehicle is likely a total loss." }
42
  ],
43
  violations: [
44
  { rule_id: "SPEED-001", rule_title: "Excessive Speed", severity: "CRITICAL", confidence: 0.92, party_label: "Silver SUV", evidence_summary: "Long skid marks and severe front-end crush profile indicate speeds greater than safe for conditions." },
@@ -53,7 +54,8 @@ Severe front-end deformation observed consistent with high-speed frontal impact.
53
  { id: "img_demo_5", filename: "e05bd82a2cfa_accident_9.jpg", blob_url: "images/demo/e05bd82a2cfa_accident_9.jpg" }
54
  ],
55
  analyses: [
56
- { filename: "a358e234c528_accident_scene_2.jpg", raw_analysis: "[AI Observation]
 
57
  Vehicles Involved: 2
58
  Vehicle A Make/Model: 2020 Honda Civic (Blue Sedan)
59
  Vehicle A License Plate: TX LMN-4567
@@ -75,7 +77,7 @@ Vehicle B Tyre Condition: Rear Left Bald (<2mm tread) - Potential hazard.
75
  - Front Bumper/Grille: Moderate damage (Intensity: Medium). Commercial Clause 1A (At-fault Liability) -> SUBJECT TO 000 DEDUCTIBLE
76
 
77
  [Summary]
78
- T-bone intersection collision. Blue Sedan sustained heavy side impact; White Truck shows front-end damage." }
79
  ],
80
  violations: [
81
  { rule_id: "SIGNAL-001", rule_title: "Red Light Violation", severity: "CRITICAL", confidence: 0.95, party_label: "White Truck", evidence_summary: "Point of impact and traffic cam footage suggests White Truck entered intersection after signal turned red." },
@@ -96,7 +98,8 @@ T-bone intersection collision. Blue Sedan sustained heavy side impact; White Tru
96
  { id: "img_demo_104", filename: "car_10.jpg", blob_url: "images/demo/car_10.jpg" }
97
  ],
98
  analyses: [
99
- { filename: "car_10.jpg", raw_analysis: "[AI Observation]
 
100
  Vehicles Involved: 1
101
  Make/Model: 2022 Subaru Outback (Green)
102
  License Plate: NV 455-XYZ
@@ -112,7 +115,7 @@ Environmental factors: Wet road surface.
112
  - Tire blowout: Not Covered (Mechanical wear exculsion Clause 7)
113
 
114
  [Summary]
115
- Single vehicle incident. Vehicle appears to have suffered a front right tire blowout leading to a collision with the highway barrier." }
116
  ],
117
  violations: [
118
  { rule_id: "SPEED-002", rule_title: "Too Fast for Conditions", severity: "HIGH", confidence: 0.78, party_label: "Green Subaru", evidence_summary: "Wet road surface indicates speed should have been reduced prior to loss of control." }
@@ -125,7 +128,8 @@ Single vehicle incident. Vehicle appears to have suffered a front right tire blo
125
  { id: "img_demo_105", filename: "accident_6.jpg", blob_url: "images/demo/accident_6.jpg" }
126
  ],
127
  analyses: [
128
- { filename: "accident_6.jpg", raw_analysis: "[AI Observation]
 
129
  Vehicles Involved: 1
130
  Make/Model: 2017 Nissan Altima (Black)
131
  License Plate: NY JKL-0123
@@ -140,7 +144,7 @@ Tyre Condition: All tires adequate.
140
  - Pedestrian Injury Liability: Clause 1ABodily Injury -> COVERAGE TRIGGERED UP TO 50k LIMIT
141
 
142
  [Summary]
143
- Vehicle collided with a pedestrian on a marked crosswalk. Significant hood and windshield damage typical of a pedestrian strike at ~25-30mph." }
144
  ],
145
  violations: [
146
  { rule_id: "PEDES-003", rule_title: "Driver Failure to Stop for Pedestrian in Crosswalk", severity: "CRITICAL", confidence: 0.98, party_label: "Black Altima", evidence_summary: "Impact occurred directly on marked crosswalk paint." },
@@ -649,7 +653,7 @@ function setupZone(dzId, inId, prvId, tnId, ctId) {
649
  });
650
 
651
  fileInput.addEventListener('change', () => {
652
- handleFiles(Array.from(fileInput.files), prvId, tnId, ctId, prefix);
653
  });
654
  }
655
 
 
22
  { id: "img_demo_3", filename: "413495119937_accident_6.jpg", blob_url: "images/demo/413495119937_accident_6.jpg" }
23
  ],
24
  analyses: [
25
+ {
26
+ filename: "01a252ba0708_car_8.jpg", raw_analysis: `[AI Observation]
27
  Vehicles Involved: 1
28
  Make/Model: 2018 Toyota Highlander (Silver SUV)
29
  License Plate: CA 8XYZ123
 
39
  - Airbag Deployment: Driver and Passenger front active. Clause 5B (Safety Systems) -> COVERED
40
 
41
  [Summary]
42
+ Severe front-end deformation observed consistent with high-speed frontal impact. Airbags deployed. Vehicle is likely a total loss.` }
43
  ],
44
  violations: [
45
  { rule_id: "SPEED-001", rule_title: "Excessive Speed", severity: "CRITICAL", confidence: 0.92, party_label: "Silver SUV", evidence_summary: "Long skid marks and severe front-end crush profile indicate speeds greater than safe for conditions." },
 
54
  { id: "img_demo_5", filename: "e05bd82a2cfa_accident_9.jpg", blob_url: "images/demo/e05bd82a2cfa_accident_9.jpg" }
55
  ],
56
  analyses: [
57
+ {
58
+ filename: "a358e234c528_accident_scene_2.jpg", raw_analysis: `[AI Observation]
59
  Vehicles Involved: 2
60
  Vehicle A Make/Model: 2020 Honda Civic (Blue Sedan)
61
  Vehicle A License Plate: TX LMN-4567
 
77
  - Front Bumper/Grille: Moderate damage (Intensity: Medium). Commercial Clause 1A (At-fault Liability) -> SUBJECT TO 000 DEDUCTIBLE
78
 
79
  [Summary]
80
+ T-bone intersection collision. Blue Sedan sustained heavy side impact; White Truck shows front-end damage.` }
81
  ],
82
  violations: [
83
  { rule_id: "SIGNAL-001", rule_title: "Red Light Violation", severity: "CRITICAL", confidence: 0.95, party_label: "White Truck", evidence_summary: "Point of impact and traffic cam footage suggests White Truck entered intersection after signal turned red." },
 
98
  { id: "img_demo_104", filename: "car_10.jpg", blob_url: "images/demo/car_10.jpg" }
99
  ],
100
  analyses: [
101
+ {
102
+ filename: "car_10.jpg", raw_analysis: `[AI Observation]
103
  Vehicles Involved: 1
104
  Make/Model: 2022 Subaru Outback (Green)
105
  License Plate: NV 455-XYZ
 
115
  - Tire blowout: Not Covered (Mechanical wear exculsion Clause 7)
116
 
117
  [Summary]
118
+ Single vehicle incident. Vehicle appears to have suffered a front right tire blowout leading to a collision with the highway barrier.` }
119
  ],
120
  violations: [
121
  { rule_id: "SPEED-002", rule_title: "Too Fast for Conditions", severity: "HIGH", confidence: 0.78, party_label: "Green Subaru", evidence_summary: "Wet road surface indicates speed should have been reduced prior to loss of control." }
 
128
  { id: "img_demo_105", filename: "accident_6.jpg", blob_url: "images/demo/accident_6.jpg" }
129
  ],
130
  analyses: [
131
+ {
132
+ filename: "accident_6.jpg", raw_analysis: `[AI Observation]
133
  Vehicles Involved: 1
134
  Make/Model: 2017 Nissan Altima (Black)
135
  License Plate: NY JKL-0123
 
144
  - Pedestrian Injury Liability: Clause 1ABodily Injury -> COVERAGE TRIGGERED UP TO 50k LIMIT
145
 
146
  [Summary]
147
+ Vehicle collided with a pedestrian on a marked crosswalk. Significant hood and windshield damage typical of a pedestrian strike at ~25-30mph.` }
148
  ],
149
  violations: [
150
  { rule_id: "PEDES-003", rule_title: "Driver Failure to Stop for Pedestrian in Crosswalk", severity: "CRITICAL", confidence: 0.98, party_label: "Black Altima", evidence_summary: "Impact occurred directly on marked crosswalk paint." },
 
653
  });
654
 
655
  fileInput.addEventListener('change', () => {
656
+ handleFiles(Array.from(fileInput.files), prvId, tnId, ctId, dzId.startsWith('ins') ? 'ins' : 'le');
657
  });
658
  }
659