(function() {
  'use strict';
  
  var SORO_BLOG_TITLE = 'epicelectric1.com';
  var SORO_ARTICLES = [{"id":"63ee0d7e-169e-47c5-93a7-0b783db6ca07","title":"Generator Transfer Switch vs Interlock: Which Fits?","slug":"generator-transfer-switch-vs-interlock","excerpt":"Compare a generator transfer switch vs interlock for safe backup power. Learn costs, limits, and when a licensed electrician should install each option.","content":null,"date":"October 10, 2026","isoDate":"2026-10-10T01:24:09.42+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/1766ca52-d2f6-44f2-937f-056ff481e614.webp"},{"id":"1d99fd3e-13c2-483c-a5ac-83d3aab8d770","title":"When Should Rewiring Be Considered at Home?","slug":"when-should-rewiring-be-considered","excerpt":"Know when should rewiring be considered, the warning signs to watch for, and how a licensed electrician can plan a safe, lasting electrical upgrade today.","content":null,"date":"October 8, 2026","isoDate":"2026-10-08T01:24:47.189+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/b509606b-b6aa-4d3c-87cc-a48a415a18c9.webp"},{"id":"4bac7512-bbc0-4022-aed9-5dbbec1f541a","title":"How to Test GFCI Outlets Safely in Your Home","slug":"test-gfci-outlets-safely","excerpt":"Learn how to test GFCI outlets safely, recognize warning signs, and know when to call a licensed electrician for dependable electrical protection at home.","content":null,"date":"October 6, 2026","isoDate":"2026-10-06T01:24:02.55+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/3cba6ab8-6e17-44b1-816e-66d516ab0e0f.webp"},{"id":"11876831-b93d-45e5-b87f-df706b32d100","title":"Restaurant Electrical Capacity Guide for Owners","slug":"restaurant-electrical-capacity-guide","excerpt":"Use this restaurant electrical capacity guide to plan kitchen loads, prevent overloads, and prepare for a reliable, code-ready build-out and inspection.","content":null,"date":"October 4, 2026","isoDate":"2026-10-04T01:24:51.905+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/abb0808c-1492-4c8b-b4a5-7da8a172ab8f.webp"},{"id":"e92c536a-2180-452a-8415-f5531f288683","title":"What Causes Electrical Burning Smells at Home?","slug":"what-causes-electrical-burning-smells","excerpt":"What causes electrical burning smells? Learn the warning signs, common faults, and when to call a licensed electrician to protect your property and safety.","content":null,"date":"October 2, 2026","isoDate":"2026-10-02T01:24:54.623+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/24816204-48b3-4030-8c2a-617397be9bb5.webp"},{"id":"ce35709f-d67d-4843-b268-9b347a8e55ac","title":"EV Charging Trends 2026 for Homes and Businesses","slug":"ev-charging-trends-2026","excerpt":"EV charging trends 2026 are changing home and business power needs. Learn what to plan for, from panel capacity to smart charging and expansion options.","content":null,"date":"September 30, 2026","isoDate":"2026-09-30T01:30:41.082+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/7d1b5e25-a965-4946-beb0-d2cb3ac6c059.webp"},{"id":"e1d1bf3e-615a-4704-9e27-6f70db158f87","title":"Do I Need Surge Protection for My Home Today?","slug":"do-i-need-surge-protection","excerpt":"Do I need surge protection? Learn when whole-home protection is worth it, what it covers, and how an electrician can protect your electrical system safely.","content":null,"date":"September 28, 2026","isoDate":"2026-09-28T01:24:55.1+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/e2ee1f58-0ed5-4bc2-bde0-59697ad7af61.webp"},{"id":"f3f6e782-5cf7-4413-ac6e-8cf96d663219","title":"Do I Need a Dedicated Circuit for My Home?","slug":"do-i-need-a-dedicated-circuit","excerpt":"Do I need a dedicated circuit for an EV charger, appliance, or remodel? See the signs, capacity factors, and when a licensed electrician is needed at home.","content":null,"date":"September 26, 2026","isoDate":"2026-09-26T01:32:56.354+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/cf916da4-fd1b-4b7a-9a12-c67027ff2b72.webp"},{"id":"a152bfb4-1c82-4c7f-b6c4-10ca5f6ad2b7","title":"Best Home Surge Protectors for Lasting Safety","slug":"best-home-surge-protectors","excerpt":"Compare the best home surge protectors. Learn what whole-home protection covers, how to choose the right unit, and when to call a licensed electrician.","content":null,"date":"September 24, 2026","isoDate":"2026-09-24T01:31:34.339+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/ee515481-a25c-4b21-9e8d-6ab937f4bbf0.webp"},{"id":"31011cf2-c90a-41eb-bc17-ecbec9ea8343","title":"How to Reduce Electrical Fire Risks at Home","slug":"reduce-electrical-fire-risks","excerpt":"Learn how to reduce electrical fire risks with warning signs, safer habits, and professional upgrades for homes and local businesses in Southern California.","content":null,"date":"September 22, 2026","isoDate":"2026-09-22T01:25:04.246+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/4df3dafc-965c-4e70-879d-f9f5835038a4.webp"},{"id":"51ac89f1-2828-4fb3-8947-e522bc44689a","title":"EV Charger Reviews: What Homeowners Should Check","slug":"ev-charger-reviews-homeowners-check","excerpt":"EV charger reviews can help you compare speed, safety, smart features, and installation needs before choosing the right home charging setup properly.","content":null,"date":"September 20, 2026","isoDate":"2026-09-20T01:30:53.291+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/db3b33ea-2b28-4aa7-a916-8d20d3e07a0b.webp"},{"id":"92261d0e-7958-4b9a-8660-5f43725d9595","title":"7 Smart Panel Benefits for Southern California Homes","slug":"smart-panel-benefits-southern-california-homes","excerpt":"Learn how smart panel benefits can improve energy visibility, protect critical circuits, and prepare your Southern California home for EV charging today.","content":null,"date":"September 18, 2026","isoDate":"2026-09-18T01:32:05.241+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/c654d4c0-3aa0-477f-9bba-2faa3147b2f7.webp"},{"id":"bc64afc6-4763-4ab0-bfb6-7d7723565c38","title":"How to Plan Kitchen Remodel Wiring Safely","slug":"how-to-plan-kitchen-remodel-wiring","excerpt":"Learn how to plan kitchen remodel wiring for safe circuits, well-placed outlets, layered lighting, appliance power, and future-ready upgrades at home.","content":null,"date":"September 16, 2026","isoDate":"2026-09-16T01:32:35.012+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/fa3ffd7d-68a0-4bb6-9e0b-8faf892257dc.webp"},{"id":"50c37295-b958-482e-ba01-9cc8120e7d48","title":"Industrial Electrical Preventive Maintenance","slug":"industrial-electrical-preventive-maintenance","excerpt":"Industrial electrical preventive maintenance reduces outages, protects equipment, and helps Southern California facilities plan safer electrical work.","content":null,"date":"September 14, 2026","isoDate":"2026-09-14T01:31:31.248+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/36fa748e-dc82-4127-a2a0-5c70525dff79.webp"},{"id":"b9e2169a-7322-431f-b8ed-1bf7d15d3ea3","title":"How to Size Charger Circuits for Safe EV Charging","slug":"how-to-size-charger-circuits","excerpt":"Learn how to size charger circuits for safe, reliable EV charging, including load calculations, breaker selection, wire sizing, and panel capacity checks.","content":null,"date":"September 12, 2026","isoDate":"2026-09-12T01:22:40.465+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/2e77c992-ee0d-4784-986b-00706e571c9a.webp"},{"id":"b63d1bef-70e7-4603-b788-288e099347cb","title":"New Construction Electrical Planning Guide","slug":"new-construction-electrical-planning-guide","excerpt":"Our new construction electrical planning guide helps you plan safe power, lighting, EV charging, and smart-home wiring before all interior walls close.","content":null,"date":"September 10, 2026","isoDate":"2026-09-10T01:13:39.66+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/a51afe52-9319-47fc-bb58-76a5e0f3581e.webp"},{"id":"80b416f5-3ddf-4fe4-a47c-e8ba3ed9262f","title":"GFCI Versus AFCI Protection for Safer Homes","slug":"gfci-versus-afci-protection","excerpt":"GFCI versus AFCI protection explained: learn what each device prevents, where code requires them, and when a licensed electrician should help at home.","content":null,"date":"September 8, 2026","isoDate":"2026-09-08T01:55:03.792+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/7644e88c-4ff2-4a78-b3ba-1bbb7857cd50.webp"},{"id":"1b6714ad-5241-415f-9dd7-fa877f03244f","title":"Smart Panel Versus Traditional Panel: Which Fits?","slug":"smart-panel-versus-traditional-panel","excerpt":"Compare a smart panel versus traditional panel for EV charging, backup power, energy visibility, and reliable electrical upgrades for your property.","content":null,"date":"September 6, 2026","isoDate":"2026-09-06T01:55:01.24+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/067a07fc-6da2-45bd-b97d-3ce9ff52d902.webp"},{"id":"cab82313-2811-4716-baf7-707757de9e6b","title":"How to Troubleshoot GFCI Outlets Safely","slug":"how-to-troubleshoot-gfci-outlets","excerpt":"Learn how to troubleshoot GFCI outlets safely, spot common causes of trips, and know when a licensed electrician should inspect the circuit at home now.","content":null,"date":"September 4, 2026","isoDate":"2026-09-04T01:51:52.985+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/aff5bfa3-d216-431b-af68-c77436dd6f4b.webp"},{"id":"43a32214-7c22-465e-9881-3edef79af350","title":"Warehouse Lighting Retrofit: Plan It Right","slug":"warehouse-lighting-retrofit-plan-it-right","excerpt":"A warehouse lighting retrofit improves visibility, cuts energy costs, and supports safer operations when fixtures, controls, and wiring are planned well.","content":null,"date":"September 2, 2026","isoDate":"2026-09-02T01:54:51.619+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/75f2655f-6a34-4764-be0c-092a98b491b3.webp"},{"id":"515a790c-54ab-434c-a831-9ceb09b751ce","title":"10 Temecula Landscape Lighting Ideas That Work","slug":"temecula-landscape-lighting-ideas","excerpt":"Temecula landscape lighting ideas for safer paths, warmer patios, and curb appeal, with practical planning advice from a licensed local electrician today.","content":null,"date":"September 1, 2026","isoDate":"2026-09-01T08:45:58.619+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/13c9937d-769b-4298-8e75-d6f0877da3fc.webp"},{"id":"e2cc1d7e-5ce3-4326-9706-f965bd52542d","title":"Commercial Electrical Maintenance Planning Guide","slug":"commercial-electrical-maintenance-planning-guide","excerpt":"A commercial electrical maintenance planning guide for safer systems, fewer outages, smarter budgets, and reliable power across your property year-round.","content":null,"date":"August 31, 2026","isoDate":"2026-08-31T01:54:54.032+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/c7467074-dc82-4795-96d1-c9d7d0587d84.webp"},{"id":"5a13b690-87cb-4d37-ad7b-93d657a6bd18","title":"SPAN Drive Review: Is It Right for Your Home?","slug":"span-drive-review","excerpt":"Our SPAN Drive review explains charging speed, smart-panel integration, installation requirements, and when this Level 2 EV charger makes sense for your home today.","content":null,"date":"August 30, 2026","isoDate":"2026-08-30T08:57:55.056+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/00d617d3-0d14-469e-b894-7a8c544f88b0.webp"},{"id":"06f153fd-05b2-404d-9548-48b7e60aa53d","title":"Commercial Electrical Troubleshooting Services","slug":"commercial-electrical-troubleshooting-services","excerpt":"Commercial electrical troubleshooting services find faults early, protect equipment, and reduce costly downtime for Southern California businesses today.","content":null,"date":"August 29, 2026","isoDate":"2026-08-29T01:57:46.692+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/dfc4e6ac-a352-4c73-af4f-98473b346c2d.webp"},{"id":"2e9bf121-7ee9-4029-8c22-76b334d947aa","title":"Electrical Service Upgrade Guide for Your Property","slug":"electrical-service-upgrade-guide","excerpt":"This electrical service upgrade guide covers warning signs, sizing, permits, costs, and what to expect from a safe, code-compliant project with care.","content":null,"date":"August 28, 2026","isoDate":"2026-08-28T09:06:41.137+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/37bfa339-8bdd-48f4-97de-4f7a4ba5336d.webp"},{"id":"85566431-57ea-4e51-8520-1c8e5e091d4b","title":"Why Outlets Buzz and What That Sound Can Mean","slug":"why-outlets-buzz","excerpt":"Why outlets buzz, when the sound can signal a wiring fault, and what homeowners and property managers should do to protect their property safely, promptly.","content":null,"date":"August 27, 2026","isoDate":"2026-08-27T01:57:33.88+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/828d42cb-7fa1-4092-9908-d84cdfce62f8.webp"},{"id":"c0f9dcfa-fe94-4af9-80af-0cf706c209bd","title":"Are Aluminum Wires Safe in California Homes?","slug":"are-aluminum-wires-safe-california-homes","excerpt":"Are aluminum wires safe? Learn where the risks come from, which warning signs matter, and when a licensed electrician should inspect or upgrade wiring.","content":null,"date":"August 26, 2026","isoDate":"2026-08-26T09:18:36.556+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/009e5f93-e780-4d54-8d75-702ad24bbee9.webp"},{"id":"63df0428-7f7c-4559-9fb7-d2dc1dcf2c63","title":"SPAN Panel Review: Is This Upgrade Worth It?","slug":"span-panel-review","excerpt":"SPAN panel review: smart electrical monitoring, installation needs, costs, limits, and when this upgrade makes sense for Southern California homes today.","content":null,"date":"August 25, 2026","isoDate":"2026-08-25T01:54:41.145+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/8ff7cbba-82c4-4362-9965-ca79a4b2f511.webp"},{"id":"021bdae2-d667-4a57-aade-760f91c5a063","title":"When Are Permits Required for Electrical Work?","slug":"when-are-permits-required-electrical-work","excerpt":"Learn when are permits required for electrical work in Southern California, including panel upgrades, EV chargers, remodels, and safe inspections today.","content":null,"date":"August 24, 2026","isoDate":"2026-08-24T09:27:30.581+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/9c9ed7ef-4adb-4561-b574-fb044a5a3c77.webp"},{"id":"e18eacdd-32d9-4293-93c9-f2a7f2087f93","title":"Why Are Lights Dimming Suddenly? What to Check","slug":"why-are-lights-dimming-suddenly","excerpt":"Why are lights dimming suddenly? Learn the common causes, warning signs, and safe next steps to protect your home or business electrical system today.","content":null,"date":"August 23, 2026","isoDate":"2026-08-23T01:54:32.977+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/workflows/7f7c0a42-bdf2-4968-ba4f-27741d733667.webp"},{"id":"fbb6d6dc-0aa3-4c5a-8ad6-105943b0e197","title":"Manufacturing Power Upgrade: Plan for Growth","slug":"manufacturing-power-upgrade","excerpt":"A manufacturing power upgrade can reduce downtime, support new equipment, and improve safety. Learn how to plan capacity, timing, and compliance with care.","content":null,"date":"August 21, 2026","isoDate":"2026-08-21T01:58:01.675+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/fbb6d6dc-0aa3-4c5a-8ad6-105943b0e197.webp"},{"id":"9cd37bbe-b991-4b1e-a54a-13ce87342da7","title":"Load Calculations for a Safer Electrical Panel","slug":"load-calculations-electrical-panel","excerpt":"Accurate load calculations show whether your panel can safely support an EV charger, remodel, or new equipment before any work begins at your home today.","content":null,"date":"August 19, 2026","isoDate":"2026-08-19T05:18:32.575+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/9cd37bbe-b991-4b1e-a54a-13ce87342da7.webp"},{"id":"41fe1a40-1703-45b7-9dd8-ceccf3e60710","title":"Best Electric Vehicle Chargers for Your Property","slug":"best-electric-vehicle-chargers","excerpt":"Compare the best electric vehicle chargers for homes and businesses, from power and smart features to panel capacity and safe installation and cost tips.","content":null,"date":"August 18, 2026","isoDate":"2026-08-18T09:21:56.628+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/41fe1a40-1703-45b7-9dd8-ceccf3e60710.webp"},{"id":"583306da-878e-49ac-a893-ea9ca1c5c9a9","title":"Electrical Inspections That Prevent Costly Surprises","slug":"electrical-inspections-prevent-costly-surprises","excerpt":"Electrical inspections help Murrieta and Temecula property owners identify safety risks, code issues, and capacity limits before they cause costly trouble.","content":null,"date":"August 17, 2026","isoDate":"2026-08-17T05:27:50.117+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/583306da-878e-49ac-a893-ea9ca1c5c9a9.webp"},{"id":"594d2312-c2f7-451d-a01b-682c5b5f6453","title":"Murrieta EV Circuit Sizing for Safe Home Charging","slug":"murrieta-ev-circuit-sizing","excerpt":"Get Murrieta EV circuit sizing right with a load calculation, proper breaker and wire selection, and a plan for safe, dependable home charging every day.","content":null,"date":"August 15, 2026","isoDate":"2026-08-15T07:43:01.2+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/594d2312-c2f7-451d-a01b-682c5b5f6453.webp"},{"id":"c06ba8da-0c05-4ba8-8c4d-28ce605d13c2","title":"Why Outlets Feel Warm and When You Should Worry","slug":"why-outlets-feel-warm","excerpt":"Why outlets feel warm: learn what heat can signal, when to stop using the circuit, and when a licensed electrician should inspect the problem safely today.","content":null,"date":"August 13, 2026","isoDate":"2026-08-13T05:36:26.289+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/c06ba8da-0c05-4ba8-8c4d-28ce605d13c2.webp"},{"id":"f4e11842-240a-40cd-b6b6-bba5443586ce","title":"Breaker Box Buzzing? What It Means and What to Do","slug":"breaker-box-buzzing","excerpt":"A breaker box buzzing can signal a loose connection, overload, or failing breaker. Learn when to shut off power and call a licensed electrician promptly.","content":null,"date":"August 11, 2026","isoDate":"2026-08-11T05:42:34.802+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/f4e11842-240a-40cd-b6b6-bba5443586ce.webp"},{"id":"43206ea9-9c3e-4333-bd2f-6cfa145c0b3e","title":"Main Panel vs Subpanel - Which Do You Need?","slug":"main-panel-vs-subpanel","excerpt":"Understand main panel vs subpanel differences, capacity, cost factors, and when a licensed electrician should upgrade your electrical system correctly.","content":null,"date":"August 9, 2026","isoDate":"2026-08-09T05:57:20.038+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/43206ea9-9c3e-4333-bd2f-6cfa145c0b3e.webp"},{"id":"599865d0-9b9c-4946-a995-6e976fd3b759","title":"Copper Wiring vs Aluminum Wiring: What to Know","slug":"copper-wiring-vs-aluminum-wiring","excerpt":"Compare copper wiring vs aluminum wiring for safety, cost, and performance. Learn when an electrical upgrade or inspection makes sense for your property.","content":null,"date":"August 7, 2026","isoDate":"2026-08-07T06:19:03.988+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/075b2dc4-6872-4a3c-a431-925617eb2b36/599865d0-9b9c-4946-a995-6e976fd3b759.webp"},{"id":"44f837cf-4e19-4317-aab8-571993c03731","title":"ChargePoint Home Charger Review - Worth It?","slug":"chargepoint-home-charger-review","excerpt":"Our ChargePoint home charger review covers charging speed, app features, electrical requirements, and when professional installation makes sense for EV owners.","content":null,"date":"August 5, 2026","isoDate":"2026-08-05T06:21:33.314+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/44f837cf-4e19-4317-aab8-571993c03731.webp"},{"id":"b4131174-f9cd-48ef-bb1a-677b138202da","title":"When Should a House Be Rewired? Key Warning Signs","slug":"when-should-a-house-be-rewired","excerpt":"Learn when should a house be rewired, the warning signs to watch for, and how a professional inspection protects your Southern California home for years.","content":null,"date":"August 3, 2026","isoDate":"2026-08-03T05:51:19.671+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/b4131174-f9cd-48ef-bb1a-677b138202da.webp"},{"id":"dfcc6b88-6ac2-4b94-a0d8-0ee9472e60ca","title":"How to Prepare for Panel Replacement Safely","slug":"how-to-prepare-for-panel-replacement","excerpt":"Learn how to prepare for panel replacement, protect your property, plan for an outage, and make a safer electrical upgrade with less disruption at home.","content":null,"date":"August 1, 2026","isoDate":"2026-08-01T06:36:21.25+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/dfcc6b88-6ac2-4b94-a0d8-0ee9472e60ca.webp"},{"id":"c3d83ffd-1131-45b9-a61c-8b74c43e4005","title":"200 Amp vs 400 Amp Service - Which Fits?","slug":"200-amp-vs-400-amp-service","excerpt":"Compare 200 amp vs 400 amp service for homes and businesses. Learn when a panel upgrade makes sense for EV charging, additions, and future capacity needs.","content":null,"date":"July 30, 2026","isoDate":"2026-07-30T06:46:04.474+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/c3d83ffd-1131-45b9-a61c-8b74c43e4005.webp"},{"id":"db1839f3-6b5b-4be5-a44e-10b6c72d04b0","title":"What Causes Outlets to Stop Working at Home?","slug":"what-causes-outlets-to-stop-working","excerpt":"Learn what causes outlets to stop working, the warning signs that require an electrician, and how to restore safe, reliable power at your property today.","content":null,"date":"July 28, 2026","isoDate":"2026-07-28T06:48:18.883+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/db1839f3-6b5b-4be5-a44e-10b6c72d04b0.webp"},{"id":"35e3ba23-4a4d-442e-814d-e4fa4ce6c0ca","title":"Why Does My Breaker Keep Tripping at Home?","slug":"why-does-my-breaker-keep-tripping","excerpt":"Why does my breaker keep tripping? Learn common causes, safe first steps, and when to call a licensed electrician for a lasting repair in Temecula homes.","content":null,"date":"July 26, 2026","isoDate":"2026-07-26T06:12:37.486+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/35e3ba23-4a4d-442e-814d-e4fa4ce6c0ca.webp"},{"id":"d78c81a1-0ec0-4f99-99b3-8bd04bc0522f","title":"EV Charger Hardwired vs Plug In: Which Fits?","slug":"ev-charger-hardwired-vs-plug-in","excerpt":"Compare EV charger hardwired vs plug in options for safety, cost, speed, and flexibility before installing a home charger in Southern California homes.","content":null,"date":"July 24, 2026","isoDate":"2026-07-24T06:24:56.937+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/d78c81a1-0ec0-4f99-99b3-8bd04bc0522f.webp"},{"id":"44657cd9-d120-4e5c-b763-7c280cf2ccf4","title":"7 Best Electrical Upgrades Before Remodeling","slug":"best-electrical-upgrades-before-remodeling","excerpt":"Get the best electrical upgrades before remodeling right, including panel capacity, lighting, wiring, EV charging, and smart home planning for your home.","content":null,"date":"July 23, 2026","isoDate":"2026-07-23T07:54:35.553+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/44657cd9-d120-4e5c-b763-7c280cf2ccf4.webp"},{"id":"855ac3a3-b07c-483b-87df-f433c1e703c3","title":"Whole House Rewiring Checklist for Safer Homes","slug":"whole-house-rewiring-checklist","excerpt":"Use this whole house rewiring checklist to plan a safer, code-compliant electrical upgrade, control project scope, and prepare your home for power needs.","content":null,"date":"July 22, 2026","isoDate":"2026-07-22T05:24:11.597+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/855ac3a3-b07c-483b-87df-f433c1e703c3.webp"},{"id":"7e9a0b60-8483-44c6-822b-be505806106e","title":"How to Install Under Cabinet Lighting Safely","slug":"install-under-cabinet-lighting","excerpt":"Learn how to install under cabinet lighting safely, choose the right fixture, plan wiring, and get a clean, code-conscious finish for your kitchen today.","content":null,"date":"July 21, 2026","isoDate":"2026-07-21T08:09:20.464+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/7e9a0b60-8483-44c6-822b-be505806106e.webp"},{"id":"07fa26d5-4234-423c-bb83-4f887f2df3c7","title":"Best Garage EV Charger Setups for Your Home","slug":"best-garage-ev-charger-setups","excerpt":"Compare the best garage EV charger setups for Southern California homes, from charger placement and circuit size to panels, permits, and smart features.","content":null,"date":"July 20, 2026","isoDate":"2026-07-20T04:18:43.671+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/07fa26d5-4234-423c-bb83-4f887f2df3c7.webp"},{"id":"afe8c5da-2afb-4eb9-a811-5a739eda3075","title":"How to Label Breakers Properly and Safely","slug":"how-to-label-breakers-properly","excerpt":"Learn how to label breakers properly with clear, durable panel labels that make outages, repairs, and emergencies safer for your property at home or work.","content":null,"date":"July 19, 2026","isoDate":"2026-07-19T08:21:43.152+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/afe8c5da-2afb-4eb9-a811-5a739eda3075.webp"},{"id":"043859df-3cdb-467e-9b86-edc4d3c35b33","title":"Residential EV Charging Installation Guide","slug":"residential-ev-charging-installation-guide","excerpt":"Use this residential EV charging installation guide to plan a safe home charger, assess panel capacity, obtain permits, and prepare for onsite inspection.","content":null,"date":"July 18, 2026","isoDate":"2026-07-18T03:39:43.155+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/043859df-3cdb-467e-9b86-edc4d3c35b33.webp"},{"id":"905f852b-b8b0-4eee-a5af-443e0d562adf","title":"How to Troubleshoot Tripping Breakers Safely","slug":"how-to-troubleshoot-tripping-breakers","excerpt":"Learn how to troubleshoot tripping breakers safely, spot overloads and faults, and know when a licensed electrician should inspect your panel too today.","content":null,"date":"July 16, 2026","isoDate":"2026-07-16T05:57:06.777+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/905f852b-b8b0-4eee-a5af-443e0d562adf.webp"},{"id":"71b34cc5-7910-4511-ba34-6204fb92ff4a","title":"How to Fix Flickering Lights Safely at Home","slug":"fix-flickering-lights-safely","excerpt":"Learn how to fix flickering lights safely, spot urgent electrical warning signs, and know when a licensed electrician should inspect your home promptly.","content":null,"date":"July 14, 2026","isoDate":"2026-07-14T04:42:35.181+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/71b34cc5-7910-4511-ba34-6204fb92ff4a.webp"},{"id":"7a84dda7-1620-4252-9ca0-79fc14f8b46b","title":"How to Choose EV Charger Amperage Safely","slug":"how-to-choose-ev-charger-amperage","excerpt":"Learn how to choose EV charger amperage for your home, panel capacity, driving needs, and future plans with practical advice from a licensed electrician.","content":null,"date":"July 12, 2026","isoDate":"2026-07-12T02:06:26.25+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/7a84dda7-1620-4252-9ca0-79fc14f8b46b.webp"},{"id":"34d1f2df-44d8-445b-9378-a93aba49656a","title":"10 Top Signs of Unsafe Wiring at Home","slug":"top-signs-of-unsafe-wiring","excerpt":"Learn the top signs of unsafe wiring, from flickering lights to burning smells, and when to call a licensed electrician before hazards worsen.","content":null,"date":"July 10, 2026","isoDate":"2026-07-10T02:30:19.278+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/34d1f2df-44d8-445b-9378-a93aba49656a.webp"},{"id":"c9b8363b-5c07-4936-a47e-7781339c49cb","title":"Home EV Charger Permit Process Explained","slug":"home-ev-charger-permit-process","excerpt":"Learn the home EV charger permit process, what inspectors look for, common delays, and how to get your charger installed safely and up to code.","content":null,"date":"July 8, 2026","isoDate":"2026-07-08T04:30:30.236+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/c9b8363b-5c07-4936-a47e-7781339c49cb.webp"},{"id":"cde97665-858f-40e5-b77d-14da6cba09aa","title":"How to Choose a Local Electrician","slug":"how-to-choose-a-local-electrician","excerpt":"Need a local electrician? Learn how to compare licensing, response time, pricing, and modern expertise before you book electrical work.","content":null,"date":"July 7, 2026","isoDate":"2026-07-07T06:03:20.511+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/cde97665-858f-40e5-b77d-14da6cba09aa.webp"},{"id":"51dd40aa-302a-48dd-8c48-b5ea7dac4f97","title":"Smart Home Electrician Installation Done Right","slug":"smart-home-electrician-installation","excerpt":"Smart home electrician installation adds safety, control, and value - but only when wiring, panels, and devices are planned correctly.","content":null,"date":"July 6, 2026","isoDate":"2026-07-06T06:06:50.388+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/51dd40aa-302a-48dd-8c48-b5ea7dac4f97.webp"},{"id":"caf8d105-35e5-4e58-b976-d0891316ad9a","title":"Electrical Inspection for Home Purchase","slug":"electrical-inspection-for-home-purchase","excerpt":"Electrical inspection for home purchase helps uncover safety issues, hidden repair costs, and upgrade needs before you close on a house.","content":null,"date":"July 5, 2026","isoDate":"2026-07-05T06:09:50.461+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/caf8d105-35e5-4e58-b976-d0891316ad9a.webp"},{"id":"ad50530e-58bb-4c9f-b64c-dce889476d7b","title":"When Wiring and Rewiring Services Make Sense","slug":"when-wiring-and-rewiring-services-make-sense","excerpt":"Learn when wiring and rewiring services are needed, what signs to watch for, and how safe electrical upgrades protect homes and businesses.","content":null,"date":"July 4, 2026","isoDate":"2026-07-04T06:18:23.974+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/ad50530e-58bb-4c9f-b64c-dce889476d7b.webp"},{"id":"8851a53f-36ec-4d68-a338-5100be60a564","title":"How Often Should You Upgrade Your Electrical Panel?","slug":"how-often-should-you-upgrade-your-electrical-panel","excerpt":"Learn how often should you upgrade your electrical panel, the warning signs to watch for, and when age, load, or remodel plans make an upgrade smart.","content":null,"date":"July 3, 2026","isoDate":"2026-07-03T06:18:24.57+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/8851a53f-36ec-4d68-a338-5100be60a564.webp"},{"id":"7f507871-b575-4e75-abcd-3eac2f3522fe","title":"How Much Does It Cost to Upgrade Breaker Panel?","slug":"how-much-does-it-cost-to-upgrade-breaker-panel","excerpt":"How much does it cost to upgrade breaker panel service? Learn typical price ranges, what affects cost, and when an upgrade is worth it.","content":null,"date":"July 2, 2026","isoDate":"2026-07-02T06:27:37.414+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/7f507871-b575-4e75-abcd-3eac2f3522fe.webp"},{"id":"5cc6c18f-5c10-4535-aa1f-31e84ba32893","title":"What Do I Need to Do to Upgrade My Electrical Panel?","slug":"what-do-i-need-to-do-to-upgrade-my-electrical-panel","excerpt":"What do I need to do to upgrade my electrical panel? Learn permits, sizing, costs, utility coordination, and when a panel upgrade makes sense.","content":null,"date":"July 1, 2026","isoDate":"2026-07-01T06:30:56.534+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/5cc6c18f-5c10-4535-aa1f-31e84ba32893.webp"},{"id":"6bde75bf-bac9-4a4f-b1d6-81472d2035d3","title":"When to Book Electrical Panel Upgrade Service","slug":"when-to-book-electrical-panel-upgrade-service","excerpt":"Learn when electrical panel upgrade service makes sense, what signs to watch for, and how a safer, higher-capacity panel supports modern power needs.","content":null,"date":"June 30, 2026","isoDate":"2026-06-30T06:39:52.837+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/6bde75bf-bac9-4a4f-b1d6-81472d2035d3.webp"},{"id":"f94908f2-ddd5-4d6e-8c81-0a0734899273","title":"What Is the Cheapest EV Charger Installation?","slug":"what-is-the-cheapest-ev-charger-installation","excerpt":"What is the cheapest EV charger installation? Learn the lowest-cost setup, what affects price, and when the cheapest option can cost more later.","content":null,"date":"June 29, 2026","isoDate":"2026-06-29T06:45:22.252+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/f94908f2-ddd5-4d6e-8c81-0a0734899273.webp"},{"id":"976db56d-056a-4aa9-9b1e-17fa398fee86","title":"How to Install EV Charger at Home","slug":"how-to-install-ev-charger-at-home","excerpt":"Learn how to install EV charger equipment at home safely, from panel checks to permits, wiring, breaker sizing, and final testing.","content":null,"date":"June 28, 2026","isoDate":"2026-06-28T06:51:21.932+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/976db56d-056a-4aa9-9b1e-17fa398fee86.webp"},{"id":"9a5657a2-afe7-46c8-9dfa-f058243a6d7c","title":"EV Fast Charger Installation Cost Explained","slug":"ev-fast-charger-installation-cost","excerpt":"Learn what affects ev fast charger installation cost, from panel upgrades to permits, and what homeowners and businesses should expect to pay.","content":null,"date":"June 27, 2026","isoDate":"2026-06-27T06:57:21.859+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/9a5657a2-afe7-46c8-9dfa-f058243a6d7c.webp"},{"id":"29be2bf3-646c-41bc-89b6-04738abb5bde","title":"How Much Does It Cost to Install an EV Charger?","slug":"how-much-does-it-cost-to-install-an-ev-charger","excerpt":"How much does it cost to install a ev charger at home? See real price ranges, what raises costs, and when panel upgrades may be needed.","content":null,"date":"June 26, 2026","isoDate":"2026-06-26T07:03:05.536+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/29be2bf3-646c-41bc-89b6-04738abb5bde.webp"},{"id":"9ed00345-e2d2-45e9-ac1e-8fc94a8212f7","title":"Can Electrician Install EV Charger?","slug":"can-electrician-install-ev-charger","excerpt":"Can electrician install EV charger? Yes - if licensed and qualified. Learn what to check for safe, code-compliant home or commercial setup.","content":null,"date":"June 25, 2026","isoDate":"2026-06-25T07:06:25.752+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/9ed00345-e2d2-45e9-ac1e-8fc94a8212f7.webp"},{"id":"6ddbc927-6912-4008-8997-283f2c3f2ce2","title":"EV Charger Installation Tax Credit Explained","slug":"ev-charger-installation-tax-credit-explained","excerpt":"Learn how the ev charger installation tax credit works, who may qualify, what costs count, and when to talk to a licensed electrician.","content":null,"date":"June 24, 2026","isoDate":"2026-06-24T07:12:29.252+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/6ddbc927-6912-4008-8997-283f2c3f2ce2.webp"},{"id":"1d71a127-f079-4fd8-b4be-e4e4770d3119","title":"EV Charger Installation Requirements","slug":"ev-charger-installation-requirements","excerpt":"Learn the key ev charger installation requirements for homes and businesses, from panel capacity and permits to placement, wiring, and safety.","content":null,"date":"June 23, 2026","isoDate":"2026-06-23T16:27:28.853+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/38ef82e3-3746-4cb2-87f9-ae38c4f109d9/1d71a127-f079-4fd8-b4be-e4e4770d3119.webp"}];
  var SORO_TOKEN = 'ae48cfc5-688b-411e-bd26-3185798ae9be';
  var SORO_API_BASE = 'https://app.trysoro.com';
  var SORO_T = {"allArticles":"All Articles","backToAll":"Back to all articles","loading":"Loading article...","error":"Failed to load article. Please try again.","empty":"Published articles may take up to 60 minutes to appear here.","blogArticles":"Blog articles"};
  
  // Content cache (loaded on demand)
  var contentCache = {};
  
  // Pre-populate cache with any server-included content (for SEO deep links)
  SORO_ARTICLES.forEach(function(article) {
    if (article.content) {
      contentCache[article.id] = article.content;
    }
  });
  
  // Find the container
  var container = document.getElementById('soro-blog');
  if (!container) {
    console.error('Soro Blog: No element with id="soro-blog" found');
    return;
  }
  
  // Save the original page title so we can restore it
  var originalTitle = document.title;
  var originalDescription = '';
  var descMeta = document.querySelector('meta[name="description"]');
  if (descMeta) originalDescription = descMeta.getAttribute('content') || '';
  
  // Detect if running inside a srcdoc iframe (website builders like GoDaddy, Wix, etc.)
  var isSrcdocIframe = false;
  var parentBaseUrl = null;
  try {
    isSrcdocIframe = window.location.href === 'about:srcdoc' || 
                     window.location.pathname === '/srcdoc' ||
                     (window.self !== window.top && window.location.origin === 'null');
  } catch(e) {
    isSrcdocIframe = true; // cross-origin means we're in an iframe
  }
  
  // Try to get the parent page URL for building article links
  if (isSrcdocIframe) {
    try {
      var pUrl = new URL(window.parent.location.href);
      pUrl.searchParams.delete('post');
      parentBaseUrl = pUrl.origin + pUrl.pathname + pUrl.search;
    } catch(e) {
      parentBaseUrl = null;
    }
  }
  
  // Detect deep-linked article from URL query param: ?post=slug
  function getRequestedSlug() {
    try {
      if (isSrcdocIframe) {
        // In srcdoc iframe, check parent URL if accessible
        try {
          var params = new URLSearchParams(window.parent.location.search);
          return params.get('post') || null;
        } catch(e) {
          return null;
        }
      }
      var params = new URLSearchParams(window.location.search);
      return params.get('post') || null;
    } catch(e) {
      return null;
    }
  }
  
  // Build article URL with query param (preserves existing params)
  function getArticleUrl(slug) {
    try {
      if (isSrcdocIframe && parentBaseUrl) {
        // Build full parent page URL with ?post= param so new tab works
        var sep = parentBaseUrl.indexOf('?') !== -1 ? '&' : '?';
        return parentBaseUrl + sep + 'post=' + encodeURIComponent(slug);
      }
      if (isSrcdocIframe) {
        return '#post=' + encodeURIComponent(slug);
      }
      var url = new URL(window.location.href);
      url.searchParams.set('post', slug);
      return url.pathname + url.search;
    } catch(e) {
      return '#post=' + encodeURIComponent(slug);
    }
  }
  
  // Get the base list URL (current page without post param)
  function getListUrl() {
    try {
      if (isSrcdocIframe && parentBaseUrl) {
        return parentBaseUrl;
      }
      if (isSrcdocIframe) {
        return '#';
      }
      var url = new URL(window.location.href);
      url.searchParams.delete('post');
      var search = url.search;
      return url.pathname + (search ? search : '');
    } catch(e) {
      return window.location.pathname;
    }
  }
  
  // Safe pushState wrapper (fails silently in srcdoc iframes)
  function safePushState(state, title, url) {
    if (isSrcdocIframe) return;
    try {
      history.pushState(state, title, url);
    } catch(e) {
      // pushState not available (srcdoc iframe, cross-origin, etc.)
    }
  }
  
  // Update page meta tags for SEO (title, description, canonical, JSON-LD)
  // Skip in srcdoc iframes since we can't meaningfully update the parent page
  function updatePageMeta(article) {
    if (isSrcdocIframe) return;
    if (article) {
      // Article view: set article-specific meta
      document.title = article.title + ' | ' + SORO_BLOG_TITLE;
      
      var desc = document.querySelector('meta[name="description"]');
      if (!desc) {
        desc = document.createElement('meta');
        desc.setAttribute('name', 'description');
        document.head.appendChild(desc);
      }
      desc.setAttribute('content', article.excerpt);
      
      // Set canonical URL to the article deep link
      var canonical = document.querySelector('link[rel="canonical"][data-soro]');
      if (!canonical) {
        canonical = document.createElement('link');
        canonical.setAttribute('rel', 'canonical');
        canonical.setAttribute('data-soro', 'true');
        document.head.appendChild(canonical);
      }
      canonical.setAttribute('href', window.location.href);
      
      // JSON-LD: single BlogPosting
      injectJsonLd({
        '@context': 'https://schema.org',
        '@type': 'BlogPosting',
        'headline': article.title,
        'description': article.excerpt,
        'datePublished': article.isoDate,
        'image': article.image || undefined,
        'url': window.location.href
      });
    } else {
      // List view: restore original meta
      document.title = originalTitle;
      
      var desc = document.querySelector('meta[name="description"]');
      if (desc && originalDescription) {
        desc.setAttribute('content', originalDescription);
      }
      
      // Remove soro canonical
      var canonical = document.querySelector('link[rel="canonical"][data-soro]');
      if (canonical) canonical.remove();
      
      // JSON-LD: Blog with all articles
      var blogPosting = SORO_ARTICLES.map(function(a) {
        var item = {
          '@type': 'BlogPosting',
          'headline': a.title,
          'description': a.excerpt,
          'datePublished': a.isoDate,
          'url': window.location.origin + getArticleUrl(a.slug)
        };
        if (a.image) item.image = a.image;
        return item;
      });
      
      injectJsonLd({
        '@context': 'https://schema.org',
        '@type': 'Blog',
        'name': SORO_BLOG_TITLE,
        'blogPost': blogPosting
      });
    }
  }
  
  // Inject styles
  var styleId = 'soro-blog-styles-light';
  if (!document.getElementById(styleId)) {
    var style = document.createElement('style');
    style.id = styleId;
    style.textContent = `
      .soro-blog {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
        max-width: 800px;
        margin: 0 auto;
        color: #1a1a1a;
        background: transparent;
      }
      .soro-blog * {
        box-sizing: border-box;
      }
      .soro-blog a {
        text-decoration: none;
        color: inherit;
      }
      .soro-blog-header {
        display: none;
        align-items: center;
        margin-bottom: 16px;
      }
      .soro-blog-back {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: transparent;
        border: 1px solid #e5e5e5;
        color: #666;
        cursor: pointer;
        font-size: 14px;
        padding: 8px 16px;
        border-radius: 6px;
        transition: background 0.2s, border-color 0.2s;
        text-decoration: none;
      }
      .soro-blog-back:hover {
        background: #f5f5f5;
        border-color: #d0d0d0;
      }
      .soro-blog-list {
        display: flex;
        flex-direction: column;
        gap: 24px;
      }
      .soro-blog-card {
        display: flex;
        gap: 20px;
        padding: 20px;
        background: transparent;
        border: 1px solid #e5e5e5;
        border-radius: 12px;
        cursor: pointer;
        transition: box-shadow 0.2s, border-color 0.2s;
        text-decoration: none;
        color: inherit;
      }
      .soro-blog-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        border-color: #d0d0d0;
      }
      .soro-blog-card-image {
        width: 140px;
        height: 100px;
        object-fit: cover;
        border-radius: 8px;
        flex-shrink: 0;
      }
      .soro-blog-card-content {
        flex: 1;
        min-width: 0;
      }
      .soro-blog-card-title {
        font-size: 18px;
        font-weight: 600;
        margin: 0 0 8px 0;
        line-height: 1.3;
        color: #1a1a1a;
      }
      h2.soro-blog-card-title {
        font-size: 18px;
      }
      .soro-blog-card-excerpt {
        font-size: 14px;
        color: #666;
        margin: 0 0 12px 0;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }
      .soro-blog-card-date {
        font-size: 12px;
        color: #999;
      }
      .soro-blog-article {
        display: none;
      }
      .soro-blog-article.visible {
        display: block;
      }
      .soro-blog-article-title {
        font-size: 32px;
        font-weight: 700;
        margin: 0 0 12px 0;
        line-height: 1.2;
        color: #1a1a1a;
      }
      .soro-blog-article-date {
        font-size: 14px;
        color: #666;
        margin-bottom: 24px;
      }
      .soro-blog-article-image {
        width: 100%;
        max-height: 400px;
        object-fit: cover;
        border-radius: 12px;
        margin-bottom: 24px;
      }
      .soro-blog-article-content {
        font-size: 16px;
        line-height: 1.7;
        color: #1a1a1a;
      }
      .soro-blog-article-content h1,
      .soro-blog-article-content h2,
      .soro-blog-article-content h3 {
        margin-top: 32px;
        margin-bottom: 16px;
        line-height: 1.3;
        color: #1a1a1a;
      }
      .soro-blog-article-content h2 {
        font-size: 24px;
      }
      .soro-blog-article-content h3 {
        font-size: 20px;
      }
      .soro-blog-article-content p {
        margin: 0 0 16px 0;
      }
      .soro-blog-article-content ul,
      .soro-blog-article-content ol {
        margin: 0 0 16px 0;
        padding-left: 24px;
        padding-right: 0;
      }
      .soro-blog-article-content li {
        margin-bottom: 8px;
      }
      .soro-blog-article-content a {
        color: #0066cc;
      }
      .soro-blog-article-content img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
      }
      .soro-blog-empty {
        text-align: center;
        padding: 48px 24px;
        color: #666;
      }
      .soro-blog-loading {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 48px 24px;
        color: #666;
      }
      .soro-blog-spinner {
        width: 24px;
        height: 24px;
        border: 2px solid #e5e5e5;
        border-top-color: #1a1a1a;
        border-radius: 50%;
        animation: soro-spin 0.8s linear infinite;
        margin-right: 12px;
      }
      @keyframes soro-spin {
        to { transform: rotate(360deg); }
      }
      .soro-blog-error {
        text-align: center;
        padding: 48px 24px;
        color: #dc2626;
      }
      @media (max-width: 600px) {
        .soro-blog-card {
          flex-direction: column;
          gap: 12px;
        }
        .soro-blog-card-image {
          width: 100%;
          height: 180px;
        }
        .soro-blog-article-title {
          font-size: 24px;
        }
      }
    `;
    document.head.appendChild(style);
  }
  
  // Inject or update JSON-LD structured data
  function injectJsonLd(data) {
    var jsonLdId = 'soro-blog-jsonld';
    var existing = document.getElementById(jsonLdId);
    if (existing) existing.remove();
    
    var script = document.createElement('script');
    script.id = jsonLdId;
    script.type = 'application/ld+json';
    script.textContent = JSON.stringify(data);
    document.head.appendChild(script);
  }
  
  // State
  var currentView = 'list';
  var currentArticle = null;
  var isLoading = false;
  
  // Fetch article content on demand
  function fetchArticleContent(articleId, callback) {
    // Check cache first (includes server-pre-rendered content for deep links)
    if (contentCache[articleId]) {
      callback(null, contentCache[articleId]);
      return;
    }
    
    var url = SORO_API_BASE + '/api/embed/' + SORO_TOKEN + '/article/' + articleId;
    
    fetch(url)
      .then(function(response) {
        if (!response.ok) throw new Error('Failed to load article');
        return response.json();
      })
      .then(function(data) {
        contentCache[articleId] = data.content;
        callback(null, data.content);
      })
      .catch(function(error) {
        callback(error, null);
      });
  }
  
  // Render article list — cards are real <a> links for SEO crawlability
  function renderList() {
    if (SORO_ARTICLES.length === 0) {
      return '<div class="soro-blog-empty"><p>' + SORO_T.empty + '</p></div>';
    }
    
    var html = '<section class="soro-blog-list" role="feed" aria-label="' + SORO_T.blogArticles + '">';
    SORO_ARTICLES.forEach(function(article) {
      var articleUrl = getArticleUrl(article.slug);
      var targetAttr = isSrcdocIframe ? ' target="_blank" rel="noopener"' : '';
      html += '<a href="' + articleUrl + '"' + targetAttr + ' class="soro-blog-card" data-slug="' + escapeHtml(article.slug) + '" itemscope itemtype="https://schema.org/BlogPosting">';
      if (article.image) {
        html += '<img class="soro-blog-card-image" src="' + article.image + '" alt="' + escapeHtml(article.title) + '" loading="lazy" itemprop="image">';
      }
      html += '<div class="soro-blog-card-content">';
      html += '<h2 class="soro-blog-card-title" itemprop="headline">' + escapeHtml(article.title) + '</h2>';
      html += '<p class="soro-blog-card-excerpt" itemprop="description">' + escapeHtml(article.excerpt) + '</p>';
      html += '<time class="soro-blog-card-date" datetime="' + article.isoDate + '" itemprop="datePublished">' + article.date + '</time>';
      html += '</div></a>';
    });
    html += '</section>';
    return html;
  }
  
  function renderArticle(article, content) {
    var html = '<article class="soro-blog-article visible" itemscope itemtype="https://schema.org/BlogPosting">';
    html += '<header>';
    html += '<h1 class="soro-blog-article-title" itemprop="headline">' + escapeHtml(article.title) + '</h1>';
    html += '<time class="soro-blog-article-date" datetime="' + article.isoDate + '" itemprop="datePublished">' + article.date + '</time>';
    html += '</header>';
    if (article.image) {
      html += '<img class="soro-blog-article-image" src="' + article.image + '" alt="' + escapeHtml(article.title) + '" itemprop="image">';
    }
    html += '<div class="soro-blog-article-content" itemprop="articleBody">' + content + '</div>';
    html += '</article>';
    return html;
  }
  
  function renderLoading() {
    return '<div class="soro-blog-loading"><div class="soro-blog-spinner"></div>' + SORO_T.loading + '</div>';
  }
  
  function renderError() {
    return '<div class="soro-blog-error"><p>' + SORO_T.error + '</p></div>';
  }
  
  function escapeHtml(str) {
    var div = document.createElement('div');
    div.textContent = str;
    return div.innerHTML;
  }
  
  // Make all links inside article content open in a new tab
  // This is critical for embeds running on external sites or inside iframes
  function processContentLinks(parentEl) {
    var links = parentEl.querySelectorAll('.soro-blog-article-content a');
    for (var i = 0; i < links.length; i++) {
      links[i].setAttribute('target', '_blank');
      links[i].setAttribute('rel', 'noopener noreferrer');
    }
  }
  
  // Navigate to article view (updates URL without full reload)
  function showArticle(slug) {
    var article = null;
    for (var i = 0; i < SORO_ARTICLES.length; i++) {
      if (SORO_ARTICLES[i].slug === slug) {
        article = SORO_ARTICLES[i];
        break;
      }
    }
    if (!article) {
      // Unknown slug (deleted or unpublished article) — show the list instead of a blank widget
      showList();
      return;
    }

    currentArticle = article;
    currentView = 'article';
    
    // Update URL (pushState so back button works)
    var articleUrl = getArticleUrl(slug);
    if (!isSrcdocIframe && window.location.pathname + window.location.search !== articleUrl) {
      safePushState({ post: slug }, '', articleUrl);
    }
    
    // Update page meta for SEO
    updatePageMeta(article);
    
    var header = container.querySelector('.soro-blog-header');
    var content = container.querySelector('.soro-blog-content');
    header.style.display = 'flex';
    
    // Check if content is already available (pre-rendered or cached)
    if (contentCache[article.id]) {
      content.innerHTML = renderArticle(article, contentCache[article.id]);
      processContentLinks(content);
    } else {
      // Show loading, then fetch
      isLoading = true;
      content.innerHTML = renderLoading();
      
      fetchArticleContent(article.id, function(error, articleContent) {
        isLoading = false;
        if (error) {
          content.innerHTML = renderError();
        } else {
          content.innerHTML = renderArticle(article, articleContent);
          processContentLinks(content);
        }
      });
    }
    
    container.scrollIntoView({ behavior: 'smooth', block: 'start' });
  }
  
  // Navigate to list view
  function showList() {
    currentView = 'list';
    currentArticle = null;
    isLoading = false;
    
    // Update URL
    var listUrl = getListUrl();
    if (!isSrcdocIframe && window.location.pathname + window.location.search !== listUrl) {
      safePushState({ post: null }, '', listUrl);
    }
    
    // Restore page meta
    updatePageMeta(null);
    
    var header = container.querySelector('.soro-blog-header');
    var content = container.querySelector('.soro-blog-content');
    header.style.display = 'none';
    content.innerHTML = renderList();
    
    // Intercept card link clicks
    var cards = content.querySelectorAll('.soro-blog-card');
    cards.forEach(function(card) {
      card.addEventListener('click', function(e) {
        e.preventDefault();
        var slug = card.getAttribute('data-slug');
        if (isSrcdocIframe) {
          // In srcdoc iframe, open article in a new tab with real URL
          var url = getArticleUrl(slug);
          window.open(url, '_blank');
        } else {
          showArticle(slug);
        }
      });
    });
  }
  
  // Handle browser back/forward buttons (not applicable in srcdoc iframes)
  if (!isSrcdocIframe) {
    window.addEventListener('popstate', function(e) {
      var slug = getRequestedSlug();
      if (slug) {
        showArticle(slug);
      } else {
        showList();
      }
    });
  }
  
  // Initial render
  var backArrow = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>';
  container.innerHTML = '<div class="soro-blog">' +
    '<div class="soro-blog-header" style="display: none;">' +
      '<a href="' + getListUrl() + '" class="soro-blog-back" aria-label="' + SORO_T.backToAll + '">' +
        backArrow +
        SORO_T.allArticles +
      '</a>' +
    '</div>' +
    '<div class="soro-blog-content"></div>' +
  '</div>';
  
  // Add back button handler (intercept for SPA navigation)
  container.querySelector('.soro-blog-back').addEventListener('click', function(e) {
    e.preventDefault();
    showList();
  });
  
  // Check if URL has a deep-linked article on initial load
  var initialSlug = getRequestedSlug();
  if (initialSlug) {
    showArticle(initialSlug);
  } else {
    showList();
  }
})();