1 |
- (self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[8475],{1096:(t,e,a)=>{"use strict";a.r(e);var r=a(82173),i={};for(const t in r)"default"!==t&&(i[t]=()=>r[t]);a.d(e,i)},1891:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>o});var r=a(76798),i=a.n(r)()((function(t){return t[1]}));i.push([t.id,".card-deck-wrapper[data-v-70291054]{max-height:40dvh;overflow-y:auto}",""]);const o=i},4799:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>n});var r=a(85072),i=a.n(r),o=a(82426),s={insert:"head",singleton:!1};i()(o.default,s);const n=o.default.locals||{}},12168:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});var r=a(39147),i=a(60179),o={};for(const t in i)"default"!==t&&(o[t]=()=>i[t]);a.d(e,o);a(52628);const s=(0,a(14486).default)(i.default,r.render,r.staticRenderFns,!1,null,"5b39f0ff",null).exports},12657:(t,e,a)=>{Vue.component("filter-card",a(35627).default),Vue.component("filter-modal",a(12168).default),Vue.component("filters-list",a(90904).default)},25254:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>n});var r=a(85072),i=a.n(r),o=a(1891),s={insert:"head",singleton:!1};i()(o.default,s);const n=o.default.locals||{}},32752:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>o});var r=a(61003),i={};for(const t in r)"default"!==t&&(i[t]=()=>r[t]);a.d(e,i);const o=r.default},35627:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});var r=a(1096),i=a(32752),o={};for(const t in i)"default"!==t&&(o[t]=()=>i[t]);a.d(e,o);a(60429);const s=(0,a(14486).default)(i.default,r.render,r.staticRenderFns,!1,null,"6434d020",null).exports},39147:(t,e,a)=>{"use strict";a.r(e);var r=a(82632),i={};for(const t in r)"default"!==t&&(i[t]=()=>r[t]);a.d(e,i)},49775:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>o});var r=a(88546),i={};for(const t in r)"default"!==t&&(i[t]=()=>r[t]);a.d(e,i);const o=r.default},52628:(t,e,a)=>{"use strict";a.r(e);var r=a(4799),i={};for(const t in r)"default"!==t&&(i[t]=()=>r[t]);a.d(e,i)},53346:(t,e,a)=>{"use strict";function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=Array(e);a<e;a++)r[a]=t[a];return r}a.r(e),a.d(e,{default:()=>o});const o={name:"FilterModal",props:{filter:{type:Object,default:null},isEditing:{type:Boolean,default:!1},wizardMode:{type:Boolean,default:!0}},data:function(){return{currentStep:0,formData:{title:"",keywords:[],keywords_attributes:[],context:[],irreversible:!1,filter_action:"warn",expires_in:0},newKeyword:"",selectedDuration:"0",customDuration:null,keywordErrors:{},isDuplicateError:!1,isPosting:!1,contextItems:[{value:"home",label:"Home timeline",description:"Filter content on your main feed"},{value:"public",label:"Public timelines",description:"Filter content on public and explore pages"},{value:"tags",label:"Hashtags",description:"Filter content in hashtag feeds"}],wizardSteps:[{label:"Title",field:"title"},{label:"Keywords",field:"keywords"},{label:"Action",field:"filter_action"},{label:"Context",field:"context"},{label:"Review",field:null}]}},watch:{newKeyword:{deep:!0,handler:function(t){this.validateKeywords()}}},computed:{contextItemKeys:function(){return this.contextItems.map((function(t){return t.value}))},isValid:function(){return!this.isDuplicateError&&this.formData.title&&this.formData.context.length>0&&(0===this.formData.keywords.length||this.formData.keywords.some((function(t){return t.keyword&&""!==t.keyword.trim()})))},canAddMoreKeywords:function(){return(0===this.formData.keywords.length||this.formData.keywords.length<10)&&!this.isDuplicateError},canAddMoreKeywordsWithoutDuplicate:function(){return 0===this.formData.keywords.length||this.formData.keywords.length<10},canContinue:function(){switch(this.currentStep){case 0:return this.formData.title&&""!==this.formData.title.trim();case 1:return!this.isDuplicateError&&this.formData.keywords.filter((function(t){return""!==t.keyword.trim()})).length;case 3:return this.formData.context.length>0;default:return!0}}},mounted:function(){if(document.body.classList.add("modal-open"),this.filter){if(this.formData={id:this.filter.id,title:this.filter.title||"",keywords:this.filter.keywords?r(this.filter.keywords):[],keywords_attributes:this.filter.keywords?r(this.filter.keywords):[],context:Array.isArray(this.filter.context)?r(this.filter.context):[],irreversible:this.filter.irreversible||!1,filter_action:this.filter.filter_action||"warn",expires_in:0},0===this.formData.keywords.length&&this.addKeyword(),this.filter.expires_at){var t=new Date,e=new Date(this.filter.expires_at),a=Math.floor((e-t)/1e3),i=[1800,3600,21600,43200,86400,604800].find((function(t){return Math.abs(t-a)<60}));i?this.selectedDuration=String(i):(this.selectedDuration="-1",this.customDuration=a)}}else this.addKeyword()},beforeDestroy:function(){this.isPosting=!1,document.body.classList.remove("modal-open")},methods:{addKeyword:function(){this.formData.keywords.push({keyword:"",whole_word:!0}),this.formData.keywords_attributes.push({keyword:"",whole_word:!0}),this.$set(this.keywordErrors,this.formData.keywords.length-1,"")},addKeywordFromInput:function(){if(this.newKeyword&&""!==this.newKeyword.trim()){var t=this.newKeyword.trim();this.formData.keywords.some((function(e){return e.keyword.toLowerCase()===t.toLowerCase()}))?this.isDuplicateError=!0:this.canAddMoreKeywords&&(this.formData.keywords.push({keyword:t,whole_word:!0}),this.formData.keywords_attributes.push({keyword:t,whole_word:!0}),this.newKeyword="",this.isDuplicateError=!1)}},validateKeywords:function(){var t=this,e=new Set,a=!1;return this.keywordErrors={},this.isDuplicateError=!1,this.formData.keywords.forEach((function(r,i){if(r.keyword&&""!==r.keyword.trim()){var o=r.keyword.toLowerCase().trim();e.has(o)?(t.$set(t.keywordErrors,i,"Duplicate keyword"),a=!0,t.isDuplicateError=!0):(e.add(o),t.$set(t.keywordErrors,i,""))}else t.$set(t.keywordErrors,i,"")})),!a},toggleWizardMode:function(t){this.wizardMode?(this.formData.keywords=this.formData.keywords.filter((function(t){return t.keyword&&""!==t.keyword.trim()})),this.formData.keywords_attributes=this.formData.keywords.filter((function(t){return t.keyword&&""!==t.keyword.trim()}))):this.formData.keywords.length||this.formData.keywords.push({keyword:"",whole_word:!0}),this.$emit("toggle",t.target.checked)},saveFilter:function(){var t=this;this.validateKeywords()&&this.isValid&&!this.isPosting&&(this.isPosting=!0,this.isEditing||(this.formData.keywords_attributes=this.formData.keywords.filter((function(t){return t.keyword&&""!==t.keyword.trim()}))),"-1"===this.selectedDuration&&this.customDuration?this.formData.expires_in=parseInt(this.customDuration):this.formData.expires_in=parseInt(this.selectedDuration),setTimeout((function(){t.$emit("save",t.formData),t.isPosting=!1}),1500))},checkDuplicateKeyword:function(t){var e=this.formData.keywords[t].keyword.toLowerCase().trim();return e?this.formData.keywords.some((function(a,r){return r!==t&&a.keyword&&a.keyword.toLowerCase().trim()===e}))?(this.$set(this.keywordErrors,t,"Duplicate keyword"),this.isDuplicateError=!0,!1):(this.$set(this.keywordErrors,t,""),this.isDuplicateError=Object.values(this.keywordErrors).some((function(t){return""!==t})),!0):(this.$set(this.keywordErrors,t,""),!0)},close:function(){this.closeModal()},closeModal:function(){document.body.classList.remove("modal-open"),this.$emit("close")},deleteFilter:function(){this.$emit("delete")},removeKeyword:function(t){var e=this.formData.keywords_attributes.findIndex((function(e){return e.keyword===t.keyword&&(e.id===t.id||!e.id&&!t.id)}));-1!==e&&(this.formData.keywords_attributes[e]._destroy=!0);var a=this.formData.keywords.findIndex((function(e){return e.keyword===t.keyword&&(e.id===t.id||!e.id&&!t.id)}));-1!==a&&this.formData.keywords.splice(a,1),0===this.formData.keywords.length&&this.wizardMode&&this.addKeyword(),this.validateKeywords()},toggleContext:function(t){var e=this.formData.context.indexOf(t);-1===e?this.formData.context.push(t):this.formData.context.splice(e,1)},formatContext:function(t){return{home:"Home feed",notifications:"Notifications",public:"Public feeds",thread:"Conversations",tags:"Hashtags",groups:"Groups"}[t]||t},nextStep:function(){this.validateKeywords(),this.currentStep<this.wizardSteps.length-1&&this.canContinue&&this.currentStep++},goToStep:function(t){1===this.currentStep&&this.validateKeywords(),t<=this.currentStep&&(this.currentStep=t)},toggleWholeWord:function(t){this.formData.keywords[t].whole_word=!this.formData.keywords[t].whole_word},renderActionDescription:function(){return"warn"===this.formData.filter_action?'<div><i class="fas fa-exclamation-triangle text-warning mr-1"></i> <strong>Warn</strong></div>':"blur"===this.formData.filter_action?'<div><i class="fas fa-tint mr-1 text-info"></i> <strong>Blur</strong></div>':"hide"===this.formData.filter_action?'<div><i class="fas fa-eye-slash mr-1 text-danger"></i> <strong>Hide</strong></div>':void 0},showWholeWordExplanation:function(){var t=document.createElement("div");t.classList="p-4",t.style.textAlign="left",t.style.marginTop="20px";var e=document.createElement("h4");e.textContent="Whole Word Matching",e.style.fontWeight="bold",e.style.marginBottom="15px",e.style.paddingBottom="15px",e.style.borderBottom="1px solid #ccc";var a=document.createElement("p");a.textContent="When enabled, keywords will only match complete words.",a.style.marginBottom="15px";var r=document.createElement("p");r.textContent='Example: If your keyword is "cat", it will match "I have a cat" but won\'t match "category" or "concatenate".',r.style.marginBottom="15px";var i=document.createElement("p");i.textContent="This is useful when you want to filter specific terms without affecting words that contain those letters as part of a larger word.",t.appendChild(e),t.appendChild(a),t.appendChild(r),t.appendChild(i),swal({title:"",text:"",html:!0,customClass:"word-matching-modal",content:t,confirmButtonText:"Got it",confirmButtonColor:"#6c7cff"})},showPartialPhraseExplanation:function(){var t=document.createElement("div");t.classList="p-4",t.style.textAlign="left",t.style.marginTop="20px";var e=document.createElement("h4");e.textContent="Partial Phrase Matching",e.style.fontWeight="bold",e.style.marginBottom="15px",e.style.paddingBottom="15px",e.style.borderBottom="1px solid #ccc";var a=document.createElement("p");a.textContent="When enabled, keywords will match any text containing these characters.",a.style.marginBottom="15px";var r=document.createElement("p");r.textContent='Example: If your keyword is "cat", it will match "I have a cat" as well as "category" and "concatenate".',r.style.marginBottom="15px";var i=document.createElement("p");i.textContent="This is useful when you want to filter variations of words or when the same letters might appear in different contexts.",t.appendChild(e),t.appendChild(a),t.appendChild(r),t.appendChild(i),swal({title:"",text:"",html:!0,customClass:"word-matching-modal",content:t,confirmButtonText:"Got it",confirmButtonColor:"#6c7cff"})}}}},56902:(t,e,a)=>{"use strict";a.r(e);var r=a(67897),i={};for(const t in r)"default"!==t&&(i[t]=()=>r[t]);a.d(e,i)},60179:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>o});var r=a(53346),i={};for(const t in r)"default"!==t&&(i[t]=()=>r[t]);a.d(e,i);const o=r.default},60429:(t,e,a)=>{"use strict";a.r(e);var r=a(71300),i={};for(const t in r)"default"!==t&&(i[t]=()=>r[t]);a.d(e,i)},61003:(t,e,a)=>{"use strict";function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=Array(e);a<e;a++)r[a]=t[a];return r}a.r(e),a.d(e,{default:()=>o});const o={name:"FilterCard",props:{filter:{type:Object,required:!0}},data:function(){return{checked:!0}},computed:{actionBadgeClass:function(){return{warn:"badge-warning",hide:"badge-danger",blur:"badge-light"}[this.filter.filter_action]||"badge-secondary"}},watch:{checked:{deep:!0,handler:function(t,e){var a=this;console.log(t,e),setTimeout((function(){a.checked=!0}),1e3)}}},methods:{formatContext:function(t){return{home:"Home feed",notifications:"Notifications",public:"Public feeds",thread:"Conversations",tags:"Hashtags",groups:"Groups"}[t]||t},formatExpiry:function(t){return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},formatContexts:function(){var t,e=this;if(null===(t=this.filter.context)||void 0===t||!t.length)return"";var a=this.filter.context.includes("home"),i=this.filter.context.includes("public");if(a&&i){var o=this.filter.context.filter((function(t){return"home"!==t&&"public"!==t})).map((function(t){return e.formatContext(t)}));return["Feeds"].concat(r(o)).join(", ")}return this.filter.context.map((function(t){return e.formatContext(t)})).join(", ")},formatAction:function(t){return{warn:"Warning",hide:"Hidden",block:"Blocked"}[t]||t.charAt(0).toUpperCase()+t.slice(1)},renderActionDescription:function(){return console.log(this.filter),"warn"===this.filter.filter_action?'<div><i class="fas fa-exclamation-triangle text-warning mr-1"></i> <span class="font-weight-light text-muted">Warn</span></div>':"blur"===this.filter.filter_action?'<div><i class="fas fa-tint mr-1 text-info"></i> <span class="font-weight-light text-muted">Blur</span></div>':"hide"===this.filter.filter_action?'<div><i class="fas fa-eye-slash mr-1 text-danger"></i> <span class="font-weight-light text-muted">Hide</span></div>':void 0}}}},64259:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>o});var r=a(76798),i=a.n(r)()((function(t){return t[1]}));i.push([t.id,".filter-card[data-v-6434d020]{border-radius:20px;overflow:hidden}.filter-card[data-v-6434d020]:hover{box-shadow:0 .25rem .75rem rgba(0,0,0,.1)!important}.badge-pill[data-v-6434d020]{padding:.35em .7em}.card-header[data-v-6434d020]{border-bottom:1px solid rgba(0,0,0,.05)}",""]);const o=i},67897:(t,e,a)=>{"use strict";a.r(e),a.d(e,{render:()=>r,staticRenderFns:()=>i});var r=function(){var t,e=this,a=e._self._c;return a("div",{staticClass:"pb-4"},[a("div",{staticClass:"d-flex flex-column flex-md-row justify-content-between align-items-center mb-4"},[e._m(0),e._v(" "),a("button",{staticClass:"btn btn-primary font-weight-bold rounded-pill px-3",attrs:{disabled:(null===(t=e.filters)||void 0===t?void 0:t.length)>=20},on:{click:function(t){e.showAddFilterModal=!0}}},[a("i",{staticClass:"fas fa-plus mr-1"}),e._v(" Add New Filter\n ")])]),e._v(" "),a("p",[e._v("Customize your experience with powerful content filters that screen for specific words or phrases throughout your entire account - including home and public timelines, and hashtag feeds.")]),e._v(" "),e._m(1),e._v(" "),e._m(2),e._v(" "),e.loading?a("div",{staticClass:"d-flex justify-content-center py-4"},[e._m(3)]):0===e.filters.length?a("div",{staticClass:"bg-light p-4 rounded text-center border"},[a("div",{staticClass:"py-3"},[a("i",{staticClass:"fas fa-filter text-secondary fa-3x mb-3"}),e._v(" "),a("p",{staticClass:"font-weight-bold text-secondary"},[e._v("You don't have any content filters yet.")]),e._v(" "),a("p",{staticClass:"text-muted small mt-2"},[e._v("\n Filters help you hide content containing specific words or phrases from your timelines.\n ")]),e._v(" "),a("button",{staticClass:"btn btn-outline-primary rounded-pill font-weight-light mt-2",on:{click:function(t){e.showAddFilterModal=!0}}},[a("i",{staticClass:"fas fa-plus mr-1"}),e._v(" Create Your First Filter\n ")])])]):a("div",[a("div",{staticClass:"d-flex justify-content-between align-items-center mb-3"},[e.searchQuery&&e.searchQuery.trim().length?a("p",{staticClass:"text-muted mb-0"},[a("span",{staticClass:"font-weight-bold"},[e._v(e._s(e.filteredFilters.length))]),e._v("\n "+e._s(1===e.filteredFilters.length?"filter":"filters")+" found\n ")]):a("p",{staticClass:"text-muted mb-0"},[a("span",{staticClass:"font-weight-bold"},[e._v(e._s(e.filters.length))]),e._v("\n "+e._s(1===e.filters.length?"filter":"filters")+" found\n ")]),e._v(" "),a("div",{staticClass:"input-group input-group-sm",staticStyle:{"max-width":"250px"}},[e._m(4),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.searchQuery,expression:"searchQuery"}],staticClass:"form-control border-left-0 bg-light",attrs:{type:"text",placeholder:"Search filters..."},domProps:{value:e.searchQuery},on:{input:function(t){t.target.composing||(e.searchQuery=t.target.value)}}})])]),e._v(" "),e.searchQuery&&0===e.filteredFilters.length?a("div",{staticClass:"bg-light p-4 rounded text-center border"},[a("div",{staticClass:"py-3"},[a("i",{staticClass:"fas fa-filter text-secondary fa-3x mb-3"}),e._v(" "),a("p",{staticClass:"lead text-secondary"},[e._v("You don't have any content filters that match "),a("strong",[e._v(e._s(e.searchQuery))]),e._v(".")]),e._v(" "),a("p",{staticClass:"text-muted small mt-2"},[e._v("\n Filters help you hide content containing specific words or phrases from your timelines.\n ")]),e._v(" "),a("button",{staticClass:"btn btn-outline-primary rounded-pill font-weight-light mt-2",on:{click:function(t){e.showAddFilterModal=!0}}},[a("i",{staticClass:"fas fa-plus mr-1"}),e._v(" Create new Filter\n ")])])]):e._e(),e._v(" "),a("div",{staticClass:"card-deck-wrapper"},[a("div",{staticClass:"list-group"},e._l(e.filteredFilters,(function(t){return a("filter-card",{key:t.id,attrs:{filter:t},on:{edit:e.editFilter,delete:e.deleteFilter}})})),1)])]),e._v(" "),e.showAddFilterModal||e.showEditFilterModal?a("filter-modal",{attrs:{filter:e.editingFilter,"is-editing":e.showEditFilterModal,"wizard-mode":e.wizardMode},on:{delete:e.handleFilterDelete,toggle:e.updateWizardMode,close:e.closeModals,save:e.saveFilter}}):e._e()],1)},i=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"title"},[e("h3",{staticClass:"font-weight-bold mb-0"},[t._v("\n Filters\n ")]),t._v(" "),e("p",{staticClass:"lead mb-3 mb-md-0"},[t._v("Manage your custom filters.")])])},function(){var t=this,e=t._self._c;return e("p",{staticClass:"text-muted mb-0"},[t._v("You can add up to "),e("strong",[t._v("20 filters")]),t._v(" that can have up to "),e("strong",[t._v("10 keywords")]),t._v(".")])},function(){var t=this,e=t._self._c;return e("p",{staticClass:"text-muted mb-4 small"},[t._v("Learn more in our "),e("a",{attrs:{href:"/site/help"}},[t._v("Help Center")]),t._v(".")])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border text-primary",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this._self._c;return t("div",{staticClass:"input-group-prepend"},[t("span",{staticClass:"input-group-text bg-light border-right-0"},[t("i",{staticClass:"fas fa-search text-muted"})])])}]},71300:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>n});var r=a(85072),i=a.n(r),o=a(64259),s={insert:"head",singleton:!1};i()(o.default,s);const n=o.default.locals||{}},82173:(t,e,a)=>{"use strict";a.r(e),a.d(e,{render:()=>r,staticRenderFns:()=>i});var r=function(){var t,e,a=this,r=a._self._c;return r("div",{staticClass:"list-group-item"},[r("div",{staticClass:"d-flex justify-content-between align-items-center"},[r("div",{staticClass:"filter-card-info cursor-pointer",on:{click:function(t){return a.$emit("edit",a.filter)}}},[r("div",{staticClass:"d-flex align-items-center",staticStyle:{gap:"0.5rem"}},[r("div",{staticClass:"d-flex align-items-center",staticStyle:{gap:"5px"}},[r("div",{staticClass:"font-weight-bold"},[a._v(a._s(a.filter.title))]),a._v(" "),r("div",{staticClass:"small text-muted"},[a._v("("+a._s(null!==(t=null===(e=a.filter.keywords)||void 0===e?void 0:e.length)&&void 0!==t?t:0)+")")])]),a._v(" "),r("div",{staticClass:"text-muted"},[a._v("·")]),a._v(" "),a.filter.expires_at?r("div",{staticClass:"small text-muted"},[a._v("\n Expires: "+a._s(a.formatExpiry(a.filter.expires_at))+"\n ")]):r("div",{staticClass:"small text-muted"},[a._v("\n Never expires\n ")])]),a._v(" "),r("div",[r("div",{staticClass:"text-muted small"},[a._v(a._s(a.formatAction(a.filter.filter_action))+" on "+a._s(a.formatContexts()))])])]),a._v(" "),r("div",{staticClass:"custom-control custom-switch"},[r("input",{directives:[{name:"model",rawName:"v-model",value:a.checked,expression:"checked"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"customSwitch1"},domProps:{checked:Array.isArray(a.checked)?a._i(a.checked,null)>-1:a.checked},on:{click:function(t){return a.$emit("delete",a.filter.id)},change:function(t){var e=a.checked,r=t.target,i=!!r.checked;if(Array.isArray(e)){var o=a._i(e,null);r.checked?o<0&&(a.checked=e.concat([null])):o>-1&&(a.checked=e.slice(0,o).concat(e.slice(o+1)))}else a.checked=i}}}),a._v(" "),r("label",{staticClass:"custom-control-label",attrs:{for:"customSwitch1"}})])])])},i=[]},82285:(t,e,a)=>{"use strict";a.r(e);var r=a(25254),i={};for(const t in r)"default"!==t&&(i[t]=()=>r[t]);a.d(e,i)},82426:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>o});var r=a(76798),i=a.n(r)()((function(t){return t[1]}));i.push([t.id,".custom-control-label[data-v-5b39f0ff]{cursor:pointer}.modal-content[data-v-5b39f0ff]{border-radius:.5rem}.modal-footer[data-v-5b39f0ff],.modal-header[data-v-5b39f0ff]{border-color:rgba(0,0,0,.05)}.wizard-progress[data-v-5b39f0ff]{border-bottom:1px solid rgba(0,0,0,.05);display:flex;justify-content:space-between;padding:1rem 3rem;position:relative}.wizard-progress[data-v-5b39f0ff]:after{background-color:#e9ecef;content:\"\";height:2px;left:15%;position:absolute;top:26px;width:70%;z-index:1;@media(min-width:991px){left:10%;width:80%}}.wizard-step[data-v-5b39f0ff]{cursor:pointer;opacity:1;transition:all .2s ease;z-index:2}.simple-wizard label[data-v-5b39f0ff]{font-weight:200}.simple-wizard .label[data-v-5b39f0ff]{color:var(--muted);font-size:18px;font-weight:200;margin-top:1rem;width:100%}.wizard-step.active[data-v-5b39f0ff]{opacity:1;transform:scale(1.05)}.wizard-step.completed[data-v-5b39f0ff]{opacity:1}.wizard-step-indicator[data-v-5b39f0ff]{background-color:#e9ecef;color:#6c757d;font-weight:700;height:36px;transition:all .2s ease;width:36px}.wizard-step.active .wizard-step-indicator[data-v-5b39f0ff]{background-color:#007bff;color:#fff}.wizard-step.completed .wizard-step-indicator[data-v-5b39f0ff]{background-color:#28a745;color:#fff}.wizard-step-label[data-v-5b39f0ff]{font-weight:500;white-space:nowrap}.wizard-content[data-v-5b39f0ff]{max-height:50dvh;@media(min-width:991px){min-height:70dvh}}.step-content[data-v-5b39f0ff]{animation:fadeIn-5b39f0ff .5s}.step-content-info[data-v-5b39f0ff]{align-items:center;display:flex;flex-direction:column;justify-content:center;margin:1.5rem auto 2rem;padding-bottom:3rem}.step-content-info-icon[data-v-5b39f0ff]{align-items:center;border:1px solid #bbb;border-radius:100%;color:#bbb;display:none;justify-content:center;margin-bottom:2rem;padding:2rem;text-align:center;@media(min-width:991px){display:flex}}.step-content-info-icon i[data-v-5b39f0ff]{color:#bbb}.context-card[data-v-5b39f0ff],.filter-action-card[data-v-5b39f0ff]{border:1px solid #dee2e6;cursor:pointer;transition:all .2s ease}.context-card[data-v-5b39f0ff]:hover,.filter-action-card[data-v-5b39f0ff]:hover{border-color:#c8d1d9;box-shadow:0 .25rem .75rem rgba(0,0,0,.1)}.context-card.selected[data-v-5b39f0ff],.filter-action-card.selected[data-v-5b39f0ff]{border-color:#007bff;box-shadow:0 0 0 2px rgba(0,123,255,.25)}.keyword-item[data-v-5b39f0ff]{transition:all .3s ease}.keyword-item[data-v-5b39f0ff]:hover{transform:translateY(-2px)}.is-invalid[data-v-5b39f0ff]{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E\")!important;background-position:right calc(.375em + .1875rem) center!important;background-repeat:no-repeat!important;background-size:calc(.75em + .375rem) calc(.75em + .375rem)!important;border-color:#dc3545!important;padding-right:calc(1.5em + .75rem)!important}.invalid-feedback[data-v-5b39f0ff],.text-danger[data-v-5b39f0ff]{animation:fadeIn-5b39f0ff .3s;display:block}.alert[data-v-5b39f0ff]{animation:fadeIn-5b39f0ff .3s}.keyword-tags[data-v-5b39f0ff]{min-height:100px}.form-control-mat[data-v-5b39f0ff],.keyword-tags[data-v-5b39f0ff]{background-color:#f7f7fa;border:1px solid #e5e5e5;border-radius:30px}.keyword-tag[data-v-5b39f0ff]{background-color:#e1e1e1;font-size:.9rem;font-weight:700}.keyword-tag-whole[data-v-5b39f0ff]{background-color:#e1e1e1;border:2px solid #e1e1e1}.keyword-tag-partial[data-v-5b39f0ff]{background-color:#fff;border:2px dashed #e1e1e1}.keyword-tag-partial-times[data-v-5b39f0ff],.keyword-tag-whole-times[data-v-5b39f0ff]{color:var(--muted)}.filter-action-options .custom-control[data-v-5b39f0ff]{padding-left:2rem}.custom-control-input:checked~.custom-control-label[data-v-5b39f0ff]:before{background-color:#6c7cff;border-color:#6c7cff}.wizard-mode .keyword-item .is-invalid[data-v-5b39f0ff]{background-position:right calc(.375em + .5rem) center!important}body.modal-open[data-v-5b39f0ff]{overflow:hidden;position:fixed;width:100%}.modal-dialog-scrollable .modal-body[data-v-5b39f0ff]{max-height:70vh!important;overflow-y:auto!important}.modal-dialog-scrollable .modal-content[data-v-5b39f0ff]{max-height:85vh}.slide-fade-enter-active[data-v-5b39f0ff],.slide-fade-leave-active[data-v-5b39f0ff]{transition:all .1s}.slide-fade-enter[data-v-5b39f0ff],.slide-fade-leave-to[data-v-5b39f0ff]{opacity:0;transform:translateX(10px)}@keyframes fadeIn-5b39f0ff{0%{opacity:0;transform:translateX(10px)}to{opacity:1;transform:translateX(0)}}",""]);const o=i},82632:(t,e,a)=>{"use strict";a.r(e),a.d(e,{render:()=>r,staticRenderFns:()=>i});var r=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"modal-backdrop fade show"}),t._v(" "),e("div",{staticClass:"modal fade show",staticStyle:{display:"block"},attrs:{"data-backdrop":"static","data-keyboard":"false",tabindex:"-1","aria-hidden":"true"}},[e("div",{staticClass:"modal-dialog modal-dialog-centered modal-dialog-scrollable modal-lg"},[e("div",{staticClass:"modal-content border-0 shadow"},[e("div",{staticClass:"modal-header bg-light d-flex align-items-center"},[e("h5",{staticClass:"modal-title font-weight-bold"},[e("i",{staticClass:"fal fa-filter text-dark mr-2"}),t._v("\n "+t._s(t.isEditing?"Edit Filter":"Create Filter")+"\n ")]),t._v(" "),e("div",{staticClass:"ml-auto d-flex align-items-center"},[e("div",{staticClass:"custom-control custom-switch mr-3"},[e("input",{staticClass:"custom-control-input",attrs:{type:"checkbox",id:"wizard-toggle"},domProps:{checked:t.wizardMode},on:{change:function(e){return t.toggleWizardMode(e)}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"wizard-toggle"}},[e("small",[t._v(t._s(t.wizardMode?"Simple Mode":"Advanced Mode"))])])]),t._v(" "),e("button",{staticClass:"close",attrs:{type:"button"},on:{click:function(e){return t.closeModal()}}},[t._m(0)])])]),t._v(" "),t.wizardMode?e("form",[e("div",{staticClass:"modal-body p-0"},[e("div",{staticClass:"wizard-progress bg-light py-2 px-md-5 d-flex justify-content-between"},t._l(t.wizardSteps,(function(a,r){return e("div",{key:r,staticClass:"wizard-step d-flex flex-column align-items-center px-md-2 position-relative",class:{active:t.currentStep===r,completed:t.currentStep>r},on:{click:function(e){return t.goToStep(r)}}},[e("div",{staticClass:"wizard-step-indicator rounded-circle d-flex align-items-center justify-content-center mb-1"},[t.currentStep>r?e("span",[e("i",{staticClass:"fas fa-check"})]):e("span",[t._v(t._s(r+1))])]),t._v(" "),e("span",{staticClass:"wizard-step-label small",class:[t.currentStep===r?"text-dark font-weight-bold":"text-lighter text-weight-light"]},[t._v(t._s(a.label)+"\n ")])])})),0),t._v(" "),e("div",{staticClass:"wizard-content py-4 px-3 px-md-5"},[0===t.currentStep?e("div",{key:"step1",staticClass:"step-content"},[t._m(7),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"wizard-title"}},[t._v("Filter title")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.title,expression:"formData.title"}],staticClass:"form-control form-control-lg",attrs:{type:"text",id:"wizard-title",placeholder:"My filter name",required:""},domProps:{value:t.formData.title},on:{input:function(e){e.target.composing||t.$set(t.formData,"title",e.target.value)}}})]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"wizard-duration"}},[t._v("Filter Duration")]),t._v(" "),e("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedDuration,expression:"selectedDuration"}],staticClass:"custom-select",attrs:{id:"wizard-duration"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.selectedDuration=e.target.multiple?a:a[0]}}},[e("option",{attrs:{value:"0"}},[t._v("Forever")]),t._v(" "),e("option",{attrs:{value:"1800"}},[t._v("30 minutes")]),t._v(" "),e("option",{attrs:{value:"3600"}},[t._v("1 hour")]),t._v(" "),e("option",{attrs:{value:"21600"}},[t._v("6 hours")]),t._v(" "),e("option",{attrs:{value:"43200"}},[t._v("12 hours")]),t._v(" "),e("option",{attrs:{value:"86400"}},[t._v("1 day")]),t._v(" "),e("option",{attrs:{value:"604800"}},[t._v("1 week")]),t._v(" "),e("option",{attrs:{value:"-1"}},[t._v("Custom...")])]),t._v(" "),"-1"===t.selectedDuration?e("div",{staticClass:"input-group mt-2"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.customDuration,expression:"customDuration"}],staticClass:"form-control",attrs:{type:"number",min:"1",max:"63072000",placeholder:"Enter duration in seconds"},domProps:{value:t.customDuration},on:{input:function(e){e.target.composing||(t.customDuration=e.target.value)}}}),t._v(" "),t._m(8)]):t._e()])]):t._e(),t._v(" "),1===t.currentStep?e("div",{key:"step2",staticClass:"step-content"},[t._m(9),t._v(" "),e("div",{staticClass:"keywords-container d-flex flex-column align-items-center"},[t._l(t.formData.keywords,(function(a,r){return e("div",{key:r,staticClass:"keyword-item mb-4 position-relative w-75"},[e("div",{staticClass:"input-group"},[e("input",{directives:[{name:"model",rawName:"v-model",value:a.keyword,expression:"keyword.keyword"}],staticClass:"form-control form-control-lg border-right-0",class:{"border-primary":a.whole_word&&!t.keywordErrors[r],"border-info":!a.whole_word&&!t.keywordErrors[r],"is-invalid":t.keywordErrors[r]},attrs:{type:"text",placeholder:"Enter keyword or phrase",maxlength:"40"},domProps:{value:a.keyword},on:{input:[function(e){e.target.composing||t.$set(a,"keyword",e.target.value)},function(e){return t.checkDuplicateKeyword(r)}]}}),t._v(" "),e("div",{staticClass:"input-group-append"},[e("button",{staticClass:"btn btn-outline-secondary border-left-0 bg-white",class:{"text-primary":a.whole_word,"text-info":!a.whole_word},attrs:{type:"button"},on:{click:function(e){return t.toggleWholeWord(r)}}},[e("i",{staticClass:"fas",class:{"fa-font":a.whole_word,"fa-text-width":!a.whole_word}})]),t._v(" "),e("button",{staticClass:"btn btn-outline-danger",attrs:{type:"button"},on:{click:function(e){return t.removeKeyword(a)}}},[e("i",{staticClass:"fas fa-trash"})])])]),t._v(" "),t.keywordErrors[r]?e("div",{staticClass:"text-danger small mt-1"},[e("i",{staticClass:"fas fa-exclamation-circle mr-1"}),t._v("\n "+t._s(t.keywordErrors[r])+"\n ")]):t._e(),t._v(" "),e("small",{staticClass:"text-muted"},[t._v("\n "+t._s(a.whole_word?'Whole word match - filters exact matches only (e.g. "book" won\'t match "bookstore")':'Partial word match - filters any content containing this text (e.g. "book" will match "bookstore")')+"\n ")])])})),t._v(" "),t.canAddMoreKeywords?e("button",{staticClass:"btn btn-outline-primary mt-3 font-weight-light rounded-pill",attrs:{type:"button"},on:{click:t.addKeyword}},[e("i",{staticClass:"fas fa-plus mr-1"}),t._v(" Add another keyword\n ")]):t._e(),t._v(" "),t.isDuplicateError?e("div",{staticClass:"alert alert-warning mt-4 w-75"},[e("i",{staticClass:"fas fa-exclamation-triangle mr-2"}),t._v("\n Please remove duplicate keywords before continuing\n ")]):t._e()],2)]):t._e(),t._v(" "),2===t.currentStep?e("div",{key:"step3",staticClass:"step-content"},[t._m(10),t._v(" "),e("div",{staticClass:"card-deck"},[e("div",{staticClass:"card shadow-none text-center p-3 filter-action-card",class:{selected:"blur"===t.formData.filter_action},on:{click:function(e){t.formData.filter_action="blur"}}},[t._m(11)]),t._v(" "),e("div",{staticClass:"card shadow-none text-center p-3 filter-action-card",class:{selected:"warn"===t.formData.filter_action},on:{click:function(e){t.formData.filter_action="warn"}}},[t._m(12)]),t._v(" "),e("div",{staticClass:"card shadow-none text-center p-3 filter-action-card",class:{selected:"hide"===t.formData.filter_action},on:{click:function(e){t.formData.filter_action="hide"}}},[t._m(13)])])]):t._e(),t._v(" "),3===t.currentStep?e("div",{key:"step4",staticClass:"step-content"},[t._m(14),t._v(" "),e("div",{staticClass:"row"},t._l(t.contextItems,(function(a){return e("div",{key:a.value,staticClass:"col-md-6 mb-3"},[e("div",{staticClass:"card shadow-none rounded-lg context-card p-3 h-100",class:{selected:t.formData.context.includes(a.value)},on:{click:function(e){return t.toggleContext(a.value)}}},[e("div",{staticClass:"card-body d-flex align-items-center"},[e("div",{staticClass:"custom-control custom-checkbox mr-2"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.context,expression:"formData.context"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"wizard-context-".concat(a.value)},domProps:{value:a.value,checked:Array.isArray(t.formData.context)?t._i(t.formData.context,a.value)>-1:t.formData.context},on:{change:function(e){var r=t.formData.context,i=e.target,o=!!i.checked;if(Array.isArray(r)){var s=a.value,n=t._i(r,s);i.checked?n<0&&t.$set(t.formData,"context",r.concat([s])):n>-1&&t.$set(t.formData,"context",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.formData,"context",o)}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"wizard-context-".concat(a.value)}})]),t._v(" "),e("div",[e("h5",{staticClass:"mb-1"},[t._v(t._s(a.label))]),t._v(" "),e("p",{staticClass:"text-muted mb-0 small"},[t._v(t._s(a.description))])])])])])})),0)]):t._e(),t._v(" "),4===t.currentStep?e("div",{key:"step5",staticClass:"step-content"},[t._m(15),t._v(" "),e("div",{staticClass:"card shadow-none border rounded-lg mb-3"},[e("div",{staticClass:"card-header bg-light"},[e("h5",{staticClass:"mb-0 text-center font-weight-light"},[t._v(t._s(t.formData.title||"Untitled Filter"))])]),t._v(" "),e("div",{staticClass:"card-body"},[e("div",{staticClass:"row mb-3"},[e("div",{staticClass:"col-md-4 font-weight-bold"},[t._v("Keywords:")]),t._v(" "),e("div",{staticClass:"col-md-8"},[t.formData.keywords.length>0?e("div",t._l(t.formData.keywords.filter((function(t){return t.keyword})),(function(a,r){return e("span",{key:r,staticClass:"badge badge-pill badge-light badge-lg border mr-1 mb-1 p-2"},[t._v("\n "+t._s(a.keyword)+"\n "),a.whole_word?e("span",{staticClass:"small font-italic ml-1"},[t._v("(whole)")]):t._e()])})),0):e("span",{staticClass:"text-muted"},[t._v("No keywords specified")])])]),t._v(" "),e("div",{staticClass:"row mb-4"},[e("div",{staticClass:"col-md-4 font-weight-bold"},[t._v("Action:")]),t._v(" "),e("div",{staticClass:"col-md-8"},[e("span",{staticClass:"font-weight-bold mb-1"},[e("div",{domProps:{innerHTML:t._s(t.renderActionDescription())}})])])]),t._v(" "),e("div",{staticClass:"row mb-3"},[e("div",{staticClass:"col-md-4 font-weight-bold"},[t._v("Applied to:")]),t._v(" "),e("div",{staticClass:"col-md-8"},t._l(t.formData.context,(function(a){return e("span",{key:a,staticClass:"badge badge-pill badge-light border mr-1 mb-1 p-2"},[t._v("\n "+t._s(t.formatContext(a))+"\n ")])})),0)]),t._v(" "),e("div",{staticClass:"row mb-3"},[e("div",{staticClass:"col-md-4 font-weight-bold"},[t._v("Duration:")]),t._v(" "),e("div",{staticClass:"col-md-8 text-muted small"},["0"===t.selectedDuration?e("span",[t._v("Forever")]):"1800"===t.selectedDuration?e("span",[t._v("30 minutes")]):"3600"===t.selectedDuration?e("span",[t._v("1 hour")]):"21600"===t.selectedDuration?e("span",[t._v("6 hours")]):"43200"===t.selectedDuration?e("span",[t._v("12 hours")]):"86400"===t.selectedDuration?e("span",[t._v("1 day")]):"604800"===t.selectedDuration?e("span",[t._v("1 week")]):"-1"===t.selectedDuration?e("span",[t._v(t._s(t.customDuration)+" seconds")]):t._e()])])])])]):t._e()])]),t._v(" "),e("div",{staticClass:"modal-footer bg-light justify-content-between"},[e("div",[e("button",{staticClass:"btn btn-outline-secondary font-weight-light rounded-pill",attrs:{type:"button"},on:{click:function(e){t.currentStep>0?t.currentStep--:t.closeModal()}}},[t._v("\n "+t._s(t.currentStep>0?"Back":"Cancel")+"\n ")]),t._v(" "),t.isEditing?e("button",{staticClass:"btn btn-outline-danger font-weight-light rounded-pill",attrs:{type:"button"},on:{click:function(e){return t.deleteFilter()}}},[t._v("\n Delete\n ")]):t._e()]),t._v(" "),e("div",[t.currentStep<t.wizardSteps.length-1?e("button",{staticClass:"btn btn-primary font-weight-bold rounded-pill",attrs:{type:"button",disabled:!t.canContinue},on:{click:t.nextStep}},[t._v("\n Continue\n ")]):e("button",{staticClass:"btn btn-success font-weight-bold rounded-pill",attrs:{type:"button",disabled:!t.isValid||t.isPosting},on:{click:t.saveFilter}},[t.isPosting?[t._m(16)]:[t._v("\n "+t._s(t.isEditing?"Save Changes":"Create Filter")+"\n ")]],2)])])]):e("form",{staticClass:"simple-wizard",on:{submit:function(e){return e.preventDefault(),t.saveFilter.apply(null,arguments)}}},[e("div",{staticClass:"modal-body px-4"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"label",attrs:{for:"title"}},[t._v("Filter title")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.title,expression:"formData.title"}],staticClass:"form-control form-control-lg form-control-mat",attrs:{type:"text",id:"title",placeholder:"Enter filter title",required:""},domProps:{value:t.formData.title},on:{input:function(e){e.target.composing||t.$set(t.formData,"title",e.target.value)}}})]),t._v(" "),e("div",{staticClass:"form-group"},[e("div",{staticClass:"d-flex justify-content-between align-items-center"},[t._m(1),t._v(" "),e("div",{staticClass:"d-flex justify-content-between align-items-center",staticStyle:{gap:"1rem"}},[e("p",{staticClass:"small text-muted mb-0"},[t._v("Legend")]),t._v(" "),e("button",{staticClass:"btn btn-xs rounded-pill keyword-tag keyword-tag-whole py-1 px-3",attrs:{type:"button"},on:{click:function(e){return t.showWholeWordExplanation()}}},[e("i",{staticClass:"far fa-info-circle mr-1"}),t._v("\n Whole word\n ")]),t._v(" "),e("button",{staticClass:"btn btn-xs rounded-pill keyword-tag keyword-tag-partial py-1 px-3",attrs:{type:"button"},on:{click:function(e){return t.showPartialPhraseExplanation()}}},[e("i",{staticClass:"far fa-info-circle mr-1"}),t._v("\n Partial word\n ")])])]),t._v(" "),e("div",{staticClass:"keyword-tags p-2"},[e("div",{staticClass:"d-flex flex-wrap"},[t._l(t.formData.keywords,(function(a,r){return e("div",{key:r,staticClass:"keyword-tag rounded-pill px-3 py-1 mr-2 mb-2 d-flex align-items-center",class:{"keyword-tag-whole":a.whole_word,"keyword-tag-partial":!a.whole_word}},[e("div",{staticClass:"cursor-pointer",on:{click:function(e){return t.toggleWholeWord(r)}}},[t._v("\n "+t._s(a.keyword)+"\n ")]),t._v(" "),e("button",{staticClass:"btn btn-sm p-0 ml-2",class:{"keyword-tag-whole-times":a.whole_word,"keyword-tag-partial-times":!a.whole_word},attrs:{type:"button"},on:{click:function(e){return t.removeKeyword(a)}}},[e("i",{staticClass:"fas fa-times"})])])})),t._v(" "),t.canAddMoreKeywordsWithoutDuplicate?e("input",{directives:[{name:"model",rawName:"v-model",value:t.newKeyword,expression:"newKeyword"}],staticClass:"form-control border-0 bg-transparent rounded-pill flex-grow-1 mb-2",staticStyle:{"min-width":"150px"},attrs:{type:"text",maxlength:40,placeholder:"Add a keyword..."},domProps:{value:t.newKeyword},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.addKeywordFromInput.apply(null,arguments))},input:function(e){e.target.composing||(t.newKeyword=e.target.value)}}}):t._e()],2)]),t._v(" "),t.isDuplicateError?e("div",{staticClass:"alert alert-warning rounded-lg mt-2 p-2 small"},[e("i",{staticClass:"fas fa-exclamation-triangle mr-1"}),t._v("\n Duplicate keywords are not allowed\n ")]):t._e()]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"label"},[t._v("Filter Action")]),t._v(" "),e("div",{staticClass:"filter-action-options"},[e("div",{staticClass:"custom-control custom-radio mb-2"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.filter_action,expression:"formData.filter_action"}],staticClass:"custom-control-input",attrs:{type:"radio",id:"action-blur",name:"filter_action",value:"blur"},domProps:{checked:t._q(t.formData.filter_action,"blur")},on:{change:function(e){return t.$set(t.formData,"filter_action","blur")}}}),t._v(" "),t._m(2)]),t._v(" "),e("div",{staticClass:"custom-control custom-radio mb-2"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.filter_action,expression:"formData.filter_action"}],staticClass:"custom-control-input",attrs:{type:"radio",id:"action-warn",name:"filter_action",value:"warn"},domProps:{checked:t._q(t.formData.filter_action,"warn")},on:{change:function(e){return t.$set(t.formData,"filter_action","warn")}}}),t._v(" "),t._m(3)]),t._v(" "),e("div",{staticClass:"custom-control custom-radio mb-2"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.filter_action,expression:"formData.filter_action"}],staticClass:"custom-control-input",attrs:{type:"radio",id:"action-hide",name:"filter_action",value:"hide"},domProps:{checked:t._q(t.formData.filter_action,"hide")},on:{change:function(e){return t.$set(t.formData,"filter_action","hide")}}}),t._v(" "),t._m(4)])])]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"label"},[t._v("Apply filters to")]),t._v(" "),e("div",{staticClass:"row"},[t.contextItemKeys.includes("home")?e("div",{staticClass:"col-6 mb-2"},[e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.context,expression:"formData.context"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"context-home",value:"home"},domProps:{checked:Array.isArray(t.formData.context)?t._i(t.formData.context,"home")>-1:t.formData.context},on:{change:function(e){var a=t.formData.context,r=e.target,i=!!r.checked;if(Array.isArray(a)){var o="home",s=t._i(a,o);r.checked?s<0&&t.$set(t.formData,"context",a.concat([o])):s>-1&&t.$set(t.formData,"context",a.slice(0,s).concat(a.slice(s+1)))}else t.$set(t.formData,"context",i)}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"context-home"}},[t._v("\n Home timeline\n ")])])]):t._e(),t._v(" "),t.contextItemKeys.includes("notifications")?e("div",{staticClass:"col-6 mb-2"},[e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.context,expression:"formData.context"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"context-notifications",value:"notifications"},domProps:{checked:Array.isArray(t.formData.context)?t._i(t.formData.context,"notifications")>-1:t.formData.context},on:{change:function(e){var a=t.formData.context,r=e.target,i=!!r.checked;if(Array.isArray(a)){var o="notifications",s=t._i(a,o);r.checked?s<0&&t.$set(t.formData,"context",a.concat([o])):s>-1&&t.$set(t.formData,"context",a.slice(0,s).concat(a.slice(s+1)))}else t.$set(t.formData,"context",i)}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"context-notifications"}},[t._v("\n Notifications\n ")])])]):t._e(),t._v(" "),t.contextItemKeys.includes("public")?e("div",{staticClass:"col-6 mb-2"},[e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.context,expression:"formData.context"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"context-public",value:"public"},domProps:{checked:Array.isArray(t.formData.context)?t._i(t.formData.context,"public")>-1:t.formData.context},on:{change:function(e){var a=t.formData.context,r=e.target,i=!!r.checked;if(Array.isArray(a)){var o="public",s=t._i(a,o);r.checked?s<0&&t.$set(t.formData,"context",a.concat([o])):s>-1&&t.$set(t.formData,"context",a.slice(0,s).concat(a.slice(s+1)))}else t.$set(t.formData,"context",i)}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"context-public"}},[t._v("\n Public timelines\n ")])])]):t._e(),t._v(" "),t.contextItemKeys.includes("tags")?e("div",{staticClass:"col-6 mb-2"},[e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.context,expression:"formData.context"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"context-hashtags",value:"tags"},domProps:{checked:Array.isArray(t.formData.context)?t._i(t.formData.context,"tags")>-1:t.formData.context},on:{change:function(e){var a=t.formData.context,r=e.target,i=!!r.checked;if(Array.isArray(a)){var o="tags",s=t._i(a,o);r.checked?s<0&&t.$set(t.formData,"context",a.concat([o])):s>-1&&t.$set(t.formData,"context",a.slice(0,s).concat(a.slice(s+1)))}else t.$set(t.formData,"context",i)}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"context-hashtags"}},[t._v("\n Hashtags\n ")])])]):t._e(),t._v(" "),t.contextItemKeys.includes("thread")?e("div",{staticClass:"col-6 mb-2"},[e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.context,expression:"formData.context"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"context-thread",value:"thread"},domProps:{checked:Array.isArray(t.formData.context)?t._i(t.formData.context,"thread")>-1:t.formData.context},on:{change:function(e){var a=t.formData.context,r=e.target,i=!!r.checked;if(Array.isArray(a)){var o="thread",s=t._i(a,o);r.checked?s<0&&t.$set(t.formData,"context",a.concat([o])):s>-1&&t.$set(t.formData,"context",a.slice(0,s).concat(a.slice(s+1)))}else t.$set(t.formData,"context",i)}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"context-thread"}},[t._v("\n Conversations\n ")])])]):t._e(),t._v(" "),t.contextItemKeys.includes("groups")?e("div",{staticClass:"col-6 mb-2"},[e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.formData.context,expression:"formData.context"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"context-groups",value:"groups"},domProps:{checked:Array.isArray(t.formData.context)?t._i(t.formData.context,"groups")>-1:t.formData.context},on:{change:function(e){var a=t.formData.context,r=e.target,i=!!r.checked;if(Array.isArray(a)){var o="groups",s=t._i(a,o);r.checked?s<0&&t.$set(t.formData,"context",a.concat([o])):s>-1&&t.$set(t.formData,"context",a.slice(0,s).concat(a.slice(s+1)))}else t.$set(t.formData,"context",i)}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"context-groups"}},[t._v("\n Groups\n ")])])]):t._e()])]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"label",attrs:{for:"duration"}},[t._v("Duration")]),t._v(" "),e("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedDuration,expression:"selectedDuration"}],staticClass:"custom-select custom-select-lg form-control-mat",attrs:{id:"duration"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.selectedDuration=e.target.multiple?a:a[0]}}},[e("option",{attrs:{value:"0"}},[t._v("Forever")]),t._v(" "),e("option",{attrs:{value:"1800"}},[t._v("30 minutes")]),t._v(" "),e("option",{attrs:{value:"3600"}},[t._v("1 hour")]),t._v(" "),e("option",{attrs:{value:"21600"}},[t._v("6 hours")]),t._v(" "),e("option",{attrs:{value:"43200"}},[t._v("12 hours")]),t._v(" "),e("option",{attrs:{value:"86400"}},[t._v("1 day")]),t._v(" "),e("option",{attrs:{value:"604800"}},[t._v("1 week")]),t._v(" "),e("option",{attrs:{value:"-1"}},[t._v("Custom...")])]),t._v(" "),"-1"===t.selectedDuration?e("div",{staticClass:"input-group mt-2"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.customDuration,expression:"customDuration"}],staticClass:"form-control form-control-lg form-control-mat",attrs:{type:"number",min:"1",placeholder:"Enter duration in seconds"},domProps:{value:t.customDuration},on:{input:function(e){e.target.composing||(t.customDuration=e.target.value)}}}),t._v(" "),t._m(5)]):t._e()])]),t._v(" "),e("div",{staticClass:"modal-footer bg-light d-flex justify-content-between align-items-center"},[e("div",[e("button",{staticClass:"btn btn-outline-secondary font-weight-light rounded-pill",attrs:{type:"button"},on:{click:function(e){return t.closeModal()}}},[t._v("\n Cancel\n ")]),t._v(" "),t.isEditing?e("button",{staticClass:"btn btn-outline-danger font-weight-light rounded-pill",attrs:{type:"button"},on:{click:function(e){return t.deleteFilter()}}},[t._v("\n Delete\n ")]):t._e()]),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold rounded-pill",attrs:{type:"submit",disabled:!t.isValid}},[t.isPosting?[t._m(6)]:[t._v("\n "+t._s(t.isEditing?"Save Changes":"Create Filter")+"\n ")]],2)])])])])])])},i=[function(){var t=this._self._c;return t("span",{staticClass:"text-muted"},[t("i",{staticClass:"fal fa-times"})])},function(){var t=this._self._c;return t("div",{staticClass:"flex-grow-1"},[t("label",{staticClass:"label"},[this._v("Keywords")])])},function(){var t=this,e=t._self._c;return e("label",{staticClass:"custom-control-label d-flex align-items-center",attrs:{for:"action-blur"}},[e("span",{staticClass:"badge badge-primary mr-2"},[t._v("Blur")]),t._v("\n Hide media behind a blurbash\n ")])},function(){var t=this,e=t._self._c;return e("label",{staticClass:"custom-control-label d-flex align-items-center",attrs:{for:"action-warn"}},[e("span",{staticClass:"badge badge-warning mr-2"},[t._v("Warning")]),t._v("\n Show warning before displaying content\n ")])},function(){var t=this,e=t._self._c;return e("label",{staticClass:"custom-control-label d-flex align-items-center",attrs:{for:"action-hide"}},[e("span",{staticClass:"badge badge-danger mr-2"},[t._v("Hidden")]),t._v("\n Hide content completely\n ")])},function(){var t=this._self._c;return t("div",{staticClass:"input-group-append overflow-hidden"},[t("span",{staticClass:"input-group-text"},[this._v("seconds")])])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border text-white mx-4 spinner-border-sm",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"step-content-info text-center mb-4"},[e("div",{staticClass:"step-content-info-icon"},[e("i",{staticClass:"fal fa-filter fa-3x"})]),t._v(" "),e("h4",[t._v("Name Your Filter")]),t._v(" "),e("p",{staticClass:"text-muted"},[t._v("Give your filter a name that will help you remember what content it filters.")])])},function(){var t=this._self._c;return t("div",{staticClass:"input-group-append"},[t("span",{staticClass:"input-group-text"},[this._v("seconds")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"step-content-info text-center mb-4"},[e("div",{staticClass:"step-content-info-icon"},[e("i",{staticClass:"fal fa-key fa-3x"})]),t._v(" "),e("h4",[t._v("Add Filter Keywords")]),t._v(" "),e("p",{staticClass:"text-muted"},[t._v("Add words or phrases you want to filter."),e("br"),t._v("Content containing these words will be filtered according to your settings.")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"step-content-info text-center mb-4"},[e("div",{staticClass:"step-content-info-icon"},[e("i",{staticClass:"fal fa-shield-alt fa-3x"})]),t._v(" "),e("h4",[t._v("Choose Filter Action")]),t._v(" "),e("p",{staticClass:"text-muted"},[t._v("How would you like to handle content that matches your filter?")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body"},[e("i",{staticClass:"fas fa-tint fa-2x text-info mb-3"}),t._v(" "),e("h5",{staticClass:"card-title"},[t._v("Blur")]),t._v(" "),e("p",{staticClass:"card-text text-muted small"},[t._v("Hide media behind a blurhash")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body"},[e("i",{staticClass:"fas fa-exclamation-triangle fa-2x text-warning mb-3"}),t._v(" "),e("h5",{staticClass:"card-title"},[t._v("Warn")]),t._v(" "),e("p",{staticClass:"card-text text-muted small"},[t._v("Show a warning before displaying the content")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"card-body"},[e("i",{staticClass:"fas fa-eye-slash fa-2x text-danger mb-3"}),t._v(" "),e("h5",{staticClass:"card-title"},[t._v("Hide")]),t._v(" "),e("p",{staticClass:"card-text text-muted small"},[t._v("Completely hide content that matches")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"step-content-info text-center mb-4"},[e("div",{staticClass:"step-content-info-icon"},[e("i",{staticClass:"fal fa-map fa-3x"})]),t._v(" "),e("h4",[t._v("Choose Where to Apply")]),t._v(" "),e("p",{staticClass:"text-muted"},[t._v("Select which sections of the application should use this filter.")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"step-content-info text-center mb-4"},[e("div",{staticClass:"step-content-info-icon bg-success border-success"},[e("i",{staticClass:"fas fa-check fa-3x text-white"})]),t._v(" "),e("h4",[t._v("Review Your Filter")]),t._v(" "),e("p",{staticClass:"text-muted"},[t._v("Here's a summary of the filter you've created.")])])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border text-white mx-4 spinner-border-sm",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])}]},88546:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>o});var r=a(35627),i=a(12168);const o={name:"FiltersList",components:{FilterCard:r.default,FilterModal:i.default},data:function(){return{filters:[],loading:!0,filtersLoaded:!1,showAddFilterModal:!1,showEditFilterModal:!1,editingFilter:null,searchQuery:"",wizardMode:!0}},computed:{filteredFilters:function(){if(!this.searchQuery)return this.filters;var t=this.searchQuery.toLowerCase().trim();return this.filters.filter((function(e){return!(!e.title||!e.title.toLowerCase().includes(t))||(!(!e.keywords||!e.keywords.some((function(e){return e.keyword&&e.keyword.toLowerCase().includes(t)})))||!(!e.context||!e.context.some((function(e){return e.toLowerCase().includes(t)}))))}))}},mounted:function(){this.fetchFilters()},methods:{fetchFilters:function(){var t=this;this.loading=!0,axios.get("/api/v2/filters").then((function(e){t.filters=e.data})).catch((function(t){console.error("Failed to fetch filters:",t),swal("Error","Failed to load filters. Please try again.","error")})).finally((function(){t.loading=!1,t.filtersLoaded=!0}))},closeModals:function(){this.wizardMode=!0,this.showAddFilterModal=!1,this.showEditFilterModal=!1,this.editingFilter=null},handleFilterDelete:function(){this.deleteFilter(this.editingFilter.id),this.closeModals()},updateWizardMode:function(){this.wizardMode=!this.wizardMode},editFilter:function(t){this.wizardMode=!1,this.editingFilter=JSON.parse(JSON.stringify(t)),this.showEditFilterModal=!0},deleteFilter:function(t){var e=this;confirm("Are you sure you want to delete this filter?")&&(this.loading=!0,axios.delete("/api/v2/filters/".concat(t)).then((function(){e.filters=e.filters.filter((function(e){return e.id!==t})),swal("Success","Filter deleted successfully","success")})).catch((function(t){swal("Error","Failed to delete filter. Please try again.","error")})).finally((function(){e.loading=!1})))},saveFilter:function(t){var e=this;this.loading=!0,this.showEditFilterModal?axios.put("/api/v2/filters/".concat(t.id),t).then((function(a){var r,i,o=e.filters.findIndex((function(e){return e.id===t.id}));-1!==o&&e.$set(e.filters,o,a.data),e.$bvToast.toast("".concat(null!==(r=null===(i=a.data)||void 0===i?void 0:i.title)&&void 0!==r?r:"Untitled"," filter updated successfully"),{title:"Updated Filter",autoHideDelay:5e3,appendToast:!0,variant:"success"}),e.closeModals()})).catch((function(t){var e,a,r,i;if(null!==(e=t.response)&&void 0!==e&&null!==(e=e.data)&&void 0!==e&&e.error)swal(null===(r=t.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.error,null===(i=t.response)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.message,"error");else if(null!==(a=t.response)&&void 0!==a&&null!==(a=a.data)&&void 0!==a&&a.message){var o;swal("Error",null===(o=t.response)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.message,"error")}else swal("Error","Failed to update filter. Please try again.","error")})).finally((function(){e.loading=!1})):axios.post("/api/v2/filters",t).then((function(t){var a,r;e.filters.unshift(t.data),e.$bvToast.toast("".concat(null!==(a=null===(r=t.data)||void 0===r?void 0:r.title)&&void 0!==a?a:"Untitled"," filter created"),{title:"New Filter",autoHideDelay:5e3,appendToast:!0,variant:"success"}),e.closeModals()})).catch((function(t){var e,a,r,i;if(null!==(e=t.response)&&void 0!==e&&null!==(e=e.data)&&void 0!==e&&e.error)swal(null===(r=t.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.error,null===(i=t.response)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.message,"error");else if(null!==(a=t.response)&&void 0!==a&&null!==(a=a.data)&&void 0!==a&&a.message){var o;swal("Error",null===(o=t.response)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.message,"error")}else swal("Error","Failed to create filter. Please try again.","error")})).finally((function(){e.loading=!1}))}}}},90904:(t,e,a)=>{"use strict";a.r(e),a.d(e,{default:()=>s});var r=a(56902),i=a(49775),o={};for(const t in i)"default"!==t&&(o[t]=()=>i[t]);a.d(e,o);a(82285);const s=(0,a(14486).default)(i.default,r.render,r.staticRenderFns,!1,null,"70291054",null).exports}},t=>{t.O(0,[3660],(()=>{return e=12657,t(t.s=e);var e}));t.O()}]);
|