<commit_before>{_} = require "../Underscore"
{BaseClass} = require "../BaseClass"
{Context} = require "../Context"
{ShareComponent} = require "../Components/ShareComponent"

class ShareInfo extends BaseClass

	constructor: (options={}) ->

		@context = new Framer.Context({name: "Sharing"})
		@context.index = 20000

		run = =>
			@context.run ->
				share = new ShareComponent(Framer.Info)

		# When enabled before specifying Framer.Info
		if _.isEmpty(Framer.Info)
 			Utils.delay 0, run
		else
			run()

	destroy: ->
		@context.destroy()

exports.enable = ->
	Framer.ShareInfo ?= new ShareInfo()

exports.disable = ->
	return unless Framer.ShareInfo
	Framer.ShareInfo.destroy()
	Framer.ShareInfo = null<commit_msg>Block enabling of share info if it has been forced disabled (default)<commit_after>{_} = require "../Underscore"
{BaseClass} = require "../BaseClass"
{Context} = require "../Context"
{ShareComponent} = require "../Components/ShareComponent"

ShareInfoDisabled = false

class ShareInfo extends BaseClass

	constructor: (options={}) ->

		@context = new Framer.Context({name: "Sharing"})
		@context.index = 20000

		run = =>
			@context.run ->
				share = new ShareComponent(Framer.Info)

		# When enabled before specifying Framer.Info
		if _.isEmpty(Framer.Info)
 			Utils.delay 0, run
		else
			run()

	destroy: ->
		@context.destroy()

exports.enable = ->
	return if ShareInfoDisabled
	Framer.ShareInfo ?= new ShareInfo()

exports.disable = (force = true) ->
	ShareInfoDisabled = force
	return unless Framer.ShareInfo
	Framer.ShareInfo.destroy()
	Framer.ShareInfo = null
{'fraction_non_alphanumeric': 0.13664987405541562, 'fraction_numerical': 0.007556675062972292, 'mean_word_length': 3.9195046439628483, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7124901', 'n_tokens_mistral': 542, 'n_tokens_neox': 484, 'n_words': 127}