{"version":3,"file":"TrustVoxComponent.CSk4Pj2k.mjs","names":[],"sources":["https:/framerusercontent.com/modules/M0s2eSxGOHT0ureyAwwe/Tr1ZN1RMtjFNG8PKUMRA/TrustVoxComponent.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";var trustWidgetModelType;(function(trustWidgetModelType){trustWidgetModelType[\"productsReviews\"]=\"productsReviews\";trustWidgetModelType[\"productsStars\"]=\"productsStars\";trustWidgetModelType[\"storeReviewCarrossel\"]=\"storeReviewCarrossel\";})(trustWidgetModelType||(trustWidgetModelType={}));export function TrustvoxWidget({trustWidgetModel,storeId,limit,productId,productName,productImage}){const containerRef=useRef(null);useEffect(()=>{function limparInstanciaTrustVoxExistente(){const ID_PRODUCTS_REVIEW=\"_trustvox_widget\";const ID_STORE_REVIEW_CARROSSEL=\"_trustvox_colt\";const productsReviewDiv=document.getElementById(ID_PRODUCTS_REVIEW);const storeReviewCarrossel=document.getElementById(ID_STORE_REVIEW_CARROSSEL);console.log(\"productsReviewDiv: \",productsReviewDiv);console.log(\"storeReviewCarrossel: \",storeReviewCarrossel);// if (itemQueDeveSerLimpado == ''  productsReviewDiv) {\n// }\n}if(typeof window!==\"undefined\"){// Trustvox Reviews\nif(trustWidgetModel===\"productsReviews\"){limparInstanciaTrustVoxExistente();window._trustvox=[];window._trustvox.push([\"_storeId\",\"122419\"]);window._trustvox.push([\"_productId\",productId]);window._trustvox.push([\"_productName\",productName]);if(productImage){window._trustvox.push([\"_productPhotos\",[productImage]]);}const script=document.createElement(\"script\");script.src=\"//static.trustvox.com.br/sincero/sincero.js\";script.async=true;document.body.appendChild(script);}// Trustvox Estrelas (ainda não implementado)\nif(trustWidgetModel===\"productsStars\"){// Aqui você pode adicionar o código do widget de estrelas\n}// Trustvox Carrossel de Reviews da loja\nif(trustWidgetModel===\"storeReviewCarrossel\"){limparInstanciaTrustVoxExistente();window._trustvox_colt=[];window._trustvox_colt.push([\"_storeId\",\"122419\"]);window._trustvox_colt.push([\"_limit\",String(limit)]);const script=document.createElement(\"script\");script.src=\"//colt.trustvox.com.br/colt.min.js\";script.async=false;document.body.appendChild(script);}}},[trustWidgetModel,storeId,productImage,limit]);// Renderizações condicionais\nif(trustWidgetModel===\"productsReviews\"){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"auto\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",maxWidth:\"99dvw\",border:\"1px solid #80808029\",padding:\"0 5px\",margin:\"0 auto\",boxSizing:\"border-box\"},children:/*#__PURE__*/_jsx(\"div\",{id:\"_trustvox_widget\",className:\"ts-answer trustvox-identifier\",style:{width:\"100%\"}})});}if(trustWidgetModel===\"storeReviewCarrossel\"){return /*#__PURE__*/_jsx(\"div\",{id:\"_trustvox_colt\",className:\"trustvox-identifier\"});}return /*#__PURE__*/_jsx(\"div\",{children:\"Widget n\\xe3o implementado ou reconhecido\"});}// Default values\nTrustvoxWidget.defaultProps={storeId:\"122419\"};// Controles do Framer\naddPropertyControls(TrustvoxWidget,{trustWidgetModel:{type:ControlType.Enum,title:\"Modelo de Widget\",description:\"Qual o *modelo de Widget* ser\\xe1 exibido\",options:[\"productsReviews\",\"productsStars\",\"storeReviewCarrossel\"],optionTitles:[\"Reviews de produto\",\"Estrelas de produtos\",\"Review loja carrossel\"]},storeId:{type:ControlType.String,title:\"Store ID\",placeholder:\"Ex: 122419\",description:\"*ID da Nicephotos* no TrustVox. Valor Default\"},productId:{type:ControlType.String,title:\"SKU do produto:\",description:\"*SKU* referente ao produto que tera suas avalia\\xe7\\xf5es exibidas no widget.\",placeholder:\"Exemplo: FL_TR_30X21_CPB, FT_10X15, etc\",hidden(props){return props.trustWidgetModel!==\"productsReviews\";}},productName:{type:ControlType.String,title:\"Nome do produto:\",placeholder:\"Ex: Foto 10x15\",hidden(props){return props.trustWidgetModel!==\"productsReviews\";}},productImage:{type:ControlType.Image,title:\"Imagem Produto\",description:\"Upload de imagem do produto para exibir no componente.\",hidden(props){return props.trustWidgetModel!==\"productsReviews\";}},limit:{type:ControlType.Number,title:\"⭐ Limite de Avalia\\xe7\\xf5es\",description:\"[Somente Carrossel] Numero de cards que aparecem no carrossel trustvox\",min:3,max:20,hidden(props){return props.trustWidgetModel!==\"storeReviewCarrossel\";}}});\nexport const __FramerMetadata__ = {\"exports\":{\"TrustvoxWidget\":{\"type\":\"reactComponent\",\"name\":\"TrustvoxWidget\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TrustVoxComponent.map"],"mappings":"kTAAoa,SAAgB,EAAe,CAAC,mBAAiB,UAAQ,QAAM,YAAU,cAAY,gBAAc,CAOR,OAP4B,EAAO,KAAK,CAAC,MAAc,CAAC,SAAS,GAAkC,CAAC,IAAmG,EAAkB,SAAS,eAAe,mBAAmB,CAAO,EAAqB,SAAS,eAAe,iBAA0B,CAAC,QAAQ,IAAI,sBAAsB,EAAkB,CAAC,QAAQ,IAAI,yBAAyB,EAAqB,CAEh8B,GAAU,IAAS,OAAY,CAChC,GAAG,IAAmB,kBAAkB,CAAC,GAAkC,CAAC,EAAO,UAAU,EAAE,CAAC,EAAO,UAAU,KAAK,CAAC,WAAW,SAAS,CAAC,CAAC,EAAO,UAAU,KAAK,CAAC,aAAa,EAAU,CAAC,CAAC,EAAO,UAAU,KAAK,CAAC,eAAe,EAAY,CAAC,CAAI,GAAc,EAAO,UAAU,KAAK,CAAC,iBAAiB,CAAC,EAAa,CAAC,CAAC,CAAE,IAAM,EAAO,SAAS,cAAc,SAAS,CAAC,EAAO,IAAI,8CAA8C,EAAO,MAAM,GAAK,SAAS,KAAK,YAAY,EAAO,CAGtd,GAAG,IAAmB,uBAAuB,CAAC,GAAkC,CAAC,EAAO,eAAe,EAAE,CAAC,EAAO,eAAe,KAAK,CAAC,WAAW,SAAS,CAAC,CAAC,EAAO,eAAe,KAAK,CAAC,SAAS,OAAO,E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