@sensefolks/fastpoll 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +21 -0
  3. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  4. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  5. package/dist/cjs/index-CC5IS5t8.js +1437 -0
  6. package/dist/cjs/index-CC5IS5t8.js.map +1 -0
  7. package/dist/cjs/index-D8TNlmQq.js +201 -0
  8. package/dist/cjs/index-D8TNlmQq.js.map +1 -0
  9. package/dist/cjs/index.cjs.js +11 -0
  10. package/dist/cjs/index.cjs.js.map +1 -0
  11. package/dist/cjs/loader.cjs.js +16 -0
  12. package/dist/cjs/loader.cjs.js.map +1 -0
  13. package/dist/cjs/sf-fastpoll.cjs.entry.js +395 -0
  14. package/dist/cjs/sf-fastpoll.cjs.entry.js.map +1 -0
  15. package/dist/cjs/sf-fastpoll.cjs.js +28 -0
  16. package/dist/cjs/sf-fastpoll.cjs.js.map +1 -0
  17. package/dist/cjs/sf-fastpoll.entry.cjs.js.map +1 -0
  18. package/dist/collection/collection-manifest.json +12 -0
  19. package/dist/collection/components/sf-fastpoll/sf-fastpoll.css +76 -0
  20. package/dist/collection/components/sf-fastpoll/sf-fastpoll.js +454 -0
  21. package/dist/collection/components/sf-fastpoll/sf-fastpoll.js.map +1 -0
  22. package/dist/collection/index.js +11 -0
  23. package/dist/collection/index.js.map +1 -0
  24. package/dist/collection/utils/utils.js +189 -0
  25. package/dist/collection/utils/utils.js.map +1 -0
  26. package/dist/components/index.d.ts +33 -0
  27. package/dist/components/index.js +1427 -0
  28. package/dist/components/index.js.map +1 -0
  29. package/dist/components/sf-fastpoll.d.ts +11 -0
  30. package/dist/components/sf-fastpoll.js +425 -0
  31. package/dist/components/sf-fastpoll.js.map +1 -0
  32. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  33. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  34. package/dist/esm/index-CfdIRf0W.js +193 -0
  35. package/dist/esm/index-CfdIRf0W.js.map +1 -0
  36. package/dist/esm/index-XYfqntZe.js +1428 -0
  37. package/dist/esm/index-XYfqntZe.js.map +1 -0
  38. package/dist/esm/index.js +4 -0
  39. package/dist/esm/index.js.map +1 -0
  40. package/dist/esm/loader.js +14 -0
  41. package/dist/esm/loader.js.map +1 -0
  42. package/dist/esm/polyfills/core-js.js +11 -0
  43. package/dist/esm/polyfills/dom.js +79 -0
  44. package/dist/esm/polyfills/es5-html-element.js +1 -0
  45. package/dist/esm/polyfills/index.js +34 -0
  46. package/dist/esm/polyfills/system.js +6 -0
  47. package/dist/esm/sf-fastpoll.entry.js +393 -0
  48. package/dist/esm/sf-fastpoll.entry.js.map +1 -0
  49. package/dist/esm/sf-fastpoll.js +24 -0
  50. package/dist/esm/sf-fastpoll.js.map +1 -0
  51. package/dist/esm-es5/app-globals-DQuL1Twl.js +2 -0
  52. package/dist/esm-es5/app-globals-DQuL1Twl.js.map +1 -0
  53. package/dist/esm-es5/index-CfdIRf0W.js +2 -0
  54. package/dist/esm-es5/index-CfdIRf0W.js.map +1 -0
  55. package/dist/esm-es5/index-XYfqntZe.js +3 -0
  56. package/dist/esm-es5/index-XYfqntZe.js.map +1 -0
  57. package/dist/esm-es5/index.js +2 -0
  58. package/dist/esm-es5/index.js.map +1 -0
  59. package/dist/esm-es5/loader.js +2 -0
  60. package/dist/esm-es5/loader.js.map +1 -0
  61. package/dist/esm-es5/sf-fastpoll.entry.js +2 -0
  62. package/dist/esm-es5/sf-fastpoll.entry.js.map +1 -0
  63. package/dist/esm-es5/sf-fastpoll.js +2 -0
  64. package/dist/esm-es5/sf-fastpoll.js.map +1 -0
  65. package/dist/index.cjs.js +1 -0
  66. package/dist/index.js +1 -0
  67. package/dist/sf-fastpoll/index.esm.js +2 -0
  68. package/dist/sf-fastpoll/index.esm.js.map +1 -0
  69. package/dist/sf-fastpoll/loader.esm.js.map +1 -0
  70. package/dist/sf-fastpoll/p-1f6dca2a.system.entry.js +2 -0
  71. package/dist/sf-fastpoll/p-1f6dca2a.system.entry.js.map +1 -0
  72. package/dist/sf-fastpoll/p-4648bca3.entry.js +2 -0
  73. package/dist/sf-fastpoll/p-4648bca3.entry.js.map +1 -0
  74. package/dist/sf-fastpoll/p-BbPAtVJG.system.js +2 -0
  75. package/dist/sf-fastpoll/p-BbPAtVJG.system.js.map +1 -0
  76. package/dist/sf-fastpoll/p-C7EMppj8.system.js.map +1 -0
  77. package/dist/sf-fastpoll/p-C9ESvisV.system.js +3 -0
  78. package/dist/sf-fastpoll/p-C9ESvisV.system.js.map +1 -0
  79. package/dist/sf-fastpoll/p-CfdIRf0W.js +2 -0
  80. package/dist/sf-fastpoll/p-CfdIRf0W.js.map +1 -0
  81. package/dist/sf-fastpoll/p-CpmSDeqe.system.js +2 -0
  82. package/dist/sf-fastpoll/p-CpmSDeqe.system.js.map +1 -0
  83. package/dist/sf-fastpoll/p-DQuL1Twl.js +2 -0
  84. package/dist/sf-fastpoll/p-DQuL1Twl.js.map +1 -0
  85. package/dist/sf-fastpoll/p-JC66e5NR.system.js.map +1 -0
  86. package/dist/sf-fastpoll/p-S-cJYJS7.system.js +2 -0
  87. package/dist/sf-fastpoll/p-S-cJYJS7.system.js.map +1 -0
  88. package/dist/sf-fastpoll/p-XYfqntZe.js +3 -0
  89. package/dist/sf-fastpoll/p-XYfqntZe.js.map +1 -0
  90. package/dist/sf-fastpoll/p-zRZYYxiz.system.js +2 -0
  91. package/dist/sf-fastpoll/p-zRZYYxiz.system.js.map +1 -0
  92. package/dist/sf-fastpoll/sf-fastpoll.entry.esm.js.map +1 -0
  93. package/dist/sf-fastpoll/sf-fastpoll.esm.js +2 -0
  94. package/dist/sf-fastpoll/sf-fastpoll.esm.js.map +1 -0
  95. package/dist/sf-fastpoll/sf-fastpoll.js +127 -0
  96. package/dist/types/components/sf-fastpoll/sf-fastpoll.d.ts +77 -0
  97. package/dist/types/components.d.ts +47 -0
  98. package/dist/types/index.d.ts +11 -0
  99. package/dist/types/stencil-public-runtime.d.ts +1709 -0
  100. package/dist/types/utils/utils.d.ts +86 -0
  101. package/loader/cdn.js +2 -0
  102. package/loader/index.cjs.js +2 -0
  103. package/loader/index.d.ts +24 -0
  104. package/loader/index.es2017.js +2 -0
  105. package/loader/index.js +3 -0
  106. package/package.json +86 -0
  107. package/readme.md +239 -0
@@ -0,0 +1,2 @@
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,r){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r["throw"](t))}catch(t){o(t)}}function u(t){t.done?i(t.value):n(t.value).then(a,s)}u((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,n,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return u([t,e])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(i=0)),i)try{if(r=1,n&&(o=s[0]&2?n["return"]:s[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;if(n=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;n=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(s[0]===6&&i.label<o[1]){i.label=o[1];o=s;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(s);break}if(o[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t];n=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,i){if(i||arguments.length===2)for(var r=0,n=e.length,o;r<n;r++){if(o||!(r in e)){if(!o)o=Array.prototype.slice.call(e,0,r);o[r]=e[r]}}return t.concat(o||Array.prototype.slice.call(e))};import{r as registerInstance,E as Env,h,H as Host,g as getElement}from"./index-XYfqntZe.js";import{i as isValidKey,g as getFieldConfig,s as sanitizeInput,a as addToCommaSeparatedList,r as removeFromCommaSeparatedList,b as sanitizeByType}from"./index-CfdIRf0W.js";var sfFastpollCss=":host{display:block}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}input:focus,select:focus,button:focus{outline:2px solid #005fcc;outline-offset:2px}[aria-invalid='true']{border-color:#d32f2f}[part='error-message']{color:#d32f2f;font-size:0.875rem;margin-top:0.25rem}[part='choice-option']{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin:0.5rem 0;cursor:pointer}[part='choice-option']:hover{background-color:rgba(0, 95, 204, 0.1)}@media (prefers-contrast: high){input:focus,select:focus,button:focus{outline:3px solid}[part='error-message']{background-color:#d32f2f;color:white;padding:0.25rem}[part='choice-option']:hover{background-color:highlight;color:highlighttext}}@media (prefers-reduced-motion: reduce){*{-webkit-animation-duration:0.01ms !important;animation-duration:0.01ms !important;-webkit-animation-iteration-count:1 !important;animation-iteration-count:1 !important;-webkit-transition-duration:0.01ms !important;transition-duration:0.01ms !important}}";var SURVEY_API_ENDPOINT=Env.SURVEY_API_ENDPOINT;var RESPONSE_API_ENDPOINT=Env.RESPONSE_API_ENDPOINT;var SurveyStep;(function(t){t[t["POLL"]=0]="POLL";t[t["FOLLOW_UP"]=1]="FOLLOW_UP";t[t["RESPONDENT_DETAILS"]=2]="RESPONDENT_DETAILS";t[t["COMPLETION"]=3]="COMPLETION"})(SurveyStep||(SurveyStep={}));var SfFastpoll=function(){function t(t){registerInstance(this,t);this.completionMessage="Thank you for your response!";this.config=null;this.respondentDetails=[];this.loading=false;this.error=null;this.currentStep=SurveyStep.POLL;this.selectedChoices=[];this.selectedFollowUpChoices=[];this.userRespondentDetails={};this.submitted=false;this.announceMessage="";this.formErrors={};this.surveyStartTime=0}t.prototype.componentWillLoad=function(){if(isValidKey(this.surveyKey)){return this.fetchSurveyData()}return Promise.resolve()};t.prototype.fetchSurveyData=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i;return __generator(this,(function(r){switch(r.label){case 0:this.loading=true;this.error=null;this.surveyStartTime=Date.now();r.label=1;case 1:r.trys.push([1,4,5,6]);return[4,fetch("".concat(SURVEY_API_ENDPOINT,"/").concat(this.surveyKey))];case 2:t=r.sent();return[4,t.json()];case 3:e=r.sent();if(!e.success){throw new Error(e.message)}this.config=e.payload.config;this.respondentDetails=e.payload.respondentDetails||[];return[3,6];case 4:i=r.sent();this.error=i instanceof Error?i.message:String(i);return[3,6];case 5:this.loading=false;return[7];case 6:return[2]}}))}))};t.prototype.retryOperation=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.config)return[3,2];return[4,this.submitResponse()];case 1:t.sent();return[3,4];case 2:return[4,this.fetchSurveyData()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};t.prototype.submitResponse=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,r,n,o;return __generator(this,(function(a){switch(a.label){case 0:if(!this.config||this.submitted){return[2]}this.loading=true;this.error=null;a.label=1;case 1:a.trys.push([1,4,5,6]);t=this.surveyStartTime>0?Math.round((Date.now()-this.surveyStartTime)/1e3):0;e=this.getUserAgentInfo();i={surveyPublicKey:this.surveyKey,responseData:{selectedChoices:this.selectedChoices,selectedFollowUpChoices:this.selectedFollowUpChoices},respondentDetails:this.userRespondentDetails,userAgent:e,completionTime:t,surveyType:"fastPoll"};return[4,fetch("".concat(RESPONSE_API_ENDPOINT),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})];case 2:r=a.sent();return[4,r.json()];case 3:n=a.sent();if(!n.success){throw new Error(n.message)}this.submitted=true;this.currentStep=SurveyStep.COMPLETION;return[3,6];case 4:o=a.sent();this.error=o instanceof Error?o.message:String(o);return[3,6];case 5:this.loading=false;return[7];case 6:return[2]}}))}))};t.prototype.getUserAgentInfo=function(){var t=function(){var t;if("userAgentData"in navigator&&((t=navigator.userAgentData)===null||t===void 0?void 0:t.platform)){return navigator.userAgentData.platform}var e=navigator.userAgent;if(e.includes("Win"))return"Windows";if(e.includes("Mac"))return"macOS";if(e.includes("Linux"))return"Linux";if(e.includes("Android"))return"Android";if(e.includes("iOS"))return"iOS";return"Unknown"};return{userAgent:navigator.userAgent,language:navigator.language,platform:t(),cookieEnabled:navigator.cookieEnabled,onLine:navigator.onLine,screenResolution:"".concat(screen.width,"x").concat(screen.height),colorDepth:screen.colorDepth,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:(new Date).toISOString()}};t.prototype.nextStep=function(){if(!this.validateForm()){return}if(this.currentStep===SurveyStep.POLL){if(this.hasFollowUpStep()){this.currentStep=SurveyStep.FOLLOW_UP;this.announceToScreenReader("Moving to follow-up question")}else if(this.hasRespondentDetailsStep()){this.currentStep=SurveyStep.RESPONDENT_DETAILS;this.announceToScreenReader("Moving to respondent details")}else{this.announceToScreenReader("Submitting poll...");this.submitResponse()}}else if(this.currentStep===SurveyStep.FOLLOW_UP){if(this.hasRespondentDetailsStep()){this.currentStep=SurveyStep.RESPONDENT_DETAILS;this.announceToScreenReader("Moving to respondent details")}else{this.announceToScreenReader("Submitting poll...");this.submitResponse()}}else if(this.currentStep===SurveyStep.RESPONDENT_DETAILS){this.announceToScreenReader("Submitting poll...");this.submitResponse()}};t.prototype.prevStep=function(){if(this.currentStep===SurveyStep.FOLLOW_UP){this.currentStep=SurveyStep.POLL}else if(this.currentStep===SurveyStep.RESPONDENT_DETAILS){if(this.hasFollowUpStep()){this.currentStep=SurveyStep.FOLLOW_UP}else{this.currentStep=SurveyStep.POLL}}};t.prototype.hasFollowUpStep=function(){var t,e,i;return!!(((t=this.config)===null||t===void 0?void 0:t.followUpQuestion)&&((i=(e=this.config)===null||e===void 0?void 0:e.followUpChoices)===null||i===void 0?void 0:i.length))};t.prototype.hasRespondentDetailsStep=function(){return this.respondentDetails.length>0};t.prototype.announceToScreenReader=function(t){var e=this;this.announceMessage=t;setTimeout((function(){e.announceMessage=""}),1e3)};t.prototype.isValidEmail=function(t){var e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return e.test(t.trim())};t.prototype.validateRespondentField=function(t,e){if(t.required!==false&&(!e||e.trim().length===0)){return"This field is required"}if(e&&e.trim().length>0){var i=getFieldConfig(t,e);if(i.inputType==="email"){if(!this.isValidEmail(e)){return"Please enter a valid email address"}}}return null};t.prototype.validateForm=function(){var t={};if(this.currentStep===SurveyStep.POLL&&this.selectedChoices.length===0){t["poll"]="Please select at least one option"}if(this.currentStep===SurveyStep.FOLLOW_UP&&this.selectedFollowUpChoices.length===0){t["followup"]="Please select at least one option"}this.formErrors=t;return Object.keys(t).length===0};t.prototype.handleChoiceSelect=function(t){var e;var i=t.value;var r=((e=this.config)===null||e===void 0?void 0:e.choiceType)==="multiChoice";if(r){if(this.selectedChoices.includes(i)){this.selectedChoices=this.selectedChoices.filter((function(t){return t!==i}));this.announceToScreenReader("Deselected: ".concat(t.label))}else{this.selectedChoices=__spreadArray(__spreadArray([],this.selectedChoices,true),[i],false);this.announceToScreenReader("Selected: ".concat(t.label))}}else{this.selectedChoices=[i];this.announceToScreenReader("Selected: ".concat(t.label))}if(this.formErrors["poll"]){var n=Object.assign({},this.formErrors);delete n["poll"];this.formErrors=n}};t.prototype.handleFollowUpChoiceSelect=function(t){var e=t.value;if(this.selectedFollowUpChoices.includes(e)){this.selectedFollowUpChoices=this.selectedFollowUpChoices.filter((function(t){return t!==e}))}else{this.selectedFollowUpChoices=__spreadArray(__spreadArray([],this.selectedFollowUpChoices,true),[e],false)}};t.prototype.handleRespondentDetailChange=function(t,e){var i;var r=e.target;var n=this.respondentDetails.find((function(e){return e.value===t}));var o=(n===null||n===void 0?void 0:n.inputType)||"text";var a;if(r.type==="checkbox"){var s=this.userRespondentDetails[t]||"";var u=sanitizeInput(r.value,100);if(r.checked){a=addToCommaSeparatedList(s,u)}else{a=removeFromCommaSeparatedList(s,u)}}else{a=sanitizeByType(r.value,o)}this.userRespondentDetails=Object.assign(Object.assign({},this.userRespondentDetails),(i={},i[t]=a,i))};t.prototype.createInputHandler=function(t){var e=this;return function(i){e.handleRespondentDetailChange(t,i)}};t.prototype.isValueInArray=function(t,e){for(var i=0;i<t.length;i++){if(t[i]===e){return true}}return false};t.prototype.renderField=function(t){var e=getFieldConfig(t,this.userRespondentDetails[t.value]||"");var i=this.createInputHandler(t.value);switch(e.inputType){case"text":case"email":case"number":return h("input",{part:"input form-input",type:e.inputType,value:e.currentValue,onInput:i,placeholder:e.placeholder,required:e.required});case"dropdown":if(!e.hasOptions){return h("input",{part:"input form-input",type:"text",value:e.currentValue,onInput:i,placeholder:e.placeholder,required:e.required})}return h("select",{part:"select form-select",onChange:i,required:e.required},!e.defaultValue&&h("option",{value:"",disabled:true},e.placeholder),e.options.map((function(t){return h("option",{key:t.value,value:t.value,selected:e.currentValue===t.value||!e.currentValue&&e.defaultValue===t.value},t.label)})));case"radio":if(!e.hasOptions){return h("input",{part:"input form-input",type:"text",value:e.currentValue,onInput:i,placeholder:e.placeholder,required:e.required})}return h("div",{part:"radio-group"},e.options.map((function(t){return h("div",{key:t.value,part:"radio-option"},h("input",{part:"radio-input",type:"radio",id:e.fieldValue+"-"+t.value,name:e.fieldValue,value:t.value,checked:e.currentValue===t.value||!e.currentValue&&e.defaultValue===t.value,onChange:i,required:e.required}),h("label",{part:"radio-label",htmlFor:e.fieldValue+"-"+t.value},t.label))})));case"checkbox":if(!e.hasOptions){return h("input",{part:"input form-input",type:"text",value:e.currentValue,onInput:i,placeholder:e.placeholder,required:e.required})}var r=this;return h("div",{part:"checkbox-group"},e.options.map((function(t){return h("div",{key:t.value,part:"checkbox-option"},h("input",{part:"checkbox-input",type:"checkbox",id:e.fieldValue+"-"+t.value,name:e.fieldValue,value:t.value,checked:r.isValueInArray(e.selectedValues,t.value),onChange:i}),h("label",{part:"checkbox-label",htmlFor:e.fieldValue+"-"+t.value},t.label))})));default:return h("input",{part:"input form-input",type:"text",value:e.currentValue,onInput:i,placeholder:e.placeholder,required:e.required})}};t.prototype.isRespondentDetailsValid=function(){var t=this;return this.respondentDetails.every((function(e){var i=t.userRespondentDetails[e.value]||"";var r=t.validateRespondentField(e,i);return r===null}))};t.prototype.renderPollStep=function(){var t=this;var e,i,r,n;var o=!this.hasFollowUpStep()&&!this.hasRespondentDetailsStep();var a=((e=this.config)===null||e===void 0?void 0:e.choiceType)==="multiChoice";var s=!!this.formErrors["poll"];return h("div",{part:"step poll-step"},h("h2",{part:"heading poll-heading",id:"poll-heading"},((i=this.config)===null||i===void 0?void 0:i.question)||"What is your choice?"),h("div",{part:"choices-container",role:a?"group":"radiogroup","aria-labelledby":"poll-heading","aria-invalid":s,"aria-describedby":s?"poll-error":undefined},(n=(r=this.config)===null||r===void 0?void 0:r.choices)===null||n===void 0?void 0:n.map((function(e,i){return h("label",{part:"choice-option",key:e.value},h("input",{part:a?"checkbox-input":"radio-input",type:a?"checkbox":"radio",id:"poll-choice-".concat(i),name:"poll-choice",value:e.value,checked:t.selectedChoices.includes(e.value),onChange:function(){return t.handleChoiceSelect(e)},"aria-describedby":"poll-choice-".concat(i,"-label")}),h("span",{part:"choice-label",id:"poll-choice-".concat(i,"-label")},e.label))}))),s&&h("div",{part:"error-message",id:"poll-error",role:"alert","aria-live":"polite"},this.formErrors["poll"]),h("div",{part:"button-container"},h("button",{part:"button next-button",onClick:function(){return t.nextStep()},disabled:this.selectedChoices.length===0},o?"Submit":"Next")))};t.prototype.renderFollowUpStep=function(){var t=this;var e,i,r;var n=!this.hasRespondentDetailsStep();return h("div",{part:"step follow-up-step"},h("h2",{part:"heading follow-up-heading"},((e=this.config)===null||e===void 0?void 0:e.followUpQuestion)||"Follow-up question"),h("div",{part:"choices-container"},(r=(i=this.config)===null||i===void 0?void 0:i.followUpChoices)===null||r===void 0?void 0:r.map((function(e){return h("label",{part:"choice-option",key:e.value},h("input",{part:"checkbox-input",type:"checkbox",name:"follow-up-choice",value:e.value,checked:t.selectedFollowUpChoices.includes(e.value),onChange:function(){return t.handleFollowUpChoiceSelect(e)}}),h("span",{part:"choice-label"},e.label))}))),h("div",{part:"button-container"},h("button",{part:"button back-button",onClick:function(){return t.prevStep()}},"Back"),h("button",{part:"button next-button",onClick:function(){return t.nextStep()}},n?"Submit":"Next")))};t.prototype.renderRespondentDetailsStep=function(){var t=this;return h("div",{part:"step respondent-details-step"},h("h2",{part:"heading respondent-details-heading"},"Tell us about yourself"),h("div",{part:"form-container"},this.respondentDetails.map((function(e){return h("div",{part:"form-field"},h("label",{part:"form-label"},e.label,e.required&&h("span",{part:"required-indicator"}," *")),t.renderField(e))}))),h("div",{part:"button-container"},h("button",{part:"button back-button",onClick:function(){return t.prevStep()}},"Back"),h("button",{part:"button submit-button",onClick:function(){return t.submitResponse()},disabled:!this.isRespondentDetailsValid()},"Submit")))};t.prototype.renderCompletionStep=function(){return h("div",{part:"step completion-step"},h("h2",{part:"heading completion-heading"},this.completionMessage))};t.prototype.renderCurrentStep=function(){var t;var e=(t={},t[SurveyStep.POLL]=this.renderPollStep.bind(this),t[SurveyStep.FOLLOW_UP]=this.renderFollowUpStep.bind(this),t[SurveyStep.RESPONDENT_DETAILS]=this.renderRespondentDetailsStep.bind(this),t[SurveyStep.COMPLETION]=this.renderCompletionStep.bind(this),t);var i=e[this.currentStep]||e[SurveyStep.POLL];return i()};t.prototype.render=function(){var t=this;if(!isValidKey(this.surveyKey)){return h(Host,null,h("p",{part:"message error-message"},"Unable to render survey due to invalid public key"))}if(this.loading){return h(Host,null,h("p",{part:"message loading-message"},"Loading survey..."))}if(this.error){return h(Host,null,h("div",{part:"error-container"},h("p",{part:"message error-message"},this.error),h("button",{part:"button retry-button",onClick:function(){return t.retryOperation()}},"Try again")))}if(!this.config){return h(Host,null,h("div",{part:"error-container"},h("p",{part:"message error-message"},"No survey configuration found"),h("button",{part:"button retry-button",onClick:function(){return t.retryOperation()}},"Try again")))}return h(Host,null,h("div",{part:"survey-container",role:"main","aria-label":"Poll Survey"},this.renderCurrentStep(),h("div",{"aria-live":"polite","aria-atomic":"true",class:"sr-only",part:"announcements"},this.announceMessage)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SfFastpoll.style=sfFastpollCss;export{SfFastpoll as sf_fastpoll};
2
+ //# sourceMappingURL=sf-fastpoll.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sf-fastpoll.entry.js","sources":["src/components/sf-fastpoll/sf-fastpoll.css?tag=sf-fastpoll&encapsulation=shadow","src/components/sf-fastpoll/sf-fastpoll.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n/* Screen reader only content */\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Focus indicators for accessibility */\ninput:focus,\nselect:focus,\nbutton:focus {\n outline: 2px solid #005fcc;\n outline-offset: 2px;\n}\n\n/* Error state styling */\n[aria-invalid='true'] {\n border-color: #d32f2f;\n}\n\n[part='error-message'] {\n color: #d32f2f;\n font-size: 0.875rem;\n margin-top: 0.25rem;\n}\n\n/* Choice options styling */\n[part='choice-option'] {\n display: flex;\n align-items: center;\n margin: 0.5rem 0;\n cursor: pointer;\n}\n\n[part='choice-option']:hover {\n background-color: rgba(0, 95, 204, 0.1);\n}\n\n/* High contrast mode support */\n@media (prefers-contrast: high) {\n input:focus,\n select:focus,\n button:focus {\n outline: 3px solid;\n }\n\n [part='error-message'] {\n background-color: #d32f2f;\n color: white;\n padding: 0.25rem;\n }\n\n [part='choice-option']:hover {\n background-color: highlight;\n color: highlighttext;\n }\n}\n\n/* Reduced motion support */\n@media (prefers-reduced-motion: reduce) {\n * {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n }\n}\n","import { Component, Host, h, Prop, State, Element, Env } from '@stencil/core';\nimport { isValidKey, getFieldConfig, addToCommaSeparatedList, removeFromCommaSeparatedList, sanitizeByType, sanitizeInput } from '../../utils/utils';\n\nconst SURVEY_API_ENDPOINT = Env.SURVEY_API_ENDPOINT;\nconst RESPONSE_API_ENDPOINT = Env.RESPONSE_API_ENDPOINT;\n\nenum SurveyStep {\n POLL = 0,\n FOLLOW_UP = 1,\n RESPONDENT_DETAILS = 2,\n COMPLETION = 3,\n}\n\ninterface RespondentDetail {\n label: string;\n value: string;\n inputType: string; // 'text', 'email', 'dropdown', 'radio', 'checkbox', 'number'\n required?: boolean;\n placeholder?: string;\n options?: Array<{\n value: string;\n label: string;\n }>;\n defaultValue?: any;\n}\n\ninterface Choice {\n label: string;\n value: string;\n}\n\ninterface SurveyConfig {\n question: string;\n choiceType: string; // 'single' or 'multiple'\n choices: Choice[];\n followUpChoices?: Choice[];\n followUpQuestion?: string;\n}\n\ninterface SurveyPayload {\n config: SurveyConfig;\n respondentDetails?: RespondentDetail[];\n}\n\ninterface ApiResponse {\n success: boolean;\n message: string;\n payload: SurveyPayload;\n}\n\n@Component({\n tag: 'sf-fastpoll',\n styleUrl: 'sf-fastpoll.css',\n shadow: true,\n})\nexport class SfFastpoll {\n @Element() el: HTMLElement;\n\n @Prop() surveyKey: string;\n\n @Prop() completionMessage: string = 'Thank you for your response!';\n\n @State() config: SurveyConfig | null = null;\n\n @State() respondentDetails: RespondentDetail[] = [];\n\n @State() loading: boolean = false;\n\n @State() error: string | null = null;\n\n @State() currentStep: SurveyStep = SurveyStep.POLL;\n\n @State() selectedChoices: string[] = [];\n\n @State() selectedFollowUpChoices: string[] = [];\n\n @State() userRespondentDetails: { [key: string]: string } = {};\n\n @State() submitted: boolean = false;\n\n @State() announceMessage: string = '';\n\n @State() formErrors: { [key: string]: string } = {};\n\n private surveyStartTime: number = 0;\n\n componentWillLoad() {\n if (isValidKey(this.surveyKey)) {\n return this.fetchSurveyData();\n }\n return Promise.resolve();\n }\n\n private async fetchSurveyData() {\n this.loading = true;\n this.error = null;\n this.surveyStartTime = Date.now();\n\n try {\n const response = await fetch(`${SURVEY_API_ENDPOINT}/${this.surveyKey}`);\n const data: ApiResponse = await response.json();\n\n if (!data.success) {\n throw new Error(data.message);\n }\n\n this.config = data.payload.config;\n this.respondentDetails = data.payload.respondentDetails || [];\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error);\n } finally {\n this.loading = false;\n }\n }\n\n private async retryOperation() {\n if (this.config) {\n // If we have config, retry submission\n await this.submitResponse();\n } else {\n // Otherwise, retry fetching survey data\n await this.fetchSurveyData();\n }\n }\n\n private async submitResponse() {\n if (!this.config || this.submitted) {\n return;\n }\n\n this.loading = true;\n this.error = null;\n\n try {\n const completionTimeSeconds = this.surveyStartTime > 0 ? Math.round((Date.now() - this.surveyStartTime) / 1000) : 0;\n const userAgentInfo = this.getUserAgentInfo();\n\n const submissionData = {\n surveyPublicKey: this.surveyKey,\n responseData: {\n selectedChoices: this.selectedChoices,\n selectedFollowUpChoices: this.selectedFollowUpChoices,\n },\n respondentDetails: this.userRespondentDetails,\n userAgent: userAgentInfo,\n completionTime: completionTimeSeconds,\n surveyType: 'fastPoll',\n };\n\n const response = await fetch(`${RESPONSE_API_ENDPOINT}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(submissionData),\n });\n\n const result = await response.json();\n\n if (!result.success) {\n throw new Error(result.message);\n }\n\n this.submitted = true;\n this.currentStep = SurveyStep.COMPLETION;\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error);\n } finally {\n this.loading = false;\n }\n }\n\n private getUserAgentInfo() {\n // Use modern navigator.userAgentData when available, fallback to userAgent parsing\n const getPlatform = () => {\n if ('userAgentData' in navigator && (navigator as any).userAgentData?.platform) {\n return (navigator as any).userAgentData.platform;\n }\n // Fallback: extract platform info from userAgent\n const ua = navigator.userAgent;\n if (ua.includes('Win')) return 'Windows';\n if (ua.includes('Mac')) return 'macOS';\n if (ua.includes('Linux')) return 'Linux';\n if (ua.includes('Android')) return 'Android';\n if (ua.includes('iOS')) return 'iOS';\n return 'Unknown';\n };\n\n return {\n userAgent: navigator.userAgent,\n language: navigator.language,\n platform: getPlatform(),\n cookieEnabled: navigator.cookieEnabled,\n onLine: navigator.onLine,\n screenResolution: `${screen.width}x${screen.height}`,\n colorDepth: screen.colorDepth,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n timestamp: new Date().toISOString(),\n };\n }\n\n private nextStep() {\n if (!this.validateForm()) {\n return;\n }\n\n if (this.currentStep === SurveyStep.POLL) {\n if (this.hasFollowUpStep()) {\n this.currentStep = SurveyStep.FOLLOW_UP;\n this.announceToScreenReader('Moving to follow-up question');\n } else if (this.hasRespondentDetailsStep()) {\n this.currentStep = SurveyStep.RESPONDENT_DETAILS;\n this.announceToScreenReader('Moving to respondent details');\n } else {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n } else if (this.currentStep === SurveyStep.FOLLOW_UP) {\n if (this.hasRespondentDetailsStep()) {\n this.currentStep = SurveyStep.RESPONDENT_DETAILS;\n this.announceToScreenReader('Moving to respondent details');\n } else {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n } else if (this.currentStep === SurveyStep.RESPONDENT_DETAILS) {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n }\n\n private prevStep() {\n if (this.currentStep === SurveyStep.FOLLOW_UP) {\n this.currentStep = SurveyStep.POLL;\n } else if (this.currentStep === SurveyStep.RESPONDENT_DETAILS) {\n if (this.hasFollowUpStep()) {\n this.currentStep = SurveyStep.FOLLOW_UP;\n } else {\n this.currentStep = SurveyStep.POLL;\n }\n }\n }\n\n private hasFollowUpStep(): boolean {\n return !!(this.config?.followUpQuestion && this.config?.followUpChoices?.length);\n }\n\n private hasRespondentDetailsStep(): boolean {\n return this.respondentDetails.length > 0;\n }\n\n private announceToScreenReader(message: string) {\n this.announceMessage = message;\n setTimeout(() => {\n this.announceMessage = '';\n }, 1000);\n }\n\n private isValidEmail(email: string): boolean {\n // Basic email validation regex\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(email.trim());\n }\n\n private validateRespondentField(detail: RespondentDetail, value: string): string | null {\n if (detail.required !== false && (!value || value.trim().length === 0)) {\n return 'This field is required';\n }\n\n if (value && value.trim().length > 0) {\n const config = getFieldConfig(detail, value);\n if (config.inputType === 'email') {\n if (!this.isValidEmail(value)) {\n return 'Please enter a valid email address';\n }\n }\n }\n\n return null;\n }\n\n private validateForm(): boolean {\n const errors: { [key: string]: string } = {};\n\n if (this.currentStep === SurveyStep.POLL && this.selectedChoices.length === 0) {\n errors['poll'] = 'Please select at least one option';\n }\n\n if (this.currentStep === SurveyStep.FOLLOW_UP && this.selectedFollowUpChoices.length === 0) {\n errors['followup'] = 'Please select at least one option';\n }\n\n this.formErrors = errors;\n return Object.keys(errors).length === 0;\n }\n\n private handleChoiceSelect(choice: Choice) {\n const choiceValue = choice.value;\n const isMultipleChoice = this.config?.choiceType === 'multiChoice';\n\n if (isMultipleChoice) {\n if (this.selectedChoices.includes(choiceValue)) {\n this.selectedChoices = this.selectedChoices.filter(c => c !== choiceValue);\n this.announceToScreenReader(`Deselected: ${choice.label}`);\n } else {\n this.selectedChoices = [...this.selectedChoices, choiceValue];\n this.announceToScreenReader(`Selected: ${choice.label}`);\n }\n } else {\n this.selectedChoices = [choiceValue];\n this.announceToScreenReader(`Selected: ${choice.label}`);\n }\n\n // Clear any validation errors when user makes a selection\n if (this.formErrors['poll']) {\n const errors = { ...this.formErrors };\n delete errors['poll'];\n this.formErrors = errors;\n }\n }\n\n private handleFollowUpChoiceSelect(choice: Choice) {\n const choiceValue = choice.value;\n if (this.selectedFollowUpChoices.includes(choiceValue)) {\n this.selectedFollowUpChoices = this.selectedFollowUpChoices.filter(c => c !== choiceValue);\n } else {\n this.selectedFollowUpChoices = [...this.selectedFollowUpChoices, choiceValue];\n }\n }\n\n private handleRespondentDetailChange(key: string, event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const detail = this.respondentDetails.find(d => d.value === key);\n const inputType = detail?.inputType || 'text';\n let value: string;\n\n if (target.type === 'checkbox') {\n // Handle checkbox inputs - maintain comma-separated list using browser-compatible helpers\n const currentValue = this.userRespondentDetails[key] || '';\n const sanitizedCheckboxValue = sanitizeInput(target.value, 100);\n if (target.checked) {\n value = addToCommaSeparatedList(currentValue, sanitizedCheckboxValue);\n } else {\n value = removeFromCommaSeparatedList(currentValue, sanitizedCheckboxValue);\n }\n } else {\n // Handle all other input types (text, email, number, radio, select)\n // Sanitize based on field type\n value = sanitizeByType(target.value, inputType);\n }\n\n this.userRespondentDetails = {\n ...this.userRespondentDetails,\n [key]: value,\n };\n }\n\n private createInputHandler(fieldValue: string) {\n const self = this;\n return function (e: Event) {\n self.handleRespondentDetailChange(fieldValue, e);\n };\n }\n\n private isValueInArray(array: string[], value: string): boolean {\n for (let i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return true;\n }\n }\n return false;\n }\n\n private renderField(detail: RespondentDetail) {\n const config = getFieldConfig(detail, this.userRespondentDetails[detail.value] || '');\n const inputHandler = this.createInputHandler(detail.value);\n\n switch (config.inputType) {\n case 'text':\n case 'email':\n case 'number':\n return (\n <input part=\"input form-input\" type={config.inputType} value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />\n );\n\n case 'dropdown':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n return (\n <select part=\"select form-select\" onChange={inputHandler} required={config.required}>\n {!config.defaultValue && (\n <option value=\"\" disabled>\n {config.placeholder}\n </option>\n )}\n {config.options.map(function (option) {\n return (\n <option key={option.value} value={option.value} selected={config.currentValue === option.value || (!config.currentValue && config.defaultValue === option.value)}>\n {option.label}\n </option>\n );\n })}\n </select>\n );\n\n case 'radio':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n return (\n <div part=\"radio-group\">\n {config.options.map(function (option) {\n return (\n <div key={option.value} part=\"radio-option\">\n <input\n part=\"radio-input\"\n type=\"radio\"\n id={config.fieldValue + '-' + option.value}\n name={config.fieldValue}\n value={option.value}\n checked={config.currentValue === option.value || (!config.currentValue && config.defaultValue === option.value)}\n onChange={inputHandler}\n required={config.required}\n />\n <label part=\"radio-label\" htmlFor={config.fieldValue + '-' + option.value}>\n {option.label}\n </label>\n </div>\n );\n })}\n </div>\n );\n\n case 'checkbox':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n const self = this;\n return (\n <div part=\"checkbox-group\">\n {config.options.map(function (option) {\n return (\n <div key={option.value} part=\"checkbox-option\">\n <input\n part=\"checkbox-input\"\n type=\"checkbox\"\n id={config.fieldValue + '-' + option.value}\n name={config.fieldValue}\n value={option.value}\n checked={self.isValueInArray(config.selectedValues, option.value)}\n onChange={inputHandler}\n />\n <label part=\"checkbox-label\" htmlFor={config.fieldValue + '-' + option.value}>\n {option.label}\n </label>\n </div>\n );\n })}\n </div>\n );\n\n default:\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n }\n\n private isRespondentDetailsValid(): boolean {\n return this.respondentDetails.every(detail => {\n const value = this.userRespondentDetails[detail.value] || '';\n const error = this.validateRespondentField(detail, value);\n return error === null;\n });\n }\n\n private renderPollStep() {\n const isFinalStep = !this.hasFollowUpStep() && !this.hasRespondentDetailsStep();\n const isMultiple = this.config?.choiceType === 'multiChoice';\n const hasError = !!this.formErrors['poll'];\n\n return (\n <div part=\"step poll-step\">\n <h2 part=\"heading poll-heading\" id=\"poll-heading\">\n {this.config?.question || 'What is your choice?'}\n </h2>\n <div\n part=\"choices-container\"\n role={isMultiple ? 'group' : 'radiogroup'}\n aria-labelledby=\"poll-heading\"\n aria-invalid={hasError}\n aria-describedby={hasError ? 'poll-error' : undefined}\n >\n {this.config?.choices?.map((choice, index) => (\n <label part=\"choice-option\" key={choice.value}>\n <input\n part={isMultiple ? 'checkbox-input' : 'radio-input'}\n type={isMultiple ? 'checkbox' : 'radio'}\n id={`poll-choice-${index}`}\n name=\"poll-choice\"\n value={choice.value}\n checked={this.selectedChoices.includes(choice.value)}\n onChange={() => this.handleChoiceSelect(choice)}\n aria-describedby={`poll-choice-${index}-label`}\n />\n <span part=\"choice-label\" id={`poll-choice-${index}-label`}>\n {choice.label}\n </span>\n </label>\n ))}\n </div>\n {hasError && (\n <div part=\"error-message\" id=\"poll-error\" role=\"alert\" aria-live=\"polite\">\n {this.formErrors['poll']}\n </div>\n )}\n <div part=\"button-container\">\n <button part=\"button next-button\" onClick={() => this.nextStep()} disabled={this.selectedChoices.length === 0}>\n {isFinalStep ? 'Submit' : 'Next'}\n </button>\n </div>\n </div>\n );\n }\n\n private renderFollowUpStep() {\n const isFinalStep = !this.hasRespondentDetailsStep();\n\n return (\n <div part=\"step follow-up-step\">\n <h2 part=\"heading follow-up-heading\">{this.config?.followUpQuestion || 'Follow-up question'}</h2>\n <div part=\"choices-container\">\n {this.config?.followUpChoices?.map(choice => (\n <label part=\"choice-option\" key={choice.value}>\n <input\n part=\"checkbox-input\"\n type=\"checkbox\"\n name=\"follow-up-choice\"\n value={choice.value}\n checked={this.selectedFollowUpChoices.includes(choice.value)}\n onChange={() => this.handleFollowUpChoiceSelect(choice)}\n />\n <span part=\"choice-label\">{choice.label}</span>\n </label>\n ))}\n </div>\n <div part=\"button-container\">\n <button part=\"button back-button\" onClick={() => this.prevStep()}>\n Back\n </button>\n <button part=\"button next-button\" onClick={() => this.nextStep()}>\n {isFinalStep ? 'Submit' : 'Next'}\n </button>\n </div>\n </div>\n );\n }\n\n private renderRespondentDetailsStep() {\n return (\n <div part=\"step respondent-details-step\">\n <h2 part=\"heading respondent-details-heading\">Tell us about yourself</h2>\n <div part=\"form-container\">\n {this.respondentDetails.map(detail => (\n <div part=\"form-field\">\n <label part=\"form-label\">\n {detail.label}\n {detail.required && <span part=\"required-indicator\"> *</span>}\n </label>\n {this.renderField(detail)}\n </div>\n ))}\n </div>\n <div part=\"button-container\">\n <button part=\"button back-button\" onClick={() => this.prevStep()}>\n Back\n </button>\n <button part=\"button submit-button\" onClick={() => this.submitResponse()} disabled={!this.isRespondentDetailsValid()}>\n Submit\n </button>\n </div>\n </div>\n );\n }\n\n private renderCompletionStep() {\n return (\n <div part=\"step completion-step\">\n <h2 part=\"heading completion-heading\">{this.completionMessage}</h2>\n </div>\n );\n }\n\n private renderCurrentStep() {\n const stepRenderers = {\n [SurveyStep.POLL]: this.renderPollStep.bind(this),\n [SurveyStep.FOLLOW_UP]: this.renderFollowUpStep.bind(this),\n [SurveyStep.RESPONDENT_DETAILS]: this.renderRespondentDetailsStep.bind(this),\n [SurveyStep.COMPLETION]: this.renderCompletionStep.bind(this),\n };\n\n const renderer = stepRenderers[this.currentStep] || stepRenderers[SurveyStep.POLL];\n\n return renderer();\n }\n\n render() {\n if (!isValidKey(this.surveyKey)) {\n return (\n <Host>\n <p part=\"message error-message\">Unable to render survey due to invalid public key</p>\n </Host>\n );\n }\n\n if (this.loading) {\n return (\n <Host>\n <p part=\"message loading-message\">Loading survey...</p>\n </Host>\n );\n }\n\n if (this.error) {\n return (\n <Host>\n <div part=\"error-container\">\n <p part=\"message error-message\">{this.error}</p>\n <button part=\"button retry-button\" onClick={() => this.retryOperation()}>\n Try again\n </button>\n </div>\n </Host>\n );\n }\n\n if (!this.config) {\n return (\n <Host>\n <div part=\"error-container\">\n <p part=\"message error-message\">No survey configuration found</p>\n <button part=\"button retry-button\" onClick={() => this.retryOperation()}>\n Try again\n </button>\n </div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div part=\"survey-container\" role=\"main\" aria-label=\"Poll Survey\">\n {this.renderCurrentStep()}\n {/* ARIA live region for screen reader announcements */}\n <div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\" part=\"announcements\">\n {this.announceMessage}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,aAAa,GAAG,mkCAAmkC;;ACGzlC,MAAM,mBAAmB,GAAG,GAAG,CAAC,mBAAmB;AACnD,MAAM,qBAAqB,GAAG,GAAG,CAAC,qBAAqB;AAEvD,IAAK,UAKJ;AALD,CAAA,UAAK,UAAU,EAAA;IACb,UAAA,CAAA,UAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;IACR,UAAA,CAAA,UAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAa;IACb,UAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,oBAAsB;IACtB,UAAA,CAAA,UAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAc;AAChB,CAAC,EALI,UAAU,KAAV,UAAU,GAKd,EAAA,CAAA,CAAA;MA4CY,UAAU,GAAA,MAAA;AALvB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAUU,QAAA,IAAiB,CAAA,iBAAA,GAAW,8BAA8B;AAEzD,QAAA,IAAM,CAAA,MAAA,GAAwB,IAAI;AAElC,QAAA,IAAiB,CAAA,iBAAA,GAAuB,EAAE;AAE1C,QAAA,IAAO,CAAA,OAAA,GAAY,KAAK;AAExB,QAAA,IAAK,CAAA,KAAA,GAAkB,IAAI;AAE3B,QAAA,IAAA,CAAA,WAAW,G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EACH,CAAK,CAAA,KAAA,EAAA,EAAA,IAAI,EAAC,iBAAiB,EAAA,EACzB,CAAG,CAAA,GAAA,EAAA,EAAA,IAAI,EAAC,uBAAuB,EAAkC,EAAA,+BAAA,CAAA,EACjE,CAAA,CAAA,QAAA,EAAA,EAAQ,IAAI,EAAC,qBAAqB,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,gBAE9D,CACL,CACD;;QAIX,QACE,EAAC,IAAI,EAAA,IAAA,EACH,CAAK,CAAA,KAAA,EAAA,EAAA,IAAI,EAAC,kBAAkB,EAAC,IAAI,EAAC,MAAM,gBAAY,aAAa,EAAA,EAC9D,IAAI,CAAC,iBAAiB,EAAE,EAEzB,CAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EAAe,QAAQ,EAAa,aAAA,EAAA,MAAM,EAAC,KAAK,EAAC,SAAS,EAAC,IAAI,EAAC,eAAe,EAAA,EAC5E,IAAI,CAAC,eAAe,CACjB,CACF,CACD;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,n){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n["throw"](e))}catch(e){i(e)}}function c(e){e.done?r(e.value):o(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(r=0)),r)try{if(n=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;o=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1];i=a;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(a);break}if(i[2])r.ops.pop();r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e];o=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{p as promiseResolve,b as bootstrapLazy}from"./index-XYfqntZe.js";export{s as setNonce}from"./index-XYfqntZe.js";import{g as globalScripts}from"./app-globals-DQuL1Twl.js";var patchBrowser=function(){var e=import.meta.url;var t={};if(e!==""){t.resourcesUrl=new URL(".",e).href}return promiseResolve(t)};patchBrowser().then((function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,globalScripts()];case 1:t.sent();return[2,bootstrapLazy([["sf-fastpoll",[[1,"sf-fastpoll",{surveyKey:[1,"survey-key"],completionMessage:[1,"completion-message"],config:[32],respondentDetails:[32],loading:[32],error:[32],currentStep:[32],selectedChoices:[32],selectedFollowUpChoices:[32],userRespondentDetails:[32],submitted:[32],announceMessage:[32],formErrors:[32]}]]]],e)]}}))}))}));
2
+ //# sourceMappingURL=sf-fastpoll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sf-fastpoll.js","sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.36.0 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, H, promiseResolve, win } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? win.document && Array.from(win.document.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;;AAKA,IAAI,YAAY,GAAG,MAAM;AAUzB,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG;AACpC,EAAE,MAAM,IAAI,GAAiE,EAAE;AAC/E,EAAE,IAAI,UAAU,KAAK,EAAE,EAAE;AACzB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI;AACrD;AACA,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC;AAC7B,CAAC;;ACnBD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,OAAO,KAAK;AACvC,EAAE,MAAM,aAAa,EAAE;AACvB,EAAE,OAAO,aAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC;AAC7D,CAAC,CAAC","x_google_ignoreList":[0]}
@@ -0,0 +1 @@
1
+ module.exports = require('./cjs/index.cjs.js');
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './esm-es5/index.js';
@@ -0,0 +1,2 @@
1
+ export{f as formatErrorMessage,i as isValidKey}from"./p-CfdIRf0W.js";
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.esm.js","sources":["@lazy-external-entrypoint?app-data=conditional"],"sourcesContent":["export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\nexport const defineCustomElements = async (win, options) => {\n if (typeof window === 'undefined') return undefined;\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n};\n"],"names":[],"mappings":";;;;AAGY,MAAC,oBAAoB,GAAG,OAAO,GAAG,EAAE,OAAO,KAAK;AAC5D,EAAE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,OAAO,SAAS;AACrD,EAAE,MAAM,aAAa,EAAE;AACvB,EAAE,OAAO,aAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC;AAC7D;;;;"}
@@ -0,0 +1,2 @@
1
+ var __awaiter=this&&this.__awaiter||function(t,i,e,r){function n(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r["throw"](t))}catch(t){o(t)}}function u(t){t.done?e(t.value):n(t.value).then(a,s)}u((r=r.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,n,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return u([t,i])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(e=0)),e)try{if(r=1,n&&(o=s[0]&2?n["return"]:s[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;if(n=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){e.label=s[1];break}if(s[0]===6&&e.label<o[1]){e.label=o[1];o=s;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(s);break}if(o[2])e.ops.pop();e.trys.pop();continue}s=i.call(t,e)}catch(t){s=[6,t];n=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,i,e){if(e||arguments.length===2)for(var r=0,n=i.length,o;r<n;r++){if(o||!(r in i)){if(!o)o=Array.prototype.slice.call(i,0,r);o[r]=i[r]}}return t.concat(o||Array.prototype.slice.call(i))};System.register(["./p-C9ESvisV.system.js","./p-S-cJYJS7.system.js"],(function(t){"use strict";var i,e,r,n,o,a,s,u,c,l,h;return{setters:[function(t){i=t.r;e=t.E;r=t.h;n=t.H;o=t.g},function(t){a=t.i;s=t.g;u=t.s;c=t.a;l=t.r;h=t.b}],execute:function(){var p=":host{display:block}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}input:focus,select:focus,button:focus{outline:2px solid #005fcc;outline-offset:2px}[aria-invalid='true']{border-color:#d32f2f}[part='error-message']{color:#d32f2f;font-size:0.875rem;margin-top:0.25rem}[part='choice-option']{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin:0.5rem 0;cursor:pointer}[part='choice-option']:hover{background-color:rgba(0, 95, 204, 0.1)}@media (prefers-contrast: high){input:focus,select:focus,button:focus{outline:3px solid}[part='error-message']{background-color:#d32f2f;color:white;padding:0.25rem}[part='choice-option']:hover{background-color:highlight;color:highlighttext}}@media (prefers-reduced-motion: reduce){*{-webkit-animation-duration:0.01ms !important;animation-duration:0.01ms !important;-webkit-animation-iteration-count:1 !important;animation-iteration-count:1 !important;-webkit-transition-duration:0.01ms !important;transition-duration:0.01ms !important}}";var f=e.SURVEY_API_ENDPOINT;var d=e.RESPONSE_API_ENDPOINT;var v;(function(t){t[t["POLL"]=0]="POLL";t[t["FOLLOW_UP"]=1]="FOLLOW_UP";t[t["RESPONDENT_DETAILS"]=2]="RESPONDENT_DETAILS";t[t["COMPLETION"]=3]="COMPLETION"})(v||(v={}));var b=t("sf_fastpoll",function(){function t(t){i(this,t);this.completionMessage="Thank you for your response!";this.config=null;this.respondentDetails=[];this.loading=false;this.error=null;this.currentStep=v.POLL;this.selectedChoices=[];this.selectedFollowUpChoices=[];this.userRespondentDetails={};this.submitted=false;this.announceMessage="";this.formErrors={};this.surveyStartTime=0}t.prototype.componentWillLoad=function(){if(a(this.surveyKey)){return this.fetchSurveyData()}return Promise.resolve()};t.prototype.fetchSurveyData=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e;return __generator(this,(function(r){switch(r.label){case 0:this.loading=true;this.error=null;this.surveyStartTime=Date.now();r.label=1;case 1:r.trys.push([1,4,5,6]);return[4,fetch("".concat(f,"/").concat(this.surveyKey))];case 2:t=r.sent();return[4,t.json()];case 3:i=r.sent();if(!i.success){throw new Error(i.message)}this.config=i.payload.config;this.respondentDetails=i.payload.respondentDetails||[];return[3,6];case 4:e=r.sent();this.error=e instanceof Error?e.message:String(e);return[3,6];case 5:this.loading=false;return[7];case 6:return[2]}}))}))};t.prototype.retryOperation=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.config)return[3,2];return[4,this.submitResponse()];case 1:t.sent();return[3,4];case 2:return[4,this.fetchSurveyData()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};t.prototype.submitResponse=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,r,n,o;return __generator(this,(function(a){switch(a.label){case 0:if(!this.config||this.submitted){return[2]}this.loading=true;this.error=null;a.label=1;case 1:a.trys.push([1,4,5,6]);t=this.surveyStartTime>0?Math.round((Date.now()-this.surveyStartTime)/1e3):0;i=this.getUserAgentInfo();e={surveyPublicKey:this.surveyKey,responseData:{selectedChoices:this.selectedChoices,selectedFollowUpChoices:this.selectedFollowUpChoices},respondentDetails:this.userRespondentDetails,userAgent:i,completionTime:t,surveyType:"fastPoll"};return[4,fetch("".concat(d),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})];case 2:r=a.sent();return[4,r.json()];case 3:n=a.sent();if(!n.success){throw new Error(n.message)}this.submitted=true;this.currentStep=v.COMPLETION;return[3,6];case 4:o=a.sent();this.error=o instanceof Error?o.message:String(o);return[3,6];case 5:this.loading=false;return[7];case 6:return[2]}}))}))};t.prototype.getUserAgentInfo=function(){var t=function(){var t;if("userAgentData"in navigator&&((t=navigator.userAgentData)===null||t===void 0?void 0:t.platform)){return navigator.userAgentData.platform}var i=navigator.userAgent;if(i.includes("Win"))return"Windows";if(i.includes("Mac"))return"macOS";if(i.includes("Linux"))return"Linux";if(i.includes("Android"))return"Android";if(i.includes("iOS"))return"iOS";return"Unknown"};return{userAgent:navigator.userAgent,language:navigator.language,platform:t(),cookieEnabled:navigator.cookieEnabled,onLine:navigator.onLine,screenResolution:"".concat(screen.width,"x").concat(screen.height),colorDepth:screen.colorDepth,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:(new Date).toISOString()}};t.prototype.nextStep=function(){if(!this.validateForm()){return}if(this.currentStep===v.POLL){if(this.hasFollowUpStep()){this.currentStep=v.FOLLOW_UP;this.announceToScreenReader("Moving to follow-up question")}else if(this.hasRespondentDetailsStep()){this.currentStep=v.RESPONDENT_DETAILS;this.announceToScreenReader("Moving to respondent details")}else{this.announceToScreenReader("Submitting poll...");this.submitResponse()}}else if(this.currentStep===v.FOLLOW_UP){if(this.hasRespondentDetailsStep()){this.currentStep=v.RESPONDENT_DETAILS;this.announceToScreenReader("Moving to respondent details")}else{this.announceToScreenReader("Submitting poll...");this.submitResponse()}}else if(this.currentStep===v.RESPONDENT_DETAILS){this.announceToScreenReader("Submitting poll...");this.submitResponse()}};t.prototype.prevStep=function(){if(this.currentStep===v.FOLLOW_UP){this.currentStep=v.POLL}else if(this.currentStep===v.RESPONDENT_DETAILS){if(this.hasFollowUpStep()){this.currentStep=v.FOLLOW_UP}else{this.currentStep=v.POLL}}};t.prototype.hasFollowUpStep=function(){var t,i,e;return!!(((t=this.config)===null||t===void 0?void 0:t.followUpQuestion)&&((e=(i=this.config)===null||i===void 0?void 0:i.followUpChoices)===null||e===void 0?void 0:e.length))};t.prototype.hasRespondentDetailsStep=function(){return this.respondentDetails.length>0};t.prototype.announceToScreenReader=function(t){var i=this;this.announceMessage=t;setTimeout((function(){i.announceMessage=""}),1e3)};t.prototype.isValidEmail=function(t){var i=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return i.test(t.trim())};t.prototype.validateRespondentField=function(t,i){if(t.required!==false&&(!i||i.trim().length===0)){return"This field is required"}if(i&&i.trim().length>0){var e=s(t,i);if(e.inputType==="email"){if(!this.isValidEmail(i)){return"Please enter a valid email address"}}}return null};t.prototype.validateForm=function(){var t={};if(this.currentStep===v.POLL&&this.selectedChoices.length===0){t["poll"]="Please select at least one option"}if(this.currentStep===v.FOLLOW_UP&&this.selectedFollowUpChoices.length===0){t["followup"]="Please select at least one option"}this.formErrors=t;return Object.keys(t).length===0};t.prototype.handleChoiceSelect=function(t){var i;var e=t.value;var r=((i=this.config)===null||i===void 0?void 0:i.choiceType)==="multiChoice";if(r){if(this.selectedChoices.includes(e)){this.selectedChoices=this.selectedChoices.filter((function(t){return t!==e}));this.announceToScreenReader("Deselected: ".concat(t.label))}else{this.selectedChoices=__spreadArray(__spreadArray([],this.selectedChoices,true),[e],false);this.announceToScreenReader("Selected: ".concat(t.label))}}else{this.selectedChoices=[e];this.announceToScreenReader("Selected: ".concat(t.label))}if(this.formErrors["poll"]){var n=Object.assign({},this.formErrors);delete n["poll"];this.formErrors=n}};t.prototype.handleFollowUpChoiceSelect=function(t){var i=t.value;if(this.selectedFollowUpChoices.includes(i)){this.selectedFollowUpChoices=this.selectedFollowUpChoices.filter((function(t){return t!==i}))}else{this.selectedFollowUpChoices=__spreadArray(__spreadArray([],this.selectedFollowUpChoices,true),[i],false)}};t.prototype.handleRespondentDetailChange=function(t,i){var e;var r=i.target;var n=this.respondentDetails.find((function(i){return i.value===t}));var o=(n===null||n===void 0?void 0:n.inputType)||"text";var a;if(r.type==="checkbox"){var s=this.userRespondentDetails[t]||"";var p=u(r.value,100);if(r.checked){a=c(s,p)}else{a=l(s,p)}}else{a=h(r.value,o)}this.userRespondentDetails=Object.assign(Object.assign({},this.userRespondentDetails),(e={},e[t]=a,e))};t.prototype.createInputHandler=function(t){var i=this;return function(e){i.handleRespondentDetailChange(t,e)}};t.prototype.isValueInArray=function(t,i){for(var e=0;e<t.length;e++){if(t[e]===i){return true}}return false};t.prototype.renderField=function(t){var i=s(t,this.userRespondentDetails[t.value]||"");var e=this.createInputHandler(t.value);switch(i.inputType){case"text":case"email":case"number":return r("input",{part:"input form-input",type:i.inputType,value:i.currentValue,onInput:e,placeholder:i.placeholder,required:i.required});case"dropdown":if(!i.hasOptions){return r("input",{part:"input form-input",type:"text",value:i.currentValue,onInput:e,placeholder:i.placeholder,required:i.required})}return r("select",{part:"select form-select",onChange:e,required:i.required},!i.defaultValue&&r("option",{value:"",disabled:true},i.placeholder),i.options.map((function(t){return r("option",{key:t.value,value:t.value,selected:i.currentValue===t.value||!i.currentValue&&i.defaultValue===t.value},t.label)})));case"radio":if(!i.hasOptions){return r("input",{part:"input form-input",type:"text",value:i.currentValue,onInput:e,placeholder:i.placeholder,required:i.required})}return r("div",{part:"radio-group"},i.options.map((function(t){return r("div",{key:t.value,part:"radio-option"},r("input",{part:"radio-input",type:"radio",id:i.fieldValue+"-"+t.value,name:i.fieldValue,value:t.value,checked:i.currentValue===t.value||!i.currentValue&&i.defaultValue===t.value,onChange:e,required:i.required}),r("label",{part:"radio-label",htmlFor:i.fieldValue+"-"+t.value},t.label))})));case"checkbox":if(!i.hasOptions){return r("input",{part:"input form-input",type:"text",value:i.currentValue,onInput:e,placeholder:i.placeholder,required:i.required})}var n=this;return r("div",{part:"checkbox-group"},i.options.map((function(t){return r("div",{key:t.value,part:"checkbox-option"},r("input",{part:"checkbox-input",type:"checkbox",id:i.fieldValue+"-"+t.value,name:i.fieldValue,value:t.value,checked:n.isValueInArray(i.selectedValues,t.value),onChange:e}),r("label",{part:"checkbox-label",htmlFor:i.fieldValue+"-"+t.value},t.label))})));default:return r("input",{part:"input form-input",type:"text",value:i.currentValue,onInput:e,placeholder:i.placeholder,required:i.required})}};t.prototype.isRespondentDetailsValid=function(){var t=this;return this.respondentDetails.every((function(i){var e=t.userRespondentDetails[i.value]||"";var r=t.validateRespondentField(i,e);return r===null}))};t.prototype.renderPollStep=function(){var t=this;var i,e,n,o;var a=!this.hasFollowUpStep()&&!this.hasRespondentDetailsStep();var s=((i=this.config)===null||i===void 0?void 0:i.choiceType)==="multiChoice";var u=!!this.formErrors["poll"];return r("div",{part:"step poll-step"},r("h2",{part:"heading poll-heading",id:"poll-heading"},((e=this.config)===null||e===void 0?void 0:e.question)||"What is your choice?"),r("div",{part:"choices-container",role:s?"group":"radiogroup","aria-labelledby":"poll-heading","aria-invalid":u,"aria-describedby":u?"poll-error":undefined},(o=(n=this.config)===null||n===void 0?void 0:n.choices)===null||o===void 0?void 0:o.map((function(i,e){return r("label",{part:"choice-option",key:i.value},r("input",{part:s?"checkbox-input":"radio-input",type:s?"checkbox":"radio",id:"poll-choice-".concat(e),name:"poll-choice",value:i.value,checked:t.selectedChoices.includes(i.value),onChange:function(){return t.handleChoiceSelect(i)},"aria-describedby":"poll-choice-".concat(e,"-label")}),r("span",{part:"choice-label",id:"poll-choice-".concat(e,"-label")},i.label))}))),u&&r("div",{part:"error-message",id:"poll-error",role:"alert","aria-live":"polite"},this.formErrors["poll"]),r("div",{part:"button-container"},r("button",{part:"button next-button",onClick:function(){return t.nextStep()},disabled:this.selectedChoices.length===0},a?"Submit":"Next")))};t.prototype.renderFollowUpStep=function(){var t=this;var i,e,n;var o=!this.hasRespondentDetailsStep();return r("div",{part:"step follow-up-step"},r("h2",{part:"heading follow-up-heading"},((i=this.config)===null||i===void 0?void 0:i.followUpQuestion)||"Follow-up question"),r("div",{part:"choices-container"},(n=(e=this.config)===null||e===void 0?void 0:e.followUpChoices)===null||n===void 0?void 0:n.map((function(i){return r("label",{part:"choice-option",key:i.value},r("input",{part:"checkbox-input",type:"checkbox",name:"follow-up-choice",value:i.value,checked:t.selectedFollowUpChoices.includes(i.value),onChange:function(){return t.handleFollowUpChoiceSelect(i)}}),r("span",{part:"choice-label"},i.label))}))),r("div",{part:"button-container"},r("button",{part:"button back-button",onClick:function(){return t.prevStep()}},"Back"),r("button",{part:"button next-button",onClick:function(){return t.nextStep()}},o?"Submit":"Next")))};t.prototype.renderRespondentDetailsStep=function(){var t=this;return r("div",{part:"step respondent-details-step"},r("h2",{part:"heading respondent-details-heading"},"Tell us about yourself"),r("div",{part:"form-container"},this.respondentDetails.map((function(i){return r("div",{part:"form-field"},r("label",{part:"form-label"},i.label,i.required&&r("span",{part:"required-indicator"}," *")),t.renderField(i))}))),r("div",{part:"button-container"},r("button",{part:"button back-button",onClick:function(){return t.prevStep()}},"Back"),r("button",{part:"button submit-button",onClick:function(){return t.submitResponse()},disabled:!this.isRespondentDetailsValid()},"Submit")))};t.prototype.renderCompletionStep=function(){return r("div",{part:"step completion-step"},r("h2",{part:"heading completion-heading"},this.completionMessage))};t.prototype.renderCurrentStep=function(){var t;var i=(t={},t[v.POLL]=this.renderPollStep.bind(this),t[v.FOLLOW_UP]=this.renderFollowUpStep.bind(this),t[v.RESPONDENT_DETAILS]=this.renderRespondentDetailsStep.bind(this),t[v.COMPLETION]=this.renderCompletionStep.bind(this),t);var e=i[this.currentStep]||i[v.POLL];return e()};t.prototype.render=function(){var t=this;if(!a(this.surveyKey)){return r(n,null,r("p",{part:"message error-message"},"Unable to render survey due to invalid public key"))}if(this.loading){return r(n,null,r("p",{part:"message loading-message"},"Loading survey..."))}if(this.error){return r(n,null,r("div",{part:"error-container"},r("p",{part:"message error-message"},this.error),r("button",{part:"button retry-button",onClick:function(){return t.retryOperation()}},"Try again")))}if(!this.config){return r(n,null,r("div",{part:"error-container"},r("p",{part:"message error-message"},"No survey configuration found"),r("button",{part:"button retry-button",onClick:function(){return t.retryOperation()}},"Try again")))}return r(n,null,r("div",{part:"survey-container",role:"main","aria-label":"Poll Survey"},this.renderCurrentStep(),r("div",{"aria-live":"polite","aria-atomic":"true",class:"sr-only",part:"announcements"},this.announceMessage)))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());b.style=p}}}));
2
+ //# sourceMappingURL=p-1f6dca2a.system.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sfFastpollCss","SURVEY_API_ENDPOINT","Env","RESPONSE_API_ENDPOINT","SurveyStep","SfFastpoll","exports","class_1","hostRef","this","completionMessage","config","respondentDetails","loading","error","currentStep","POLL","selectedChoices","selectedFollowUpChoices","userRespondentDetails","submitted","announceMessage","formErrors","surveyStartTime","prototype","componentWillLoad","isValidKey","surveyKey","fetchSurveyData","Promise","resolve","Date","now","fetch","concat","response","_e","sent","json","data","success","Error","message","payload","error_1","String","retryOperation","submitResponse","completionTimeSeconds","Math","round","userAgentInfo","getUserAgentInfo","submissionData","surveyPublicKey","responseData","userAgent","completionTime","surveyType","method","headers","body","JSON","stringify","result","COMPLETION","error_2","getPlatform","navigator","_a","userAgentData","platform","ua","includes","language","cookieEnabled","onLine","screenResolution","screen","width","height","colorDepth","timezone","Intl","DateTimeFormat","resolvedOptions","timeZone","timestamp","toISOString","nextStep","validateForm","hasFollowUpStep","FOLLOW_UP","announceToScreenReader","hasRespondentDetailsStep","RESPONDENT_DETAILS","prevStep","followUpQuestion","_c","_b","followUpChoices","length","_this","setTimeout","isValidEmail","email","emailRegex","test","trim","validateRespondentField","detail","value","required","getFieldConfig","inputType","errors","Object","keys","handleChoiceSelect","choice","choiceValue","isMultipleChoice","choiceType","filter","c","label","__spreadArray","assign","handleFollowUpChoiceSelect","handleRespondentDetailChange","key","event","target","find","d","type","currentValue","sanitizedCheckboxValue","sanitizeInput","checked","addToCommaSeparatedList","removeFromCommaSeparatedList","sanitizeByType","createInputHandler","fieldValue","self","e","isValueInArray","array","i","renderField","inputHandler","h","part","onInput","placeholder","hasOptions","onChange","defaultValue","disabled","options","map","option","selected","id","name","htmlFor","self_1","selectedValues","isRespondentDetailsValid","every","renderPollStep","isFinalStep","isMultiple","hasError","question","role","undefined","_d","choices","index","onClick","renderFollowUpStep","renderRespondentDetailsStep","renderCompletionStep","renderCurrentStep","stepRenderers","bind","renderer","render","Host","class"],"sources":["src/components/sf-fastpoll/sf-fastpoll.css?tag=sf-fastpoll&encapsulation=shadow","src/components/sf-fastpoll/sf-fastpoll.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n/* Screen reader only content */\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Focus indicators for accessibility */\ninput:focus,\nselect:focus,\nbutton:focus {\n outline: 2px solid #005fcc;\n outline-offset: 2px;\n}\n\n/* Error state styling */\n[aria-invalid='true'] {\n border-color: #d32f2f;\n}\n\n[part='error-message'] {\n color: #d32f2f;\n font-size: 0.875rem;\n margin-top: 0.25rem;\n}\n\n/* Choice options styling */\n[part='choice-option'] {\n display: flex;\n align-items: center;\n margin: 0.5rem 0;\n cursor: pointer;\n}\n\n[part='choice-option']:hover {\n background-color: rgba(0, 95, 204, 0.1);\n}\n\n/* High contrast mode support */\n@media (prefers-contrast: high) {\n input:focus,\n select:focus,\n button:focus {\n outline: 3px solid;\n }\n\n [part='error-message'] {\n background-color: #d32f2f;\n color: white;\n padding: 0.25rem;\n }\n\n [part='choice-option']:hover {\n background-color: highlight;\n color: highlighttext;\n }\n}\n\n/* Reduced motion support */\n@media (prefers-reduced-motion: reduce) {\n * {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n }\n}\n","import { Component, Host, h, Prop, State, Element, Env } from '@stencil/core';\nimport { isValidKey, getFieldConfig, addToCommaSeparatedList, removeFromCommaSeparatedList, sanitizeByType, sanitizeInput } from '../../utils/utils';\n\nconst SURVEY_API_ENDPOINT = Env.SURVEY_API_ENDPOINT;\nconst RESPONSE_API_ENDPOINT = Env.RESPONSE_API_ENDPOINT;\n\nenum SurveyStep {\n POLL = 0,\n FOLLOW_UP = 1,\n RESPONDENT_DETAILS = 2,\n COMPLETION = 3,\n}\n\ninterface RespondentDetail {\n label: string;\n value: string;\n inputType: string; // 'text', 'email', 'dropdown', 'radio', 'checkbox', 'number'\n required?: boolean;\n placeholder?: string;\n options?: Array<{\n value: string;\n label: string;\n }>;\n defaultValue?: any;\n}\n\ninterface Choice {\n label: string;\n value: string;\n}\n\ninterface SurveyConfig {\n question: string;\n choiceType: string; // 'single' or 'multiple'\n choices: Choice[];\n followUpChoices?: Choice[];\n followUpQuestion?: string;\n}\n\ninterface SurveyPayload {\n config: SurveyConfig;\n respondentDetails?: RespondentDetail[];\n}\n\ninterface ApiResponse {\n success: boolean;\n message: string;\n payload: SurveyPayload;\n}\n\n@Component({\n tag: 'sf-fastpoll',\n styleUrl: 'sf-fastpoll.css',\n shadow: true,\n})\nexport class SfFastpoll {\n @Element() el: HTMLElement;\n\n @Prop() surveyKey: string;\n\n @Prop() completionMessage: string = 'Thank you for your response!';\n\n @State() config: SurveyConfig | null = null;\n\n @State() respondentDetails: RespondentDetail[] = [];\n\n @State() loading: boolean = false;\n\n @State() error: string | null = null;\n\n @State() currentStep: SurveyStep = SurveyStep.POLL;\n\n @State() selectedChoices: string[] = [];\n\n @State() selectedFollowUpChoices: string[] = [];\n\n @State() userRespondentDetails: { [key: string]: string } = {};\n\n @State() submitted: boolean = false;\n\n @State() announceMessage: string = '';\n\n @State() formErrors: { [key: string]: string } = {};\n\n private surveyStartTime: number = 0;\n\n componentWillLoad() {\n if (isValidKey(this.surveyKey)) {\n return this.fetchSurveyData();\n }\n return Promise.resolve();\n }\n\n private async fetchSurveyData() {\n this.loading = true;\n this.error = null;\n this.surveyStartTime = Date.now();\n\n try {\n const response = await fetch(`${SURVEY_API_ENDPOINT}/${this.surveyKey}`);\n const data: ApiResponse = await response.json();\n\n if (!data.success) {\n throw new Error(data.message);\n }\n\n this.config = data.payload.config;\n this.respondentDetails = data.payload.respondentDetails || [];\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error);\n } finally {\n this.loading = false;\n }\n }\n\n private async retryOperation() {\n if (this.config) {\n // If we have config, retry submission\n await this.submitResponse();\n } else {\n // Otherwise, retry fetching survey data\n await this.fetchSurveyData();\n }\n }\n\n private async submitResponse() {\n if (!this.config || this.submitted) {\n return;\n }\n\n this.loading = true;\n this.error = null;\n\n try {\n const completionTimeSeconds = this.surveyStartTime > 0 ? Math.round((Date.now() - this.surveyStartTime) / 1000) : 0;\n const userAgentInfo = this.getUserAgentInfo();\n\n const submissionData = {\n surveyPublicKey: this.surveyKey,\n responseData: {\n selectedChoices: this.selectedChoices,\n selectedFollowUpChoices: this.selectedFollowUpChoices,\n },\n respondentDetails: this.userRespondentDetails,\n userAgent: userAgentInfo,\n completionTime: completionTimeSeconds,\n surveyType: 'fastPoll',\n };\n\n const response = await fetch(`${RESPONSE_API_ENDPOINT}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(submissionData),\n });\n\n const result = await response.json();\n\n if (!result.success) {\n throw new Error(result.message);\n }\n\n this.submitted = true;\n this.currentStep = SurveyStep.COMPLETION;\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error);\n } finally {\n this.loading = false;\n }\n }\n\n private getUserAgentInfo() {\n // Use modern navigator.userAgentData when available, fallback to userAgent parsing\n const getPlatform = () => {\n if ('userAgentData' in navigator && (navigator as any).userAgentData?.platform) {\n return (navigator as any).userAgentData.platform;\n }\n // Fallback: extract platform info from userAgent\n const ua = navigator.userAgent;\n if (ua.includes('Win')) return 'Windows';\n if (ua.includes('Mac')) return 'macOS';\n if (ua.includes('Linux')) return 'Linux';\n if (ua.includes('Android')) return 'Android';\n if (ua.includes('iOS')) return 'iOS';\n return 'Unknown';\n };\n\n return {\n userAgent: navigator.userAgent,\n language: navigator.language,\n platform: getPlatform(),\n cookieEnabled: navigator.cookieEnabled,\n onLine: navigator.onLine,\n screenResolution: `${screen.width}x${screen.height}`,\n colorDepth: screen.colorDepth,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n timestamp: new Date().toISOString(),\n };\n }\n\n private nextStep() {\n if (!this.validateForm()) {\n return;\n }\n\n if (this.currentStep === SurveyStep.POLL) {\n if (this.hasFollowUpStep()) {\n this.currentStep = SurveyStep.FOLLOW_UP;\n this.announceToScreenReader('Moving to follow-up question');\n } else if (this.hasRespondentDetailsStep()) {\n this.currentStep = SurveyStep.RESPONDENT_DETAILS;\n this.announceToScreenReader('Moving to respondent details');\n } else {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n } else if (this.currentStep === SurveyStep.FOLLOW_UP) {\n if (this.hasRespondentDetailsStep()) {\n this.currentStep = SurveyStep.RESPONDENT_DETAILS;\n this.announceToScreenReader('Moving to respondent details');\n } else {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n } else if (this.currentStep === SurveyStep.RESPONDENT_DETAILS) {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n }\n\n private prevStep() {\n if (this.currentStep === SurveyStep.FOLLOW_UP) {\n this.currentStep = SurveyStep.POLL;\n } else if (this.currentStep === SurveyStep.RESPONDENT_DETAILS) {\n if (this.hasFollowUpStep()) {\n this.currentStep = SurveyStep.FOLLOW_UP;\n } else {\n this.currentStep = SurveyStep.POLL;\n }\n }\n }\n\n private hasFollowUpStep(): boolean {\n return !!(this.config?.followUpQuestion && this.config?.followUpChoices?.length);\n }\n\n private hasRespondentDetailsStep(): boolean {\n return this.respondentDetails.length > 0;\n }\n\n private announceToScreenReader(message: string) {\n this.announceMessage = message;\n setTimeout(() => {\n this.announceMessage = '';\n }, 1000);\n }\n\n private isValidEmail(email: string): boolean {\n // Basic email validation regex\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(email.trim());\n }\n\n private validateRespondentField(detail: RespondentDetail, value: string): string | null {\n if (detail.required !== false && (!value || value.trim().length === 0)) {\n return 'This field is required';\n }\n\n if (value && value.trim().length > 0) {\n const config = getFieldConfig(detail, value);\n if (config.inputType === 'email') {\n if (!this.isValidEmail(value)) {\n return 'Please enter a valid email address';\n }\n }\n }\n\n return null;\n }\n\n private validateForm(): boolean {\n const errors: { [key: string]: string } = {};\n\n if (this.currentStep === SurveyStep.POLL && this.selectedChoices.length === 0) {\n errors['poll'] = 'Please select at least one option';\n }\n\n if (this.currentStep === SurveyStep.FOLLOW_UP && this.selectedFollowUpChoices.length === 0) {\n errors['followup'] = 'Please select at least one option';\n }\n\n this.formErrors = errors;\n return Object.keys(errors).length === 0;\n }\n\n private handleChoiceSelect(choice: Choice) {\n const choiceValue = choice.value;\n const isMultipleChoice = this.config?.choiceType === 'multiChoice';\n\n if (isMultipleChoice) {\n if (this.selectedChoices.includes(choiceValue)) {\n this.selectedChoices = this.selectedChoices.filter(c => c !== choiceValue);\n this.announceToScreenReader(`Deselected: ${choice.label}`);\n } else {\n this.selectedChoices = [...this.selectedChoices, choiceValue];\n this.announceToScreenReader(`Selected: ${choice.label}`);\n }\n } else {\n this.selectedChoices = [choiceValue];\n this.announceToScreenReader(`Selected: ${choice.label}`);\n }\n\n // Clear any validation errors when user makes a selection\n if (this.formErrors['poll']) {\n const errors = { ...this.formErrors };\n delete errors['poll'];\n this.formErrors = errors;\n }\n }\n\n private handleFollowUpChoiceSelect(choice: Choice) {\n const choiceValue = choice.value;\n if (this.selectedFollowUpChoices.includes(choiceValue)) {\n this.selectedFollowUpChoices = this.selectedFollowUpChoices.filter(c => c !== choiceValue);\n } else {\n this.selectedFollowUpChoices = [...this.selectedFollowUpChoices, choiceValue];\n }\n }\n\n private handleRespondentDetailChange(key: string, event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const detail = this.respondentDetails.find(d => d.value === key);\n const inputType = detail?.inputType || 'text';\n let value: string;\n\n if (target.type === 'checkbox') {\n // Handle checkbox inputs - maintain comma-separated list using browser-compatible helpers\n const currentValue = this.userRespondentDetails[key] || '';\n const sanitizedCheckboxValue = sanitizeInput(target.value, 100);\n if (target.checked) {\n value = addToCommaSeparatedList(currentValue, sanitizedCheckboxValue);\n } else {\n value = removeFromCommaSeparatedList(currentValue, sanitizedCheckboxValue);\n }\n } else {\n // Handle all other input types (text, email, number, radio, select)\n // Sanitize based on field type\n value = sanitizeByType(target.value, inputType);\n }\n\n this.userRespondentDetails = {\n ...this.userRespondentDetails,\n [key]: value,\n };\n }\n\n private createInputHandler(fieldValue: string) {\n const self = this;\n return function (e: Event) {\n self.handleRespondentDetailChange(fieldValue, e);\n };\n }\n\n private isValueInArray(array: string[], value: string): boolean {\n for (let i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return true;\n }\n }\n return false;\n }\n\n private renderField(detail: RespondentDetail) {\n const config = getFieldConfig(detail, this.userRespondentDetails[detail.value] || '');\n const inputHandler = this.createInputHandler(detail.value);\n\n switch (config.inputType) {\n case 'text':\n case 'email':\n case 'number':\n return (\n <input part=\"input form-input\" type={config.inputType} value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />\n );\n\n case 'dropdown':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n return (\n <select part=\"select form-select\" onChange={inputHandler} required={config.required}>\n {!config.defaultValue && (\n <option value=\"\" disabled>\n {config.placeholder}\n </option>\n )}\n {config.options.map(function (option) {\n return (\n <option key={option.value} value={option.value} selected={config.currentValue === option.value || (!config.currentValue && config.defaultValue === option.value)}>\n {option.label}\n </option>\n );\n })}\n </select>\n );\n\n case 'radio':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n return (\n <div part=\"radio-group\">\n {config.options.map(function (option) {\n return (\n <div key={option.value} part=\"radio-option\">\n <input\n part=\"radio-input\"\n type=\"radio\"\n id={config.fieldValue + '-' + option.value}\n name={config.fieldValue}\n value={option.value}\n checked={config.currentValue === option.value || (!config.currentValue && config.defaultValue === option.value)}\n onChange={inputHandler}\n required={config.required}\n />\n <label part=\"radio-label\" htmlFor={config.fieldValue + '-' + option.value}>\n {option.label}\n </label>\n </div>\n );\n })}\n </div>\n );\n\n case 'checkbox':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n const self = this;\n return (\n <div part=\"checkbox-group\">\n {config.options.map(function (option) {\n return (\n <div key={option.value} part=\"checkbox-option\">\n <input\n part=\"checkbox-input\"\n type=\"checkbox\"\n id={config.fieldValue + '-' + option.value}\n name={config.fieldValue}\n value={option.value}\n checked={self.isValueInArray(config.selectedValues, option.value)}\n onChange={inputHandler}\n />\n <label part=\"checkbox-label\" htmlFor={config.fieldValue + '-' + option.value}>\n {option.label}\n </label>\n </div>\n );\n })}\n </div>\n );\n\n default:\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n }\n\n private isRespondentDetailsValid(): boolean {\n return this.respondentDetails.every(detail => {\n const value = this.userRespondentDetails[detail.value] || '';\n const error = this.validateRespondentField(detail, value);\n return error === null;\n });\n }\n\n private renderPollStep() {\n const isFinalStep = !this.hasFollowUpStep() && !this.hasRespondentDetailsStep();\n const isMultiple = this.config?.choiceType === 'multiChoice';\n const hasError = !!this.formErrors['poll'];\n\n return (\n <div part=\"step poll-step\">\n <h2 part=\"heading poll-heading\" id=\"poll-heading\">\n {this.config?.question || 'What is your choice?'}\n </h2>\n <div\n part=\"choices-container\"\n role={isMultiple ? 'group' : 'radiogroup'}\n aria-labelledby=\"poll-heading\"\n aria-invalid={hasError}\n aria-describedby={hasError ? 'poll-error' : undefined}\n >\n {this.config?.choices?.map((choice, index) => (\n <label part=\"choice-option\" key={choice.value}>\n <input\n part={isMultiple ? 'checkbox-input' : 'radio-input'}\n type={isMultiple ? 'checkbox' : 'radio'}\n id={`poll-choice-${index}`}\n name=\"poll-choice\"\n value={choice.value}\n checked={this.selectedChoices.includes(choice.value)}\n onChange={() => this.handleChoiceSelect(choice)}\n aria-describedby={`poll-choice-${index}-label`}\n />\n <span part=\"choice-label\" id={`poll-choice-${index}-label`}>\n {choice.label}\n </span>\n </label>\n ))}\n </div>\n {hasError && (\n <div part=\"error-message\" id=\"poll-error\" role=\"alert\" aria-live=\"polite\">\n {this.formErrors['poll']}\n </div>\n )}\n <div part=\"button-container\">\n <button part=\"button next-button\" onClick={() => this.nextStep()} disabled={this.selectedChoices.length === 0}>\n {isFinalStep ? 'Submit' : 'Next'}\n </button>\n </div>\n </div>\n );\n }\n\n private renderFollowUpStep() {\n const isFinalStep = !this.hasRespondentDetailsStep();\n\n return (\n <div part=\"step follow-up-step\">\n <h2 part=\"heading follow-up-heading\">{this.config?.followUpQuestion || 'Follow-up question'}</h2>\n <div part=\"choices-container\">\n {this.config?.followUpChoices?.map(choice => (\n <label part=\"choice-option\" key={choice.value}>\n <input\n part=\"checkbox-input\"\n type=\"checkbox\"\n name=\"follow-up-choice\"\n value={choice.value}\n checked={this.selectedFollowUpChoices.includes(choice.value)}\n onChange={() => this.handleFollowUpChoiceSelect(choice)}\n />\n <span part=\"choice-label\">{choice.label}</span>\n </label>\n ))}\n </div>\n <div part=\"button-container\">\n <button part=\"button back-button\" onClick={() => this.prevStep()}>\n Back\n </button>\n <button part=\"button next-button\" onClick={() => this.nextStep()}>\n {isFinalStep ? 'Submit' : 'Next'}\n </button>\n </div>\n </div>\n );\n }\n\n private renderRespondentDetailsStep() {\n return (\n <div part=\"step respondent-details-step\">\n <h2 part=\"heading respondent-details-heading\">Tell us about yourself</h2>\n <div part=\"form-container\">\n {this.respondentDetails.map(detail => (\n <div part=\"form-field\">\n <label part=\"form-label\">\n {detail.label}\n {detail.required && <span part=\"required-indicator\"> *</span>}\n </label>\n {this.renderField(detail)}\n </div>\n ))}\n </div>\n <div part=\"button-container\">\n <button part=\"button back-button\" onClick={() => this.prevStep()}>\n Back\n </button>\n <button part=\"button submit-button\" onClick={() => this.submitResponse()} disabled={!this.isRespondentDetailsValid()}>\n Submit\n </button>\n </div>\n </div>\n );\n }\n\n private renderCompletionStep() {\n return (\n <div part=\"step completion-step\">\n <h2 part=\"heading completion-heading\">{this.completionMessage}</h2>\n </div>\n );\n }\n\n private renderCurrentStep() {\n const stepRenderers = {\n [SurveyStep.POLL]: this.renderPollStep.bind(this),\n [SurveyStep.FOLLOW_UP]: this.renderFollowUpStep.bind(this),\n [SurveyStep.RESPONDENT_DETAILS]: this.renderRespondentDetailsStep.bind(this),\n [SurveyStep.COMPLETION]: this.renderCompletionStep.bind(this),\n };\n\n const renderer = stepRenderers[this.currentStep] || stepRenderers[SurveyStep.POLL];\n\n return renderer();\n }\n\n render() {\n if (!isValidKey(this.surveyKey)) {\n return (\n <Host>\n <p part=\"message error-message\">Unable to render survey due to invalid public key</p>\n </Host>\n );\n }\n\n if (this.loading) {\n return (\n <Host>\n <p part=\"message loading-message\">Loading survey...</p>\n </Host>\n );\n }\n\n if (this.error) {\n return (\n <Host>\n <div part=\"error-container\">\n <p part=\"message error-message\">{this.error}</p>\n <button part=\"button retry-button\" onClick={() => this.retryOperation()}>\n Try again\n </button>\n </div>\n </Host>\n );\n }\n\n if (!this.config) {\n return (\n <Host>\n <div part=\"error-container\">\n <p part=\"message error-message\">No survey configuration found</p>\n <button part=\"button retry-button\" onClick={() => this.retryOperation()}>\n Try again\n </button>\n </div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div part=\"survey-container\" role=\"main\" aria-label=\"Poll Survey\">\n {this.renderCurrentStep()}\n {/* ARIA live region for screen reader announcements */}\n <div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\" part=\"announcements\">\n {this.announceMessage}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"w7DAAA,IAAMA,EAAgB,okCCGtB,IAAMC,EAAsBC,EAAID,oBAChC,IAAME,EAAwBD,EAAIC,sBAElC,IAAKC,GAAL,SAAKA,GACHA,IAAA,kBACAA,IAAA,4BACAA,IAAA,8CACAA,IAAA,6BACD,EALD,CAAKA,MAKJ,K,IA4CYC,EAAUC,EAAA,yBALvB,SAAAC,EAAAC,G,UAUUC,KAAiBC,kBAAW,+BAE3BD,KAAME,OAAwB,KAE9BF,KAAiBG,kBAAuB,GAExCH,KAAOI,QAAY,MAEnBJ,KAAKK,MAAkB,KAEvBL,KAAAM,YAA0BX,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AvF,EAAA7F,KACE,IAAKiB,EAAWjB,KAAKkB,WAAY,CAC/B,OACE6H,EAACsC,EAAI,KACHtC,EAAA,KAAGC,KAAK,yBAA6E,qD,CAK3F,GAAIhJ,KAAKI,QAAS,CAChB,OACE2I,EAACsC,EAAI,KACHtC,EAAA,KAAGC,KAAK,2BAA+C,qB,CAK7D,GAAIhJ,KAAKK,MAAO,CACd,OACE0I,EAACsC,EAAI,KACHtC,EAAK,OAAAC,KAAK,mBACRD,EAAA,KAAGC,KAAK,yBAAyBhJ,KAAKK,OACtC0I,EAAA,UAAQC,KAAK,sBAAsB4B,QAAS,WAAM,OAAA/E,EAAKxD,gBAAL,GAAqB,c,CAQ/E,IAAKrC,KAAKE,OAAQ,CAChB,OACE6I,EAACsC,EAAI,KACHtC,EAAK,OAAAC,KAAK,mBACRD,EAAG,KAAAC,KAAK,yBAAyD,iCACjED,EAAA,UAAQC,KAAK,sBAAsB4B,QAAS,WAAM,OAAA/E,EAAKxD,gBAAL,GAAqB,c,CAQ/E,OACE0G,EAACsC,EAAI,KACHtC,EAAK,OAAAC,KAAK,mBAAmBuB,KAAK,OAAM,aAAY,eACjDvK,KAAKgL,oBAENjC,EAAA,mBAAe,SAAqB,qBAAOuC,MAAM,UAAUtC,KAAK,iBAC7DhJ,KAAKY,kB,uHAvlBK,I","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as t,E as e,h as i,H as n,g as r}from"./p-XYfqntZe.js";import{i as o,g as s,s as a,a as l,r as h,b as u}from"./p-CfdIRf0W.js";const c=":host{display:block}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}input:focus,select:focus,button:focus{outline:2px solid #005fcc;outline-offset:2px}[aria-invalid='true']{border-color:#d32f2f}[part='error-message']{color:#d32f2f;font-size:0.875rem;margin-top:0.25rem}[part='choice-option']{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin:0.5rem 0;cursor:pointer}[part='choice-option']:hover{background-color:rgba(0, 95, 204, 0.1)}@media (prefers-contrast: high){input:focus,select:focus,button:focus{outline:3px solid}[part='error-message']{background-color:#d32f2f;color:white;padding:0.25rem}[part='choice-option']:hover{background-color:highlight;color:highlighttext}}@media (prefers-reduced-motion: reduce){*{-webkit-animation-duration:0.01ms !important;animation-duration:0.01ms !important;-webkit-animation-iteration-count:1 !important;animation-iteration-count:1 !important;-webkit-transition-duration:0.01ms !important;transition-duration:0.01ms !important}}";const p=e.SURVEY_API_ENDPOINT;const d=e.RESPONSE_API_ENDPOINT;var f;(function(t){t[t["POLL"]=0]="POLL";t[t["FOLLOW_UP"]=1]="FOLLOW_UP";t[t["RESPONDENT_DETAILS"]=2]="RESPONDENT_DETAILS";t[t["COMPLETION"]=3]="COMPLETION"})(f||(f={}));const v=class{constructor(e){t(this,e);this.completionMessage="Thank you for your response!";this.config=null;this.respondentDetails=[];this.loading=false;this.error=null;this.currentStep=f.POLL;this.selectedChoices=[];this.selectedFollowUpChoices=[];this.userRespondentDetails={};this.submitted=false;this.announceMessage="";this.formErrors={};this.surveyStartTime=0}componentWillLoad(){if(o(this.surveyKey)){return this.fetchSurveyData()}return Promise.resolve()}async fetchSurveyData(){this.loading=true;this.error=null;this.surveyStartTime=Date.now();try{const t=await fetch(`${p}/${this.surveyKey}`);const e=await t.json();if(!e.success){throw new Error(e.message)}this.config=e.payload.config;this.respondentDetails=e.payload.respondentDetails||[]}catch(t){this.error=t instanceof Error?t.message:String(t)}finally{this.loading=false}}async retryOperation(){if(this.config){await this.submitResponse()}else{await this.fetchSurveyData()}}async submitResponse(){if(!this.config||this.submitted){return}this.loading=true;this.error=null;try{const t=this.surveyStartTime>0?Math.round((Date.now()-this.surveyStartTime)/1e3):0;const e=this.getUserAgentInfo();const i={surveyPublicKey:this.surveyKey,responseData:{selectedChoices:this.selectedChoices,selectedFollowUpChoices:this.selectedFollowUpChoices},respondentDetails:this.userRespondentDetails,userAgent:e,completionTime:t,surveyType:"fastPoll"};const n=await fetch(`${d}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});const r=await n.json();if(!r.success){throw new Error(r.message)}this.submitted=true;this.currentStep=f.COMPLETION}catch(t){this.error=t instanceof Error?t.message:String(t)}finally{this.loading=false}}getUserAgentInfo(){const t=()=>{var t;if("userAgentData"in navigator&&((t=navigator.userAgentData)===null||t===void 0?void 0:t.platform)){return navigator.userAgentData.platform}const e=navigator.userAgent;if(e.includes("Win"))return"Windows";if(e.includes("Mac"))return"macOS";if(e.includes("Linux"))return"Linux";if(e.includes("Android"))return"Android";if(e.includes("iOS"))return"iOS";return"Unknown"};return{userAgent:navigator.userAgent,language:navigator.language,platform:t(),cookieEnabled:navigator.cookieEnabled,onLine:navigator.onLine,screenResolution:`${screen.width}x${screen.height}`,colorDepth:screen.colorDepth,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:(new Date).toISOString()}}nextStep(){if(!this.validateForm()){return}if(this.currentStep===f.POLL){if(this.hasFollowUpStep()){this.currentStep=f.FOLLOW_UP;this.announceToScreenReader("Moving to follow-up question")}else if(this.hasRespondentDetailsStep()){this.currentStep=f.RESPONDENT_DETAILS;this.announceToScreenReader("Moving to respondent details")}else{this.announceToScreenReader("Submitting poll...");this.submitResponse()}}else if(this.currentStep===f.FOLLOW_UP){if(this.hasRespondentDetailsStep()){this.currentStep=f.RESPONDENT_DETAILS;this.announceToScreenReader("Moving to respondent details")}else{this.announceToScreenReader("Submitting poll...");this.submitResponse()}}else if(this.currentStep===f.RESPONDENT_DETAILS){this.announceToScreenReader("Submitting poll...");this.submitResponse()}}prevStep(){if(this.currentStep===f.FOLLOW_UP){this.currentStep=f.POLL}else if(this.currentStep===f.RESPONDENT_DETAILS){if(this.hasFollowUpStep()){this.currentStep=f.FOLLOW_UP}else{this.currentStep=f.POLL}}}hasFollowUpStep(){var t,e,i;return!!(((t=this.config)===null||t===void 0?void 0:t.followUpQuestion)&&((i=(e=this.config)===null||e===void 0?void 0:e.followUpChoices)===null||i===void 0?void 0:i.length))}hasRespondentDetailsStep(){return this.respondentDetails.length>0}announceToScreenReader(t){this.announceMessage=t;setTimeout((()=>{this.announceMessage=""}),1e3)}isValidEmail(t){const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return e.test(t.trim())}validateRespondentField(t,e){if(t.required!==false&&(!e||e.trim().length===0)){return"This field is required"}if(e&&e.trim().length>0){const i=s(t,e);if(i.inputType==="email"){if(!this.isValidEmail(e)){return"Please enter a valid email address"}}}return null}validateForm(){const t={};if(this.currentStep===f.POLL&&this.selectedChoices.length===0){t["poll"]="Please select at least one option"}if(this.currentStep===f.FOLLOW_UP&&this.selectedFollowUpChoices.length===0){t["followup"]="Please select at least one option"}this.formErrors=t;return Object.keys(t).length===0}handleChoiceSelect(t){var e;const i=t.value;const n=((e=this.config)===null||e===void 0?void 0:e.choiceType)==="multiChoice";if(n){if(this.selectedChoices.includes(i)){this.selectedChoices=this.selectedChoices.filter((t=>t!==i));this.announceToScreenReader(`Deselected: ${t.label}`)}else{this.selectedChoices=[...this.selectedChoices,i];this.announceToScreenReader(`Selected: ${t.label}`)}}else{this.selectedChoices=[i];this.announceToScreenReader(`Selected: ${t.label}`)}if(this.formErrors["poll"]){const t=Object.assign({},this.formErrors);delete t["poll"];this.formErrors=t}}handleFollowUpChoiceSelect(t){const e=t.value;if(this.selectedFollowUpChoices.includes(e)){this.selectedFollowUpChoices=this.selectedFollowUpChoices.filter((t=>t!==e))}else{this.selectedFollowUpChoices=[...this.selectedFollowUpChoices,e]}}handleRespondentDetailChange(t,e){const i=e.target;const n=this.respondentDetails.find((e=>e.value===t));const r=(n===null||n===void 0?void 0:n.inputType)||"text";let o;if(i.type==="checkbox"){const e=this.userRespondentDetails[t]||"";const n=a(i.value,100);if(i.checked){o=l(e,n)}else{o=h(e,n)}}else{o=u(i.value,r)}this.userRespondentDetails=Object.assign(Object.assign({},this.userRespondentDetails),{[t]:o})}createInputHandler(t){const e=this;return function(i){e.handleRespondentDetailChange(t,i)}}isValueInArray(t,e){for(let i=0;i<t.length;i++){if(t[i]===e){return true}}return false}renderField(t){const e=s(t,this.userRespondentDetails[t.value]||"");const n=this.createInputHandler(t.value);switch(e.inputType){case"text":case"email":case"number":return i("input",{part:"input form-input",type:e.inputType,value:e.currentValue,onInput:n,placeholder:e.placeholder,required:e.required});case"dropdown":if(!e.hasOptions){return i("input",{part:"input form-input",type:"text",value:e.currentValue,onInput:n,placeholder:e.placeholder,required:e.required})}return i("select",{part:"select form-select",onChange:n,required:e.required},!e.defaultValue&&i("option",{value:"",disabled:true},e.placeholder),e.options.map((function(t){return i("option",{key:t.value,value:t.value,selected:e.currentValue===t.value||!e.currentValue&&e.defaultValue===t.value},t.label)})));case"radio":if(!e.hasOptions){return i("input",{part:"input form-input",type:"text",value:e.currentValue,onInput:n,placeholder:e.placeholder,required:e.required})}return i("div",{part:"radio-group"},e.options.map((function(t){return i("div",{key:t.value,part:"radio-option"},i("input",{part:"radio-input",type:"radio",id:e.fieldValue+"-"+t.value,name:e.fieldValue,value:t.value,checked:e.currentValue===t.value||!e.currentValue&&e.defaultValue===t.value,onChange:n,required:e.required}),i("label",{part:"radio-label",htmlFor:e.fieldValue+"-"+t.value},t.label))})));case"checkbox":if(!e.hasOptions){return i("input",{part:"input form-input",type:"text",value:e.currentValue,onInput:n,placeholder:e.placeholder,required:e.required})}const t=this;return i("div",{part:"checkbox-group"},e.options.map((function(r){return i("div",{key:r.value,part:"checkbox-option"},i("input",{part:"checkbox-input",type:"checkbox",id:e.fieldValue+"-"+r.value,name:e.fieldValue,value:r.value,checked:t.isValueInArray(e.selectedValues,r.value),onChange:n}),i("label",{part:"checkbox-label",htmlFor:e.fieldValue+"-"+r.value},r.label))})));default:return i("input",{part:"input form-input",type:"text",value:e.currentValue,onInput:n,placeholder:e.placeholder,required:e.required})}}isRespondentDetailsValid(){return this.respondentDetails.every((t=>{const e=this.userRespondentDetails[t.value]||"";const i=this.validateRespondentField(t,e);return i===null}))}renderPollStep(){var t,e,n,r;const o=!this.hasFollowUpStep()&&!this.hasRespondentDetailsStep();const s=((t=this.config)===null||t===void 0?void 0:t.choiceType)==="multiChoice";const a=!!this.formErrors["poll"];return i("div",{part:"step poll-step"},i("h2",{part:"heading poll-heading",id:"poll-heading"},((e=this.config)===null||e===void 0?void 0:e.question)||"What is your choice?"),i("div",{part:"choices-container",role:s?"group":"radiogroup","aria-labelledby":"poll-heading","aria-invalid":a,"aria-describedby":a?"poll-error":undefined},(r=(n=this.config)===null||n===void 0?void 0:n.choices)===null||r===void 0?void 0:r.map(((t,e)=>i("label",{part:"choice-option",key:t.value},i("input",{part:s?"checkbox-input":"radio-input",type:s?"checkbox":"radio",id:`poll-choice-${e}`,name:"poll-choice",value:t.value,checked:this.selectedChoices.includes(t.value),onChange:()=>this.handleChoiceSelect(t),"aria-describedby":`poll-choice-${e}-label`}),i("span",{part:"choice-label",id:`poll-choice-${e}-label`},t.label))))),a&&i("div",{part:"error-message",id:"poll-error",role:"alert","aria-live":"polite"},this.formErrors["poll"]),i("div",{part:"button-container"},i("button",{part:"button next-button",onClick:()=>this.nextStep(),disabled:this.selectedChoices.length===0},o?"Submit":"Next")))}renderFollowUpStep(){var t,e,n;const r=!this.hasRespondentDetailsStep();return i("div",{part:"step follow-up-step"},i("h2",{part:"heading follow-up-heading"},((t=this.config)===null||t===void 0?void 0:t.followUpQuestion)||"Follow-up question"),i("div",{part:"choices-container"},(n=(e=this.config)===null||e===void 0?void 0:e.followUpChoices)===null||n===void 0?void 0:n.map((t=>i("label",{part:"choice-option",key:t.value},i("input",{part:"checkbox-input",type:"checkbox",name:"follow-up-choice",value:t.value,checked:this.selectedFollowUpChoices.includes(t.value),onChange:()=>this.handleFollowUpChoiceSelect(t)}),i("span",{part:"choice-label"},t.label))))),i("div",{part:"button-container"},i("button",{part:"button back-button",onClick:()=>this.prevStep()},"Back"),i("button",{part:"button next-button",onClick:()=>this.nextStep()},r?"Submit":"Next")))}renderRespondentDetailsStep(){return i("div",{part:"step respondent-details-step"},i("h2",{part:"heading respondent-details-heading"},"Tell us about yourself"),i("div",{part:"form-container"},this.respondentDetails.map((t=>i("div",{part:"form-field"},i("label",{part:"form-label"},t.label,t.required&&i("span",{part:"required-indicator"}," *")),this.renderField(t))))),i("div",{part:"button-container"},i("button",{part:"button back-button",onClick:()=>this.prevStep()},"Back"),i("button",{part:"button submit-button",onClick:()=>this.submitResponse(),disabled:!this.isRespondentDetailsValid()},"Submit")))}renderCompletionStep(){return i("div",{part:"step completion-step"},i("h2",{part:"heading completion-heading"},this.completionMessage))}renderCurrentStep(){const t={[f.POLL]:this.renderPollStep.bind(this),[f.FOLLOW_UP]:this.renderFollowUpStep.bind(this),[f.RESPONDENT_DETAILS]:this.renderRespondentDetailsStep.bind(this),[f.COMPLETION]:this.renderCompletionStep.bind(this)};const e=t[this.currentStep]||t[f.POLL];return e()}render(){if(!o(this.surveyKey)){return i(n,null,i("p",{part:"message error-message"},"Unable to render survey due to invalid public key"))}if(this.loading){return i(n,null,i("p",{part:"message loading-message"},"Loading survey..."))}if(this.error){return i(n,null,i("div",{part:"error-container"},i("p",{part:"message error-message"},this.error),i("button",{part:"button retry-button",onClick:()=>this.retryOperation()},"Try again")))}if(!this.config){return i(n,null,i("div",{part:"error-container"},i("p",{part:"message error-message"},"No survey configuration found"),i("button",{part:"button retry-button",onClick:()=>this.retryOperation()},"Try again")))}return i(n,null,i("div",{part:"survey-container",role:"main","aria-label":"Poll Survey"},this.renderCurrentStep(),i("div",{"aria-live":"polite","aria-atomic":"true",class:"sr-only",part:"announcements"},this.announceMessage)))}get el(){return r(this)}};v.style=c;export{v as sf_fastpoll};
2
+ //# sourceMappingURL=p-4648bca3.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sfFastpollCss","SURVEY_API_ENDPOINT","Env","RESPONSE_API_ENDPOINT","SurveyStep","SfFastpoll","constructor","hostRef","this","completionMessage","config","respondentDetails","loading","error","currentStep","POLL","selectedChoices","selectedFollowUpChoices","userRespondentDetails","submitted","announceMessage","formErrors","surveyStartTime","componentWillLoad","isValidKey","surveyKey","fetchSurveyData","Promise","resolve","Date","now","response","fetch","data","json","success","Error","message","payload","String","retryOperation","submitResponse","completionTimeSeconds","Math","round","userAgentInfo","getUserAgentInfo","submissionData","surveyPublicKey","responseData","userAgent","completionTime","surveyType","method","headers","body","JSON","stringify","result","COMPLETION","getPlatform","navigator","_a","userAgentData","platform","ua","includes","language","cookieEnabled","onLine","screenResolution","screen","width","height","colorDepth","timezone","Intl","DateTimeFormat","resolvedOptions","timeZone","timestamp","toISOString","nextStep","validateForm","hasFollowUpStep","FOLLOW_UP","announceToScreenReader","hasRespondentDetailsStep","RESPONDENT_DETAILS","prevStep","followUpQuestion","_c","_b","followUpChoices","length","setTimeout","isValidEmail","email","emailRegex","test","trim","validateRespondentField","detail","value","required","getFieldConfig","inputType","errors","Object","keys","handleChoiceSelect","choice","choiceValue","isMultipleChoice","choiceType","filter","c","label","assign","handleFollowUpChoiceSelect","handleRespondentDetailChange","key","event","target","find","d","type","currentValue","sanitizedCheckboxValue","sanitizeInput","checked","addToCommaSeparatedList","removeFromCommaSeparatedList","sanitizeByType","createInputHandler","fieldValue","self","e","isValueInArray","array","i","renderField","inputHandler","h","part","onInput","placeholder","hasOptions","onChange","defaultValue","disabled","options","map","option","selected","id","name","htmlFor","selectedValues","isRespondentDetailsValid","every","renderPollStep","isFinalStep","isMultiple","hasError","question","role","undefined","_d","choices","index","onClick","renderFollowUpStep","renderRespondentDetailsStep","renderCompletionStep","renderCurrentStep","stepRenderers","bind","renderer","render","Host","class"],"sources":["src/components/sf-fastpoll/sf-fastpoll.css?tag=sf-fastpoll&encapsulation=shadow","src/components/sf-fastpoll/sf-fastpoll.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n/* Screen reader only content */\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Focus indicators for accessibility */\ninput:focus,\nselect:focus,\nbutton:focus {\n outline: 2px solid #005fcc;\n outline-offset: 2px;\n}\n\n/* Error state styling */\n[aria-invalid='true'] {\n border-color: #d32f2f;\n}\n\n[part='error-message'] {\n color: #d32f2f;\n font-size: 0.875rem;\n margin-top: 0.25rem;\n}\n\n/* Choice options styling */\n[part='choice-option'] {\n display: flex;\n align-items: center;\n margin: 0.5rem 0;\n cursor: pointer;\n}\n\n[part='choice-option']:hover {\n background-color: rgba(0, 95, 204, 0.1);\n}\n\n/* High contrast mode support */\n@media (prefers-contrast: high) {\n input:focus,\n select:focus,\n button:focus {\n outline: 3px solid;\n }\n\n [part='error-message'] {\n background-color: #d32f2f;\n color: white;\n padding: 0.25rem;\n }\n\n [part='choice-option']:hover {\n background-color: highlight;\n color: highlighttext;\n }\n}\n\n/* Reduced motion support */\n@media (prefers-reduced-motion: reduce) {\n * {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n }\n}\n","import { Component, Host, h, Prop, State, Element, Env } from '@stencil/core';\nimport { isValidKey, getFieldConfig, addToCommaSeparatedList, removeFromCommaSeparatedList, sanitizeByType, sanitizeInput } from '../../utils/utils';\n\nconst SURVEY_API_ENDPOINT = Env.SURVEY_API_ENDPOINT;\nconst RESPONSE_API_ENDPOINT = Env.RESPONSE_API_ENDPOINT;\n\nenum SurveyStep {\n POLL = 0,\n FOLLOW_UP = 1,\n RESPONDENT_DETAILS = 2,\n COMPLETION = 3,\n}\n\ninterface RespondentDetail {\n label: string;\n value: string;\n inputType: string; // 'text', 'email', 'dropdown', 'radio', 'checkbox', 'number'\n required?: boolean;\n placeholder?: string;\n options?: Array<{\n value: string;\n label: string;\n }>;\n defaultValue?: any;\n}\n\ninterface Choice {\n label: string;\n value: string;\n}\n\ninterface SurveyConfig {\n question: string;\n choiceType: string; // 'single' or 'multiple'\n choices: Choice[];\n followUpChoices?: Choice[];\n followUpQuestion?: string;\n}\n\ninterface SurveyPayload {\n config: SurveyConfig;\n respondentDetails?: RespondentDetail[];\n}\n\ninterface ApiResponse {\n success: boolean;\n message: string;\n payload: SurveyPayload;\n}\n\n@Component({\n tag: 'sf-fastpoll',\n styleUrl: 'sf-fastpoll.css',\n shadow: true,\n})\nexport class SfFastpoll {\n @Element() el: HTMLElement;\n\n @Prop() surveyKey: string;\n\n @Prop() completionMessage: string = 'Thank you for your response!';\n\n @State() config: SurveyConfig | null = null;\n\n @State() respondentDetails: RespondentDetail[] = [];\n\n @State() loading: boolean = false;\n\n @State() error: string | null = null;\n\n @State() currentStep: SurveyStep = SurveyStep.POLL;\n\n @State() selectedChoices: string[] = [];\n\n @State() selectedFollowUpChoices: string[] = [];\n\n @State() userRespondentDetails: { [key: string]: string } = {};\n\n @State() submitted: boolean = false;\n\n @State() announceMessage: string = '';\n\n @State() formErrors: { [key: string]: string } = {};\n\n private surveyStartTime: number = 0;\n\n componentWillLoad() {\n if (isValidKey(this.surveyKey)) {\n return this.fetchSurveyData();\n }\n return Promise.resolve();\n }\n\n private async fetchSurveyData() {\n this.loading = true;\n this.error = null;\n this.surveyStartTime = Date.now();\n\n try {\n const response = await fetch(`${SURVEY_API_ENDPOINT}/${this.surveyKey}`);\n const data: ApiResponse = await response.json();\n\n if (!data.success) {\n throw new Error(data.message);\n }\n\n this.config = data.payload.config;\n this.respondentDetails = data.payload.respondentDetails || [];\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error);\n } finally {\n this.loading = false;\n }\n }\n\n private async retryOperation() {\n if (this.config) {\n // If we have config, retry submission\n await this.submitResponse();\n } else {\n // Otherwise, retry fetching survey data\n await this.fetchSurveyData();\n }\n }\n\n private async submitResponse() {\n if (!this.config || this.submitted) {\n return;\n }\n\n this.loading = true;\n this.error = null;\n\n try {\n const completionTimeSeconds = this.surveyStartTime > 0 ? Math.round((Date.now() - this.surveyStartTime) / 1000) : 0;\n const userAgentInfo = this.getUserAgentInfo();\n\n const submissionData = {\n surveyPublicKey: this.surveyKey,\n responseData: {\n selectedChoices: this.selectedChoices,\n selectedFollowUpChoices: this.selectedFollowUpChoices,\n },\n respondentDetails: this.userRespondentDetails,\n userAgent: userAgentInfo,\n completionTime: completionTimeSeconds,\n surveyType: 'fastPoll',\n };\n\n const response = await fetch(`${RESPONSE_API_ENDPOINT}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(submissionData),\n });\n\n const result = await response.json();\n\n if (!result.success) {\n throw new Error(result.message);\n }\n\n this.submitted = true;\n this.currentStep = SurveyStep.COMPLETION;\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error);\n } finally {\n this.loading = false;\n }\n }\n\n private getUserAgentInfo() {\n // Use modern navigator.userAgentData when available, fallback to userAgent parsing\n const getPlatform = () => {\n if ('userAgentData' in navigator && (navigator as any).userAgentData?.platform) {\n return (navigator as any).userAgentData.platform;\n }\n // Fallback: extract platform info from userAgent\n const ua = navigator.userAgent;\n if (ua.includes('Win')) return 'Windows';\n if (ua.includes('Mac')) return 'macOS';\n if (ua.includes('Linux')) return 'Linux';\n if (ua.includes('Android')) return 'Android';\n if (ua.includes('iOS')) return 'iOS';\n return 'Unknown';\n };\n\n return {\n userAgent: navigator.userAgent,\n language: navigator.language,\n platform: getPlatform(),\n cookieEnabled: navigator.cookieEnabled,\n onLine: navigator.onLine,\n screenResolution: `${screen.width}x${screen.height}`,\n colorDepth: screen.colorDepth,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n timestamp: new Date().toISOString(),\n };\n }\n\n private nextStep() {\n if (!this.validateForm()) {\n return;\n }\n\n if (this.currentStep === SurveyStep.POLL) {\n if (this.hasFollowUpStep()) {\n this.currentStep = SurveyStep.FOLLOW_UP;\n this.announceToScreenReader('Moving to follow-up question');\n } else if (this.hasRespondentDetailsStep()) {\n this.currentStep = SurveyStep.RESPONDENT_DETAILS;\n this.announceToScreenReader('Moving to respondent details');\n } else {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n } else if (this.currentStep === SurveyStep.FOLLOW_UP) {\n if (this.hasRespondentDetailsStep()) {\n this.currentStep = SurveyStep.RESPONDENT_DETAILS;\n this.announceToScreenReader('Moving to respondent details');\n } else {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n } else if (this.currentStep === SurveyStep.RESPONDENT_DETAILS) {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n }\n\n private prevStep() {\n if (this.currentStep === SurveyStep.FOLLOW_UP) {\n this.currentStep = SurveyStep.POLL;\n } else if (this.currentStep === SurveyStep.RESPONDENT_DETAILS) {\n if (this.hasFollowUpStep()) {\n this.currentStep = SurveyStep.FOLLOW_UP;\n } else {\n this.currentStep = SurveyStep.POLL;\n }\n }\n }\n\n private hasFollowUpStep(): boolean {\n return !!(this.config?.followUpQuestion && this.config?.followUpChoices?.length);\n }\n\n private hasRespondentDetailsStep(): boolean {\n return this.respondentDetails.length > 0;\n }\n\n private announceToScreenReader(message: string) {\n this.announceMessage = message;\n setTimeout(() => {\n this.announceMessage = '';\n }, 1000);\n }\n\n private isValidEmail(email: string): boolean {\n // Basic email validation regex\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(email.trim());\n }\n\n private validateRespondentField(detail: RespondentDetail, value: string): string | null {\n if (detail.required !== false && (!value || value.trim().length === 0)) {\n return 'This field is required';\n }\n\n if (value && value.trim().length > 0) {\n const config = getFieldConfig(detail, value);\n if (config.inputType === 'email') {\n if (!this.isValidEmail(value)) {\n return 'Please enter a valid email address';\n }\n }\n }\n\n return null;\n }\n\n private validateForm(): boolean {\n const errors: { [key: string]: string } = {};\n\n if (this.currentStep === SurveyStep.POLL && this.selectedChoices.length === 0) {\n errors['poll'] = 'Please select at least one option';\n }\n\n if (this.currentStep === SurveyStep.FOLLOW_UP && this.selectedFollowUpChoices.length === 0) {\n errors['followup'] = 'Please select at least one option';\n }\n\n this.formErrors = errors;\n return Object.keys(errors).length === 0;\n }\n\n private handleChoiceSelect(choice: Choice) {\n const choiceValue = choice.value;\n const isMultipleChoice = this.config?.choiceType === 'multiChoice';\n\n if (isMultipleChoice) {\n if (this.selectedChoices.includes(choiceValue)) {\n this.selectedChoices = this.selectedChoices.filter(c => c !== choiceValue);\n this.announceToScreenReader(`Deselected: ${choice.label}`);\n } else {\n this.selectedChoices = [...this.selectedChoices, choiceValue];\n this.announceToScreenReader(`Selected: ${choice.label}`);\n }\n } else {\n this.selectedChoices = [choiceValue];\n this.announceToScreenReader(`Selected: ${choice.label}`);\n }\n\n // Clear any validation errors when user makes a selection\n if (this.formErrors['poll']) {\n const errors = { ...this.formErrors };\n delete errors['poll'];\n this.formErrors = errors;\n }\n }\n\n private handleFollowUpChoiceSelect(choice: Choice) {\n const choiceValue = choice.value;\n if (this.selectedFollowUpChoices.includes(choiceValue)) {\n this.selectedFollowUpChoices = this.selectedFollowUpChoices.filter(c => c !== choiceValue);\n } else {\n this.selectedFollowUpChoices = [...this.selectedFollowUpChoices, choiceValue];\n }\n }\n\n private handleRespondentDetailChange(key: string, event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const detail = this.respondentDetails.find(d => d.value === key);\n const inputType = detail?.inputType || 'text';\n let value: string;\n\n if (target.type === 'checkbox') {\n // Handle checkbox inputs - maintain comma-separated list using browser-compatible helpers\n const currentValue = this.userRespondentDetails[key] || '';\n const sanitizedCheckboxValue = sanitizeInput(target.value, 100);\n if (target.checked) {\n value = addToCommaSeparatedList(currentValue, sanitizedCheckboxValue);\n } else {\n value = removeFromCommaSeparatedList(currentValue, sanitizedCheckboxValue);\n }\n } else {\n // Handle all other input types (text, email, number, radio, select)\n // Sanitize based on field type\n value = sanitizeByType(target.value, inputType);\n }\n\n this.userRespondentDetails = {\n ...this.userRespondentDetails,\n [key]: value,\n };\n }\n\n private createInputHandler(fieldValue: string) {\n const self = this;\n return function (e: Event) {\n self.handleRespondentDetailChange(fieldValue, e);\n };\n }\n\n private isValueInArray(array: string[], value: string): boolean {\n for (let i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return true;\n }\n }\n return false;\n }\n\n private renderField(detail: RespondentDetail) {\n const config = getFieldConfig(detail, this.userRespondentDetails[detail.value] || '');\n const inputHandler = this.createInputHandler(detail.value);\n\n switch (config.inputType) {\n case 'text':\n case 'email':\n case 'number':\n return (\n <input part=\"input form-input\" type={config.inputType} value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />\n );\n\n case 'dropdown':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n return (\n <select part=\"select form-select\" onChange={inputHandler} required={config.required}>\n {!config.defaultValue && (\n <option value=\"\" disabled>\n {config.placeholder}\n </option>\n )}\n {config.options.map(function (option) {\n return (\n <option key={option.value} value={option.value} selected={config.currentValue === option.value || (!config.currentValue && config.defaultValue === option.value)}>\n {option.label}\n </option>\n );\n })}\n </select>\n );\n\n case 'radio':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n return (\n <div part=\"radio-group\">\n {config.options.map(function (option) {\n return (\n <div key={option.value} part=\"radio-option\">\n <input\n part=\"radio-input\"\n type=\"radio\"\n id={config.fieldValue + '-' + option.value}\n name={config.fieldValue}\n value={option.value}\n checked={config.currentValue === option.value || (!config.currentValue && config.defaultValue === option.value)}\n onChange={inputHandler}\n required={config.required}\n />\n <label part=\"radio-label\" htmlFor={config.fieldValue + '-' + option.value}>\n {option.label}\n </label>\n </div>\n );\n })}\n </div>\n );\n\n case 'checkbox':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n const self = this;\n return (\n <div part=\"checkbox-group\">\n {config.options.map(function (option) {\n return (\n <div key={option.value} part=\"checkbox-option\">\n <input\n part=\"checkbox-input\"\n type=\"checkbox\"\n id={config.fieldValue + '-' + option.value}\n name={config.fieldValue}\n value={option.value}\n checked={self.isValueInArray(config.selectedValues, option.value)}\n onChange={inputHandler}\n />\n <label part=\"checkbox-label\" htmlFor={config.fieldValue + '-' + option.value}>\n {option.label}\n </label>\n </div>\n );\n })}\n </div>\n );\n\n default:\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n }\n\n private isRespondentDetailsValid(): boolean {\n return this.respondentDetails.every(detail => {\n const value = this.userRespondentDetails[detail.value] || '';\n const error = this.validateRespondentField(detail, value);\n return error === null;\n });\n }\n\n private renderPollStep() {\n const isFinalStep = !this.hasFollowUpStep() && !this.hasRespondentDetailsStep();\n const isMultiple = this.config?.choiceType === 'multiChoice';\n const hasError = !!this.formErrors['poll'];\n\n return (\n <div part=\"step poll-step\">\n <h2 part=\"heading poll-heading\" id=\"poll-heading\">\n {this.config?.question || 'What is your choice?'}\n </h2>\n <div\n part=\"choices-container\"\n role={isMultiple ? 'group' : 'radiogroup'}\n aria-labelledby=\"poll-heading\"\n aria-invalid={hasError}\n aria-describedby={hasError ? 'poll-error' : undefined}\n >\n {this.config?.choices?.map((choice, index) => (\n <label part=\"choice-option\" key={choice.value}>\n <input\n part={isMultiple ? 'checkbox-input' : 'radio-input'}\n type={isMultiple ? 'checkbox' : 'radio'}\n id={`poll-choice-${index}`}\n name=\"poll-choice\"\n value={choice.value}\n checked={this.selectedChoices.includes(choice.value)}\n onChange={() => this.handleChoiceSelect(choice)}\n aria-describedby={`poll-choice-${index}-label`}\n />\n <span part=\"choice-label\" id={`poll-choice-${index}-label`}>\n {choice.label}\n </span>\n </label>\n ))}\n </div>\n {hasError && (\n <div part=\"error-message\" id=\"poll-error\" role=\"alert\" aria-live=\"polite\">\n {this.formErrors['poll']}\n </div>\n )}\n <div part=\"button-container\">\n <button part=\"button next-button\" onClick={() => this.nextStep()} disabled={this.selectedChoices.length === 0}>\n {isFinalStep ? 'Submit' : 'Next'}\n </button>\n </div>\n </div>\n );\n }\n\n private renderFollowUpStep() {\n const isFinalStep = !this.hasRespondentDetailsStep();\n\n return (\n <div part=\"step follow-up-step\">\n <h2 part=\"heading follow-up-heading\">{this.config?.followUpQuestion || 'Follow-up question'}</h2>\n <div part=\"choices-container\">\n {this.config?.followUpChoices?.map(choice => (\n <label part=\"choice-option\" key={choice.value}>\n <input\n part=\"checkbox-input\"\n type=\"checkbox\"\n name=\"follow-up-choice\"\n value={choice.value}\n checked={this.selectedFollowUpChoices.includes(choice.value)}\n onChange={() => this.handleFollowUpChoiceSelect(choice)}\n />\n <span part=\"choice-label\">{choice.label}</span>\n </label>\n ))}\n </div>\n <div part=\"button-container\">\n <button part=\"button back-button\" onClick={() => this.prevStep()}>\n Back\n </button>\n <button part=\"button next-button\" onClick={() => this.nextStep()}>\n {isFinalStep ? 'Submit' : 'Next'}\n </button>\n </div>\n </div>\n );\n }\n\n private renderRespondentDetailsStep() {\n return (\n <div part=\"step respondent-details-step\">\n <h2 part=\"heading respondent-details-heading\">Tell us about yourself</h2>\n <div part=\"form-container\">\n {this.respondentDetails.map(detail => (\n <div part=\"form-field\">\n <label part=\"form-label\">\n {detail.label}\n {detail.required && <span part=\"required-indicator\"> *</span>}\n </label>\n {this.renderField(detail)}\n </div>\n ))}\n </div>\n <div part=\"button-container\">\n <button part=\"button back-button\" onClick={() => this.prevStep()}>\n Back\n </button>\n <button part=\"button submit-button\" onClick={() => this.submitResponse()} disabled={!this.isRespondentDetailsValid()}>\n Submit\n </button>\n </div>\n </div>\n );\n }\n\n private renderCompletionStep() {\n return (\n <div part=\"step completion-step\">\n <h2 part=\"heading completion-heading\">{this.completionMessage}</h2>\n </div>\n );\n }\n\n private renderCurrentStep() {\n const stepRenderers = {\n [SurveyStep.POLL]: this.renderPollStep.bind(this),\n [SurveyStep.FOLLOW_UP]: this.renderFollowUpStep.bind(this),\n [SurveyStep.RESPONDENT_DETAILS]: this.renderRespondentDetailsStep.bind(this),\n [SurveyStep.COMPLETION]: this.renderCompletionStep.bind(this),\n };\n\n const renderer = stepRenderers[this.currentStep] || stepRenderers[SurveyStep.POLL];\n\n return renderer();\n }\n\n render() {\n if (!isValidKey(this.surveyKey)) {\n return (\n <Host>\n <p part=\"message error-message\">Unable to render survey due to invalid public key</p>\n </Host>\n );\n }\n\n if (this.loading) {\n return (\n <Host>\n <p part=\"message loading-message\">Loading survey...</p>\n </Host>\n );\n }\n\n if (this.error) {\n return (\n <Host>\n <div part=\"error-container\">\n <p part=\"message error-message\">{this.error}</p>\n <button part=\"button retry-button\" onClick={() => this.retryOperation()}>\n Try again\n </button>\n </div>\n </Host>\n );\n }\n\n if (!this.config) {\n return (\n <Host>\n <div part=\"error-container\">\n <p part=\"message error-message\">No survey configuration found</p>\n <button part=\"button retry-button\" onClick={() => this.retryOperation()}>\n Try again\n </button>\n </div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div part=\"survey-container\" role=\"main\" aria-label=\"Poll Survey\">\n {this.renderCurrentStep()}\n {/* ARIA live region for screen reader announcements */}\n <div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\" part=\"announcements\">\n {this.announceMessage}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"uIAAA,MAAMA,EAAgB,okCCGtB,MAAMC,EAAsBC,EAAID,oBAChC,MAAME,EAAwBD,EAAIC,sBAElC,IAAKC,GAAL,SAAKA,GACHA,IAAA,kBACAA,IAAA,4BACAA,IAAA,8CACAA,IAAA,6BACD,EALD,CAAKA,MAKJ,K,MA4CYC,EAAU,MALvB,WAAAC,CAAAC,G,UAUUC,KAAiBC,kBAAW,+BAE3BD,KAAME,OAAwB,KAE9BF,KAAiBG,kBAAuB,GAExCH,KAAOI,QAAY,MAEnBJ,KAAKK,MAAkB,KAEvBL,KAAAM,YAA0BV,EAAWW,KAErCP,KAAeQ,gBAAa,GAE5BR,KAAuBS,wBAAa,GAEpCT,KAAqBU,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AAWuD,YAAanD,KAAKsK,qBAAqBG,KAAKzK,OAG1D,MAAM0K,EAAWF,EAAcxK,KAAKM,cAAgBkK,EAAc5K,EAAWW,MAE7E,OAAOmK,G,CAGT,MAAAC,GACE,IAAK3J,EAAWhB,KAAKiB,WAAY,CAC/B,OACEsH,EAACqC,EAAI,KACHrC,EAAA,KAAGC,KAAK,yBAA6E,qD,CAK3F,GAAIxI,KAAKI,QAAS,CAChB,OACEmI,EAACqC,EAAI,KACHrC,EAAA,KAAGC,KAAK,2BAA+C,qB,CAK7D,GAAIxI,KAAKK,MAAO,CACd,OACEkI,EAACqC,EAAI,KACHrC,EAAK,OAAAC,KAAK,mBACRD,EAAA,KAAGC,KAAK,yBAAyBxI,KAAKK,OACtCkI,EAAA,UAAQC,KAAK,sBAAsB2B,QAAS,IAAMnK,KAAKgC,kBAAgB,c,CAQ/E,IAAKhC,KAAKE,OAAQ,CAChB,OACEqI,EAACqC,EAAI,KACHrC,EAAK,OAAAC,KAAK,mBACRD,EAAG,KAAAC,KAAK,yBAAyD,iCACjED,EAAA,UAAQC,KAAK,sBAAsB2B,QAAS,IAAMnK,KAAKgC,kBAAgB,c,CAQ/E,OACEuG,EAACqC,EAAI,KACHrC,EAAK,OAAAC,KAAK,mBAAmBsB,KAAK,OAAM,aAAY,eACjD9J,KAAKuK,oBAENhC,EAAA,mBAAe,SAAqB,qBAAOsC,MAAM,UAAUrC,KAAK,iBAC7DxI,KAAKY,kB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ System.register([],(function(t){"use strict";return{execute:function(){var n=t("g",(function(){}))}}}));
2
+ //# sourceMappingURL=p-BbPAtVJG.system.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"p-BbPAtVJG.system.js","sources":["@stencil/core/internal/app-globals"],"sourcesContent":["export const globalScripts = () => {};\nexport const globalStyles = \"\";\n"],"names":[],"mappings":";;;;;AAAY,SAAC,aAAa,gBAAG,MAAM;;;;;;;;"}